use of net.minecraft.block.BlockBeetroot in project VoodooCraft by Mod-DevCafeTeam.
the class HexGreenFingers method activeUse.
@Override
public ItemStack activeUse(ItemStack stackIn, World world, EntityPlayer player, EnumHand hand, int strength, @Nullable EntityLivingBase target) {
if (world.isRemote)
return super.activeUse(stackIn, world, player, hand, strength, target);
RayTraceResult result = Minecraft.getMinecraft().objectMouseOver;
BlockPos pos = result.getBlockPos();
Block block = world.getBlockState(pos).getBlock();
if (block instanceof BlockCrops) {
if (block instanceof BlockBeetroot) {
world.setBlockState(pos, block.getDefaultState().cycleProperty(BlockBeetroot.BEETROOT_AGE));
} else {
world.setBlockState(pos, block.getDefaultState().cycleProperty(BlockCrops.AGE));
}
}
return super.activeUse(stackIn, world, player, hand, strength, target);
}
Aggregations