Skip to content

Commit

Permalink
Added tags for passable blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Jan 8, 2024
1 parent 63890d0 commit f5053d9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// 1.20.4 2024-01-06T06:37:23.910005 Tags for minecraft:block mod id toughasnails
// 1.20.4 2024-01-08T12:48:48.1761072 Tags for minecraft:block mod id toughasnails
bffb0fdf09ac6cfbed64666a723e8a78cb784bbd data/minecraft/tags/blocks/mineable/axe.json
0342cd45a4d6f790afda91090de45871d9b0ef63 data/minecraft/tags/blocks/mineable/pickaxe.json
eed9ca8217c04724f67008aba1a0a5edde5697c2 data/toughasnails/tags/blocks/cooling_blocks.json
658fab0118eb1ac9896e1b9ab89f2d5ed055a967 data/toughasnails/tags/blocks/heating_blocks.json
4e9fc3338709900bd37b9707629283ff25f3234a data/toughasnails/tags/blocks/passable_blocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"#minecraft:doors",
"#minecraft:trapdoors"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void onPassable(Level level, AreaFill.FillPos pos)
public boolean isPassable(Level level, AreaFill.FillPos pos)
{
BlockState state = level.getBlockState(pos.pos());
return isConfined(level, pos.pos()) && (state.isAir() || !isFlowBlocking(level, pos, state));
return isConfined(level, pos.pos()) && (state.isAir() || state.is(ModTags.Blocks.PASSABLE_BLOCKS) || !isFlowBlocking(level, pos, state));
}
}, SPREAD_RADIUS);

Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/toughasnails/init/ModTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ private static void init() {}

public static final TagKey<Block> COOLING_BLOCKS = create(new ResourceLocation(TANAPI.MOD_ID, "cooling_blocks"));
public static final TagKey<Block> HEATING_BLOCKS = create(new ResourceLocation(TANAPI.MOD_ID, "heating_blocks"));
public static final TagKey<Block> PASSABLE_BLOCKS = create(new ResourceLocation(TANAPI.MOD_ID, "passable_blocks"));

public static TagKey<Block> create(ResourceLocation name)
{
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/java/toughasnails/temperature/AreaFill.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import toughasnails.api.temperature.TemperatureHelper;
import toughasnails.core.ToughAsNails;
import toughasnails.init.ModConfig;
import toughasnails.init.ModTags;

import java.util.LinkedList;
import java.util.Queue;
Expand Down Expand Up @@ -117,7 +118,7 @@ default void onPassable(Level level, FillPos pos) {
default boolean isPassable(Level level, FillPos pos)
{
BlockState state = level.getBlockState(pos.pos());
return state.isAir() || (!isFlowBlocking(level, pos, state) && !TemperatureHelper.isHeatingBlock(state) && !TemperatureHelper.isCoolingBlock(state));
return state.isAir() || state.is(ModTags.Blocks.PASSABLE_BLOCKS) || (!isFlowBlocking(level, pos, state) && !TemperatureHelper.isHeatingBlock(state) && !TemperatureHelper.isCoolingBlock(state));
}

default boolean isConfined(Level level, BlockPos pos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ protected void addTags(HolderLookup.Provider provider)
// TAN tags
this.tag(ModTags.Blocks.COOLING_BLOCKS).add(Blocks.SOUL_FIRE, Blocks.SOUL_CAMPFIRE, Blocks.SOUL_LANTERN, Blocks.PACKED_ICE, Blocks.BLUE_ICE, Blocks.POWDER_SNOW_CAULDRON);
this.tag(ModTags.Blocks.HEATING_BLOCKS).add(Blocks.FIRE, Blocks.CAMPFIRE, Blocks.LANTERN, Blocks.LAVA, Blocks.MAGMA_BLOCK, Blocks.LAVA_CAULDRON);
this.tag(ModTags.Blocks.PASSABLE_BLOCKS).addTags(BlockTags.DOORS, BlockTags.TRAPDOORS);
}
}

0 comments on commit f5053d9

Please sign in to comment.