Hello everyone, well I'm here for the 3rd time and hopefully finally able to resolve my problem. Well, I'm developing a mod that has some ores and ingots, blocks extras around, so I decided to create a Heal Block (as the name was to heal) good there I put the codes in accordance with a tutorial that I see Minecraft 1.2.3 and on, but I put the new codes, and in accordance with the Indigo Elicpse Minecraft and there was no error, but the function of the block was a mistake but it was to heal when you collide with the block but it does not and as I said above there was no mistake, I'll put the codes here for you to see:
package net.minecraft.src;
import java.util.Random;
public class BlockHeal extends Block
{
public BlockHeal(int i, int j)
{
super (i, j, Material.rock);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float var5 = 0.0625F;
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5));
}
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float var5 = 0.0625F;
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5));
}
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
if(ModLoader.getMinecraftInstance().thePlayer.health < 20)
{
ModLoader.getMinecraftInstance().thePlayer.heal(4);
}
}
}
Well there is the code as you see no error ... The part of the code:
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float var5 = 0.0625F;
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5));
}
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float var5 = 0.0625F;
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5));
}
Was removed from the BlockCactus 1.3.1 own, since the part after it respect to healing was taken from the tutorial 1.2.3. but still there was no error, either in this or another class and referred to the mod.
Well I hope that solutions, and the 3rd time I post this topic in different ways and what happens and maximum 20 views - 'good but I believe that someone can help me this error ... Even before Thanks for reading, and thanks even more if you can solve =)
I'm gonna take a guess and assume this is a bug with ModLoader, due to the recent changes. I did some testing, and can't even get the game to print out the player's health.
Well there is the code as you see no error ... The part of the code:
Was removed from the BlockCactus 1.3.1 own, since the part after it respect to healing was taken from the tutorial 1.2.3. but still there was no error, either in this or another class and referred to the mod.
Well I hope that solutions, and the 3rd time I post this topic in different ways and what happens and maximum 20 views - 'good but I believe that someone can help me this error ... Even before Thanks for reading, and thanks even more if you can solve =)