public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float facingX, float facingY, float facingZ) {
if (!Proxies.common.isSimulating(world))
return false;
ITree tree = PluginArboriculture.treeInterface.getMember(itemstack);
if(tree == null)
return false;
if(type == EnumGermlingType.SAPLING) {
// x, y, z are the coordinates of the block "hit", can thus either be the soil or tall grass, etc.
int yShift;
if (!Utils.isReplaceableBlock(world, x, y, z)) {
if (!world.isAirBlock(x, y + 1, z))
return false;
yShift = 1;
} else
yShift = 0;
if (!tree.canStay(world, x, y + yShift, z))
return false;
if (PluginArboriculture.treeInterface.plantSapling(world, tree, player.getGameProfile(), x, y + yShift, z)) {
Proxies.common.addBlockPlaceEffects(world, x, y, z, world.getBlock(x, y + yShift, z), 0);
if (!player.capabilities.isCreativeMode)