diff --git a/src/main/java/cam72cam/mod/world/World.java b/src/main/java/cam72cam/mod/world/World.java index b08595f0..d9fcb40d 100644 --- a/src/main/java/cam72cam/mod/world/World.java +++ b/src/main/java/cam72cam/mod/world/World.java @@ -569,7 +569,7 @@ public float getBlockHardness(Vec3i pos) { return internal.getBlockState(pos.internal()).getBlockHardness(internal, pos.internal()); } - /** Get max redstone power surrounding this block */ + /** Get max redstone power (strong and weak) surrounding this block */ public int getRedstone(Vec3i pos) { int power = 0; for (Facing facing : Facing.values()) { @@ -578,6 +578,19 @@ public int getRedstone(Vec3i pos) { return power; } + /** + * Get max strong redstone power surrounding this block + *

+ * Sometimes attempts to get weak power may trap us into infinite loop, use this in that circumstance + * */ + public int getRedstoneDirect(Vec3i pos) { + int power = 0; + for (Facing facing : Facing.values()) { + power = Math.max(power, internal.getStrongPower(pos.offset(facing).internal(), facing.internal)); + } + return power; + } + /** If the sky is visible at this position */ public boolean canSeeSky(Vec3i position) { return internal.canSeeSky(position.internal());