mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-10-25 20:22:25 +00:00
BreakableInventoryBlock now checks that the TileEntity extends BreakableInventoryTile at compile time
This commit is contained in:
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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user