So I have a block that should behave like a ladder. And I have found the Forge Hook:
public static boolean isLivingOnLadder(Block block, World world, int x, int y, int z, EntityLivingBase entity)
{
if (!ForgeModContainer.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; y2 < bb.maxY; y2++)
{
for (int x2 = mX; x2 < bb.maxX; x2++)
{
for (int z2 = mZ; z2 < bb.maxZ; z2++)
{
block = world.getBlock(x2, y2, z2);
if (block != null && block.isLadder(world, x2, y2, z2, entity))
{
return true;
}
}
}
}
return false;
}
}
which then leads me to this property in ForgeModContainer:
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);
My question is, How do I use this property in my config file? (or do I also need to call the forge hook method in some way?)
(I have already tried this:)
Property prop;
prop = config.get(Configuration.CATEGORY_GENERAL, "fullBoundingBoxLadders", true);
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";
ForgeModContainer.fullBoundingBoxLadders = prop.getBoolean(true);
(It did not work)
Edit: this is for 1.7.2