diff --git a/common/net/minecraftforge/common/ForgeDummyContainer.java b/common/net/minecraftforge/common/ForgeDummyContainer.java index d62a69c24..d3b82ae05 100644 --- a/common/net/minecraftforge/common/ForgeDummyContainer.java +++ b/common/net/minecraftforge/common/ForgeDummyContainer.java @@ -45,6 +45,7 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces public static boolean removeErroringTileEntities = false; public static boolean disableStitchedFileSaving = false; public static boolean forceDuplicateFluidBlockCrash = true; + public static boolean fullBoundingBoxLadders = false; public ForgeDummyContainer() { @@ -116,9 +117,13 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces FMLLog.warning("Enabling removal of erroring Tile Entities - USE AT YOUR OWN RISK"); } - prop = config.get(Configuration.CATEGORY_GENERAL, "disableStitchedFileSaving", true); - prop.comment = "Set this to just disable the texture stitcher from writing the 'debug.stitched_{name}.png file to disc. Just a small performance tweak. Default: true"; - disableStitchedFileSaving = prop.getBoolean(true); + //prop = config.get(Configuration.CATEGORY_GENERAL, "disableStitchedFileSaving", true); + //prop.comment = "Set this to just disable the texture stitcher from writing the 'debug.stitched_{name}.png file to disc. Just a small performance tweak. Default: true"; + //disableStitchedFileSaving = prop.getBoolean(true); + + prop = config.get(Configuration.CATEGORY_GENERAL, "fullBoundingBoxLadders", false); + prop.comment = "Set this to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticable differences in mechanics so default is vanilla behavior. Default: false"; + fullBoundingBoxLadders = prop.getBoolean(false); prop = config.get(Configuration.CATEGORY_GENERAL, "forceDuplicateFluidBlockCrash", true); prop.comment = "Set this to force a crash if more than one block attempts to link back to the same Fluid. Enabled by default."; diff --git a/common/net/minecraftforge/common/ForgeHooks.java b/common/net/minecraftforge/common/ForgeHooks.java index 8fa371847..2ff467546 100644 --- a/common/net/minecraftforge/common/ForgeHooks.java +++ b/common/net/minecraftforge/common/ForgeHooks.java @@ -18,9 +18,11 @@ import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; import net.minecraft.network.NetServerHandler; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatMessageComponent; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumMovingObjectType; +import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.WeightedRandom; import net.minecraft.util.WeightedRandomItem; @@ -353,7 +355,32 @@ public class ForgeHooks public static boolean isLivingOnLadder(Block block, World world, int x, int y, int z, EntityLivingBase entity) { - return block != null && block.isLadder(world, x, y, z, entity); + if (!ForgeDummyContainer.fullBoundingBoxLadders) + { + return block != null && block.isLadder(world, x, y, z, entity); + } + else + { + AxisAlignedBB bb = entity.boundingBox; + int mX = MathHelper.floor_double(bb.minX); + int mY = MathHelper.floor_double(bb.minY); + int mZ = MathHelper.floor_double(bb.minZ); + for (int y2 = mY; y < bb.maxY; y2++) + { + for (int x2 = mX; x2 < bb.maxX; x2++) + { + for (int z2 = mZ; z2 < bb.maxZ; z2++) + { + block = Block.blocksList[world.getBlockId(x2, y2, z2)]; + if (block != null && block.isLadder(world, x2, y2, z2, entity)) + { + return true; + } + } + } + } + return false; + } } public static void onLivingJump(EntityLivingBase entity)