Merge pull request #840 from GirafiStudios/BOP-1.10.2-5.0.x
Fixed silk touching on BoP blocks
This commit is contained in:
commit
d98ec78ccd
2 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
||||||
|
package biomesoplenty.common.handler;
|
||||||
|
|
||||||
|
import biomesoplenty.common.block.IBOPBlock;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
public class SilkTouchEventHandler {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onSilkTouched(BlockEvent.HarvestDropsEvent event)
|
||||||
|
{
|
||||||
|
IBlockState state = event.getState();
|
||||||
|
|
||||||
|
if (state.getBlock() instanceof IBOPBlock && event.isSilkTouching())
|
||||||
|
{
|
||||||
|
event.getDrops().clear();
|
||||||
|
event.getDrops().add(state.getBlock().getPickBlock(state, null, event.getWorld(), event.getPos(), event.getHarvester()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,6 +39,7 @@ public class ModHandlers
|
||||||
MinecraftForge.EVENT_BUS.register(new AchievementEventHandler());
|
MinecraftForge.EVENT_BUS.register(new AchievementEventHandler());
|
||||||
MinecraftForge.EVENT_BUS.register(new GrassPathEventHandler());
|
MinecraftForge.EVENT_BUS.register(new GrassPathEventHandler());
|
||||||
MinecraftForge.EVENT_BUS.register(new SheepEventHandler());
|
MinecraftForge.EVENT_BUS.register(new SheepEventHandler());
|
||||||
|
MinecraftForge.EVENT_BUS.register(new SilkTouchEventHandler());
|
||||||
MinecraftForge.EVENT_BUS.register(new LootTableEventHandler());
|
MinecraftForge.EVENT_BUS.register(new LootTableEventHandler());
|
||||||
|
|
||||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||||
|
|
Loading…
Reference in a new issue