public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7)
{
//CECIL
if (GuiIngame.hackBuildTower) {
syncCurrentPlayItem();
if (par3ItemStack == null)
{
return false;
}
int amountInHand = par1EntityPlayer.inventory.getCurrentItem().stackSize;
int towerHeight = GuiIngame.hackBuildTower_blocks;
int holder = 0; //end tower height
if (towerHeight > amountInHand) {
holder = amountInHand;
}
else {
holder = towerHeight;
}
//Actually Places the Blocks
for (int u=0;u<holder;++u) {
netClientHandler.addToSendQueue(new Packet15Place(par4, par5+u, par6, par7, par1EntityPlayer.inventory.getCurrentItem()));
}
int i = par2World.getBlockId(par4, par5, par6);
if (i > 0 && Block.blocksList[i].blockActivated(par2World, par4, par5, par6, par1EntityPlayer))
{
return true;
}
if (par3ItemStack == null)
{
return false;
}
if (creativeMode)
{
int j = par3ItemStack.getItemDamage();
int k = par3ItemStack.stackSize;
boolean flag = par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7);
par3ItemStack.setItemDamage(j);
par3ItemStack.stackSize = k;
return flag;
}
else
{
return par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7);
}
//yea
}
//CECIL-END
else {
syncCurrentPlayItem();
netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem()));
int i = par2World.getBlockId(par4, par5, par6);
if (i > 0 && Block.blocksList[i].blockActivated(par2World, par4, par5, par6, par1EntityPlayer))
{
return true;
}
if (par3ItemStack == null)
{
return false;
}
if (creativeMode)
{
int j = par3ItemStack.getItemDamage();
int k = par3ItemStack.stackSize;
boolean flag = par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7);
par3ItemStack.setItemDamage(j);
par3ItemStack.stackSize = k;
return flag;
}
else
{
return par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7);
}
}
}
