use of blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IEntityProof in project ImmersiveEngineering by BluSunrize.
the class EventHandler method digSpeedEvent.
@SubscribeEvent()
public void digSpeedEvent(PlayerEvent.BreakSpeed event) {
ItemStack current = event.getEntityPlayer().getHeldItem(EnumHand.MAIN_HAND);
//Stop the combustion drill from working underwater
if (current != null && current.getItem().equals(IEContent.itemDrill) && current.getItemDamage() == 0 && event.getEntityPlayer().isInsideOfMaterial(Material.WATER))
if (((ItemDrill) IEContent.itemDrill).getUpgrades(current).getBoolean("waterproof"))
event.setNewSpeed(event.getOriginalSpeed() * 5);
else
event.setCanceled(true);
if (event.getState().getBlock() == IEContent.blockMetalDecoration2 && IEContent.blockMetalDecoration2.getMetaFromState(event.getState()) == BlockTypes_MetalDecoration2.RAZOR_WIRE.getMeta())
if (!OreDictionary.itemMatches(new ItemStack(IEContent.itemTool, 1, 1), current, false))
event.setCanceled(true);
TileEntity te = event.getEntityPlayer().getEntityWorld().getTileEntity(event.getPos());
if (te instanceof IEntityProof && !((IEntityProof) te).canEntityDestroy(event.getEntityPlayer()))
event.setCanceled(true);
}
Aggregations