consistency
This commit is contained in:
parent
4c4bc8058b
commit
ce606f826b
@ -195,13 +195,13 @@ public class MovementTraverse extends Movement {
|
|||||||
|
|
||||||
boolean door = pb0.getBlock() instanceof BlockDoor || pb1.getBlock() instanceof BlockDoor;
|
boolean door = pb0.getBlock() instanceof BlockDoor || pb1.getBlock() instanceof BlockDoor;
|
||||||
if (door) {
|
if (door) {
|
||||||
boolean isDoorActuallyBlockingUs = false;
|
boolean blocked = false;
|
||||||
if (pb0.getBlock() instanceof BlockDoor && !MovementHelper.isDoorPassable(ctx, src, dest)) {
|
if (pb0.getBlock() instanceof BlockDoor && !MovementHelper.isDoorPassable(ctx, src, dest)) {
|
||||||
isDoorActuallyBlockingUs = true;
|
blocked = true;
|
||||||
} else if (pb1.getBlock() instanceof BlockDoor && !MovementHelper.isDoorPassable(ctx, dest, src)) {
|
} else if (pb1.getBlock() instanceof BlockDoor && !MovementHelper.isDoorPassable(ctx, dest, src)) {
|
||||||
isDoorActuallyBlockingUs = true;
|
blocked = true;
|
||||||
}
|
}
|
||||||
if (isDoorActuallyBlockingUs && !(Blocks.IRON_DOOR.equals(pb0.getBlock()) || Blocks.IRON_DOOR.equals(pb1.getBlock()))) {
|
if (blocked && !(Blocks.IRON_DOOR.equals(pb0.getBlock()) || Blocks.IRON_DOOR.equals(pb1.getBlock()))) {
|
||||||
return state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), positionsToBreak[0]), ctx.playerRotations()), true))
|
return state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.calculateBlockCenter(ctx.world(), positionsToBreak[0]), ctx.playerRotations()), true))
|
||||||
.setInput(Input.CLICK_RIGHT, true);
|
.setInput(Input.CLICK_RIGHT, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user