Java Code Examples for net.minecraft.init.Blocks.brown_mushroom_block()

The following are Jave code examples for showing how to use brown_mushroom_block() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: connor41-etfuturum2   File: ServerEventHandler.java   View Source Code Vote up 5 votes
@SubscribeEvent
public void harvestEvent(BlockEvent.HarvestDropsEvent event) {
	if (EtFuturum.enableSilkTouchingMushrooms && event.isSilkTouching)
		if (event.block == Blocks.brown_mushroom_block) {
			event.drops.clear();
			event.drops.add(new ItemStack(ModBlocks.brown_mushroom_block));
		} else if (event.block == Blocks.red_mushroom_block) {
			event.drops.clear();
			event.drops.add(new ItemStack(ModBlocks.red_mushroom_block));
		}

	if (EtFuturum.enableSticksFromDeadBushes)
		if (event.block == Blocks.deadbush) {
			boolean isShears = event.harvester != null && event.harvester.getCurrentEquippedItem() != null && event.harvester.getCurrentEquippedItem().getItem() instanceof ItemShears;
			if (event.harvester == null || event.harvester.getCurrentEquippedItem() == null || !isShears)
				for (int i = 0; i < event.world.rand.nextInt(3); i++)
					event.drops.add(new ItemStack(Items.stick));
		}

	if (EtFuturum.enableShearableCobwebs)
		if (event.block == Blocks.web && event.harvester != null) {
			ItemStack stack = event.harvester.getCurrentEquippedItem();
			if (stack != null && stack.getItem() instanceof ItemShears) {
				event.drops.clear();
				event.drops.add(new ItemStack(Blocks.web));
			}
		}
}