3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-03 01:50:07 +01:00

Fix NPE when rotating hanging entities (#356)

Dieser Commit ist enthalten in:
FrozenBrain 2016-05-21 02:00:30 +02:00 committet von Wizjany
Ursprung 85d4b9f4ec
Commit fabd7045e7

Datei anzeigen

@ -158,10 +158,12 @@ public class ExtentEntityCopy implements EntityFunction {
Vector vector = transform.apply(direction.toVector()).subtract(transform.apply(Vector.ZERO)).normalize();
Direction newDirection = Direction.findClosest(vector, Flag.CARDINAL);
byte hangingByte = (byte) MCDirections.toHanging(newDirection);
builder.putByte("Direction", hangingByte);
builder.putByte("Facing", hangingByte);
builder.putByte("Dir", MCDirections.toLegacyHanging(MCDirections.toHanging(newDirection)));
if (newDirection != null) {
byte hangingByte = (byte) MCDirections.toHanging(newDirection);
builder.putByte("Direction", hangingByte);
builder.putByte("Facing", hangingByte);
builder.putByte("Dir", MCDirections.toLegacyHanging(MCDirections.toHanging(newDirection)));
}
}
}