use of com.eerussianguy.firmalife.items.ItemFruitPole in project firmalife by eerussianguy.
the class CommonEventHandlerFL method onBlockHarvestDrops.
@SubscribeEvent
public static void onBlockHarvestDrops(BlockEvent.HarvestDropsEvent event) {
final IBlockState state = event.getState();
final Block block = state.getBlock();
if (block instanceof BlockFruitTreeLeaves) {
event.getDrops().add(new ItemStack(ItemsFL.FRUIT_LEAF, 2 + Constants.RNG.nextInt(4)));
} else if (block instanceof BlockFruitTreeTrunk) {
if (event.isCanceled())
event.setCanceled(false);
IFruitTree tree = ((BlockFruitTreeTrunk) block).getTree();
ItemFruitPole pole = ItemFruitPole.get(tree);
if (pole != null)
event.getDrops().add(new ItemStack(pole));
}
}
Aggregations