diff options
author | syeyoung <cyong06@naver.com> | 2021-03-08 16:45:51 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-08 16:45:51 +0900 |
commit | b701977b643be6c5f96970b4930530ab132bbca5 (patch) | |
tree | 2512abc98ec83fc938af807f5701198070e21931 /src/main/java/kr/syeyoung/dungeonsguide/pathfinding | |
parent | a6e1005132117ef69de864b7d786d766bc1bd75f (diff) | |
download | Skyblock-Dungeons-Guide-b701977b643be6c5f96970b4930530ab132bbca5.tar.gz Skyblock-Dungeons-Guide-b701977b643be6c5f96970b4930530ab132bbca5.tar.bz2 Skyblock-Dungeons-Guide-b701977b643be6c5f96970b4930530ab132bbca5.zip |
muuuuch better
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/pathfinding')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java index 8c0f447c..6b07e935 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java @@ -1,6 +1,8 @@ package kr.syeyoung.dungeonsguide.pathfinding; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import net.minecraft.block.Block; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; @@ -11,6 +13,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.Vec3i; import net.minecraft.world.pathfinder.NodeProcessor; +import java.util.Set; + public class NodeProcessorDungeonRoom extends NodeProcessor { private DungeonRoom dungeonRoom; private BlockPos sub; @@ -109,17 +113,12 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { return i; } + public static final Set<Block> allowed = Sets.newHashSet(Blocks.air, Blocks.water, Blocks.lava, Blocks.flowing_water, Blocks.flowing_lava, Blocks.vine, Blocks.ladder + , Blocks.standing_sign, Blocks.wall_sign, Blocks.trapdoor, Blocks.iron_trapdoor, Blocks.wooden_button, Blocks.stone_button, Blocks.fire, + Blocks.torch, Blocks.rail, Blocks.golden_rail, Blocks.activator_rail, Blocks.detector_rail, Blocks.carpet, Blocks.redstone_torch); + public static final IBlockState preBuilt = Blocks.stone.getStateFromMeta(2); public static boolean isValidBlock(IBlockState state) { - return state.getBlock() == Blocks.air || state.getBlock() == Blocks.water || state.getBlock() == Blocks.lava - || state.getBlock() == Blocks.flowing_water || state.getBlock() == Blocks.flowing_lava - || state.getBlock() == Blocks.vine || state.getBlock() == Blocks.ladder - || state.getBlock() == Blocks.standing_sign || state.getBlock() == Blocks.wall_sign - || state.getBlock() == Blocks.trapdoor || state.getBlock() == Blocks.iron_trapdoor - || state.getBlock() == Blocks.wooden_button || state.getBlock() == Blocks.stone_button - || state.getBlock() == Blocks.fire || state.getBlock() == Blocks.torch - || state.getBlock() == Blocks.rail || state.getBlock() == Blocks.golden_rail - || state.getBlock() == Blocks.activator_rail || state.getBlock() == Blocks.activator_rail - || state.getBlock() == Blocks.carpet || state.getBlock() == Blocks.redstone_torch - || (state == Blocks.stone.getStateFromMeta(2)); + Block b = state.getBlock(); + return state.equals(preBuilt) || allowed.contains(b); } } |