Bonjour à tous.
Je suis en train de faire un mod Minecraft, en java donc, et j'ai un problème.
Le code :
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
{
dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.tnt.blockID, 1, 0));
}
super.onBlockClicked(world, i, j, k, entityplayer);
}
public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l)
{
if(world.multiplayerWorld)
{
return;
} else
{
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F);
world.entityJoinedWorld(entitytntprimed);
world.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F);
return;
}
}
J'aimerais que lorsque je fait la première action, dans le "public void onBlockClicked" l'action "public void onBlockDestroyedByPlayer" ne se déclenche pas, alors que la première action je click sur le Block.
Merci.