This commit is contained in:
simibubi 2020-12-16 11:32:12 +01:00
parent fa6bac2bfc
commit 743d303bbe

View file

@ -127,14 +127,6 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
return drops;
}
@Override
public void spawnAdditionalDrops(BlockState state, World worldIn, BlockPos pos, ItemStack stack) {
BeltTileEntity controllerTE = BeltHelper.getControllerTE(worldIn, pos);
if (controllerTE != null)
controllerTE.getInventory()
.ejectAll();
}
@Override
public boolean isFlammable(BlockState state, IBlockReader world, BlockPos pos, Direction face) {
return false;
@ -436,9 +428,15 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
return;
if (isMoving)
return;
TileEntity belt = world.getTileEntity(pos);
if (belt instanceof BeltTileEntity)
belt.remove();
TileEntity te = world.getTileEntity(pos);
if (te instanceof BeltTileEntity) {
BeltTileEntity beltTileEntity = (BeltTileEntity) te;
if (beltTileEntity.isController())
beltTileEntity.getInventory()
.ejectAll();
world.removeTileEntity(pos);
}
// Destroy chain
for (boolean forward : Iterate.trueAndFalse) {
@ -452,13 +450,13 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
boolean hasPulley = false;
TileEntity tileEntity = world.getTileEntity(currentPos);
if (tileEntity instanceof BeltTileEntity) {
BeltTileEntity te = (BeltTileEntity) tileEntity;
if (te.isController())
te.getInventory()
BeltTileEntity belt = (BeltTileEntity) tileEntity;
if (belt.isController())
belt.getInventory()
.ejectAll();
te.remove();
hasPulley = te.hasPulley();
belt.remove();
hasPulley = belt.hasPulley();
}
BlockState shaftState = AllBlocks.SHAFT.getDefaultState()