mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-14 22:43:56 +01:00
Fix crash if mechanical piston pushes a bed
This commit is contained in:
parent
e529c254c8
commit
f425b150bd
@ -7,6 +7,7 @@ import java.util.Set;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.template.Template.BlockInfo;
|
||||
|
||||
@ -38,6 +39,15 @@ public abstract class TranslatingContraption extends Contraption {
|
||||
return cachedColliders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBlocksFromWorld(IWorld world, BlockPos offset) {
|
||||
int count = blocks.size();
|
||||
super.removeBlocksFromWorld(world, offset);
|
||||
if (count != blocks.size()) {
|
||||
cachedColliders = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canAxisBeStabilized(Axis axis) {
|
||||
return false;
|
||||
|
@ -81,8 +81,7 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
|
||||
world.setBlockState(offset, Blocks.AIR.getDefaultState(), 66);
|
||||
}
|
||||
|
||||
if (contraption != null && !contraption.getBlocks()
|
||||
.isEmpty()) {
|
||||
if (!contraption.getBlocks().isEmpty()) {
|
||||
contraption.removeBlocksFromWorld(world, BlockPos.ZERO);
|
||||
movedContraption = ControlledContraptionEntity.create(world, this, contraption);
|
||||
movedContraption.setPosition(anchor.getX(), anchor.getY(), anchor.getZ());
|
||||
|
Loading…
Reference in New Issue
Block a user