Created
March 24, 2012 16:20
-
-
Save SanAndreaP/2184780 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean blockActivated(World world, int i, int j, int k, | |
EntityPlayer entityplayer) { | |
super.onBlockClicked(world, i, j, k, entityplayer); | |
if( entityplayer != null && | |
entityplayer.getCurrentEquippedItem() != null && | |
world.getBlockMetadata(i, j, k) != 7 && | |
entityplayer.getCurrentEquippedItem().isItemEqual(new ItemStack(Item.dyePowder, 1, 15))) { | |
growTree(world, i, j, k, world.rand); | |
entityplayer.getCurrentEquippedItem().stackSize--; | |
if(entityplayer.getCurrentEquippedItem().stackSize <= 0) | |
entityplayer.destroyCurrentEquippedItem(); | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment