mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 07:27:15 +01:00
Fix #527
This commit is contained in:
parent
fa6bac2bfc
commit
743d303bbe
1 changed files with 14 additions and 16 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue