BreakableInventoryBlock now checks that the TileEntity extends BreakableInventoryTile at compile time

This commit is contained in:
bdew committed 2015-06-23 11:19:03 +03:00
1 parent 9ff7a75604
commit 497917185c
1 file changed
+3 -4
@@ -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)
}