Skip to content

Commit bab33f8

Browse files
authored
Add a tag for valid cleanroom doors (GregTechCEu#3264)
1 parent 32ed665 commit bab33f8

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"values": [
3+
"minecraft:iron_door",
4+
"#minecraft:wooden_doors"
5+
]
6+
}

src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/CleanroomMachine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ protected BlockState getGlassState() {
416416

417417
@NotNull
418418
protected static TraceabilityPredicate doorPredicate() {
419-
return Predicates.custom(blockWorldState -> blockWorldState.getBlockState().getBlock() instanceof DoorBlock,
419+
return Predicates.custom(blockWorldState -> blockWorldState.getBlockState().is(CustomTags.CLEANROOM_DOORS),
420420
() -> new BlockInfo[] { new BlockInfo(Blocks.IRON_DOOR.defaultBlockState()), new BlockInfo(
421421
Blocks.IRON_DOOR.defaultBlockState().setValue(DoorBlock.HALF, DoubleBlockHalf.UPPER)) });
422422
}

src/main/java/com/gregtechceu/gtceu/data/recipe/CustomTags.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public class CustomTags {
120120
public static final TagKey<Item> STEP_BOOTS = TagUtil.createModItemTag("step_boots");
121121
public static final TagKey<Item> RUBBER_LOGS = TagUtil.createModItemTag("rubber_logs");
122122

123+
public static final TagKey<Block> CLEANROOM_DOORS = TagUtil.createModBlockTag("cleanroom_doors");
124+
123125
public static final TagKey<Item> CHEM_BATH_WASHABLE = TagUtil.createModItemTag("chemical_bath_washable");
124126

125127
// Mineability tags

src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@ public static void init(RegistrateTagsProvider.IntrinsicImpl<Block> provider) {
6161
.add(Blocks.DIRT_PATH) // path blocks
6262
.addTag(Tags.Blocks.SAND).addTag(BlockTags.SAND) // any sand blocks
6363
.addTag(BlockTags.TERRACOTTA); // any terracotta
64+
65+
provider.addTag(CustomTags.CLEANROOM_DOORS).add(Blocks.IRON_DOOR).addTag(BlockTags.WOODEN_DOORS);
6466
}
6567
}

0 commit comments

Comments
 (0)