Java 类net.minecraft.block.BlockBeetroot 实例源码
项目:LittleThings-old
文件:RightClickCrops.java
@SubscribeEvent
public void onRightClick(PlayerInteractEvent.RightClickBlock e)
{
if (!e.getWorld().isRemote) {
BlockPos pos = e.getPos();
IBlockState state = e.getWorld().getBlockState(pos);
if (state.getBlock() instanceof BlockCrops) {
BlockCrops block = (BlockCrops) state.getBlock();
if ((block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes) && state.getValue(BlockCrops.AGE) == 7) {
performAction(e.getWorld(), e.getPos(), state, BlockCrops.AGE);
} else if (block == Blocks.beetroots && state.getValue(BlockBeetroot.BEETROOT_AGE) == 3) {
performAction(e.getWorld(), e.getPos(), state, BlockBeetroot.BEETROOT_AGE);
}
}
}
}