mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix NPE when rotating hanging entities (#356)
This commit is contained in:
parent
85d4b9f4ec
commit
fabd7045e7
@ -158,10 +158,12 @@ public class ExtentEntityCopy implements EntityFunction {
|
|||||||
Vector vector = transform.apply(direction.toVector()).subtract(transform.apply(Vector.ZERO)).normalize();
|
Vector vector = transform.apply(direction.toVector()).subtract(transform.apply(Vector.ZERO)).normalize();
|
||||||
Direction newDirection = Direction.findClosest(vector, Flag.CARDINAL);
|
Direction newDirection = Direction.findClosest(vector, Flag.CARDINAL);
|
||||||
|
|
||||||
byte hangingByte = (byte) MCDirections.toHanging(newDirection);
|
if (newDirection != null) {
|
||||||
builder.putByte("Direction", hangingByte);
|
byte hangingByte = (byte) MCDirections.toHanging(newDirection);
|
||||||
builder.putByte("Facing", hangingByte);
|
builder.putByte("Direction", hangingByte);
|
||||||
builder.putByte("Dir", MCDirections.toLegacyHanging(MCDirections.toHanging(newDirection)));
|
builder.putByte("Facing", hangingByte);
|
||||||
|
builder.putByte("Dir", MCDirections.toLegacyHanging(MCDirections.toHanging(newDirection)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user