13
0
geforkt von Mirrors/Paper

Don't save canTick of armor stands if it has not been set by API (#2608)

Dieser Commit ist enthalten in:
Omer Uddin 2019-10-02 20:20:40 -04:00
Ursprung b0601574e0
Commit a91371eba8

Datei anzeigen

@ -20,7 +20,7 @@ index 09607fb44..5832c3e86 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
index c04dee058..aa9e69bce 100644
index c04dee058..529e4904e 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
@ -29,6 +29,7 @@ index c04dee058..aa9e69bce 100644
public boolean canMove = true; // Paper
+ // Paper start - Allow ArmorStands not to tick
+ public boolean canTick = true;
+ public boolean canTickSetByAPI = false;
+ private boolean noTickPoseDirty = false;
+ private boolean noTickEquipmentDirty = false;
+ // Paper end
@ -55,7 +56,7 @@ index c04dee058..aa9e69bce 100644
}
nbttagcompound.set("Pose", this.B());
+ nbttagcompound.setBoolean("Paper.CanTick", this.canTick); // Paper - persist no tick setting
+ if (this.canTickSetByAPI) nbttagcompound.setBoolean("Paper.CanTickOverride", this.canTick); // Paper - persist no tick setting
}
@Override
@ -64,8 +65,9 @@ index c04dee058..aa9e69bce 100644
this.setMarker(nbttagcompound.getBoolean("Marker"));
this.noclip = !this.A();
+ // Paper start - persist no tick
+ if (nbttagcompound.hasKey("Paper.CanTick")) {
+ this.canTick = nbttagcompound.getBoolean("Paper.CanTick");
+ if (nbttagcompound.hasKey("Paper.CanTickOverride")) {
+ this.canTick = nbttagcompound.getBoolean("Paper.CanTickOverride");
+ this.canTickSetByAPI = true;
+ }
+ // Paper end
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Pose");
@ -256,7 +258,7 @@ index e1972f793..dbf42f882 100644
float f2 = MathHelper.g(f - this.aK);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index 9f5c3b92e..07ce93f17 100644
index 9f5c3b92e..73714d71a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -0,0 +0,0 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
@ -272,6 +274,7 @@ index 9f5c3b92e..07ce93f17 100644
+ @Override
+ public void setCanTick(final boolean tick) {
+ this.getHandle().canTick = tick;
+ this.getHandle().canTickSetByAPI = true;
+ }
// Paper end
}