Add PlotRangeIterator for the many places where it'll be used. All one of them, in fact. This was not a waste of time. I am very happy I did this. This was worthwhile. Yup.

This commit is contained in:
Alexander Söderberg
2020-07-18 16:08:37 +02:00
committed by Alexander Söderberg
parent 39fdaa367c
commit 5360df6012
5 changed files with 64 additions and 14 deletions

View File

@ -154,7 +154,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
case "ITEM_FRAME":
this.x = Math.floor(this.getX());
this.y = Math.floor(this.getY());
this.z = Math.floor(this.z);
this.z = Math.floor(this.getZ());
ItemFrame itemFrame = (ItemFrame) entity;
this.dataByte = getOrdinal(Rotation.values(), itemFrame.getRotation());
this.stack = itemFrame.getItem().clone();
@ -162,7 +162,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
case "PAINTING":
this.x = Math.floor(this.getX());
this.y = Math.floor(this.getY());
this.z = Math.floor(this.z);
this.z = Math.floor(this.getZ());
Painting painting = (Painting) entity;
Art art = painting.getArt();
this.dataByte = getOrdinal(BlockFace.values(), painting.getFacing());
@ -409,7 +409,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
Location location = lived.getLeashHolder().getLocation();
this.lived.leashX = (short) (this.getX() - location.getBlockX());
this.lived.leashY = (short) (this.getY() - location.getBlockY());
this.lived.leashZ = (short) (this.z - location.getBlockZ());
this.lived.leashZ = (short) (this.getZ() - location.getBlockZ());
}
EntityEquipment equipment = lived.getEquipment();
this.lived.equipped = equipment != null;

View File

@ -69,7 +69,7 @@ public class TeleportEntityWrapper extends EntityWrapper {
this.oldLocation = oldLocation.clone();
this.oldLocation.setX(this.getX());
this.oldLocation.setY(this.getY());
this.oldLocation.setZ(this.z);
this.oldLocation.setZ(this.getZ());
this.gravityOld = this.getEntity().hasGravity();
this.getEntity().setGravity(false);