From 497917185c305702aa6d699706c2ced5fc6ee66f Mon Sep 17 00:00:00 2001 From: bdew Date: Tue, 23 Jun 2015 11:19:03 +0300 Subject: [PATCH] BreakableInventoryBlock now checks that the TileEntity extends BreakableInventoryTile at compile time --- .../bdew/lib/tile/inventory/BreakableInventoryBlock.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/net/bdew/lib/tile/inventory/BreakableInventoryBlock.scala b/src/net/bdew/lib/tile/inventory/BreakableInventoryBlock.scala index fa3362f..583212e 100644 --- a/src/net/bdew/lib/tile/inventory/BreakableInventoryBlock.scala +++ b/src/net/bdew/lib/tile/inventory/BreakableInventoryBlock.scala @@ -9,16 +9,15 @@ package net.bdew.lib.tile.inventory +import net.bdew.lib.block.HasTE import net.minecraft.block.Block import net.minecraft.world.World trait BreakableInventoryBlock extends Block { + this: HasTE[_ <: BreakableInventoryTile] => override def breakBlock(world: World, x: Int, y: Int, z: Int, block: Block, meta: Int) { if (!world.isRemote) { - val te = world.getTileEntity(x, y, z).asInstanceOf[BreakableInventoryTile] - if (te != null) { - te.dropItems() - } + getTE(world, x, y, z).dropItems() } super.breakBlock(world, x, y, z, block, meta) }