Merge pull request #3621 from SuperCoder7979/fix/door-disassembly

Break door blocks when rotating a contraption vertically
This commit is contained in:
PepperCode1 2022-08-11 11:31:39 -07:00 committed by GitHub
commit d27f979867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,8 @@ import java.util.function.BiConsumer;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.world.level.block.DoorBlock;
import org.apache.commons.lang3.tuple.MutablePair; import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
@ -1045,7 +1047,7 @@ public abstract class Contraption {
boolean verticalRotation = transform.rotationAxis == null || transform.rotationAxis.isHorizontal(); boolean verticalRotation = transform.rotationAxis == null || transform.rotationAxis.isHorizontal();
verticalRotation = verticalRotation && transform.rotation != Rotation.NONE; verticalRotation = verticalRotation && transform.rotation != Rotation.NONE;
if (verticalRotation) { if (verticalRotation) {
if (state.getBlock() instanceof RopeBlock || state.getBlock() instanceof MagnetBlock) if (state.getBlock() instanceof RopeBlock || state.getBlock() instanceof MagnetBlock || state.getBlock() instanceof DoorBlock)
world.destroyBlock(targetPos, true); world.destroyBlock(targetPos, true);
} }