From e1ceb8e148e89f293eb82cca19bae21653725e53 Mon Sep 17 00:00:00 2001 From: Omer Uddin Date: Wed, 2 Oct 2019 20:59:04 -0500 Subject: Don't save canTick of armor stands if it has not been set by API (#2608) --- ...0326-Allow-disabling-armour-stand-ticking.patch | 37 ++++++++++++---------- .../0345-Improve-death-events.patch | 22 ++++++------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Spigot-Server-Patches/0326-Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/0326-Allow-disabling-armour-stand-ticking.patch index baf6ec8c27..fc605108fe 100644 --- a/Spigot-Server-Patches/0326-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-Server-Patches/0326-Allow-disabling-armour-stand-ticking.patch @@ -1,11 +1,11 @@ -From 002645efa8e27923e6260c7b57956b4295567be9 Mon Sep 17 00:00:00 2001 +From 7905cae4bb0f0e9a908779158c0a7420f5afa4b3 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 15 Aug 2018 01:26:09 -0700 Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6c4cb61dc5..0b60ca82ce 100644 +index 6c4cb61d..0b60ca82 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -507,4 +507,10 @@ public class PaperWorldConfig { @@ -20,22 +20,23 @@ index 6c4cb61dc5..0b60ca82ce 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index c604182dd9..2c54e3e34a 100644 +index c604182d..32728580 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -45,6 +45,11 @@ public class EntityArmorStand extends EntityLiving { +@@ -45,6 +45,12 @@ public class EntityArmorStand extends EntityLiving { public Vector3f leftLegPose; public Vector3f rightLegPose; 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 public EntityArmorStand(World world) { super(EntityTypes.ARMOR_STAND, world); -@@ -57,6 +62,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -57,6 +63,7 @@ public class EntityArmorStand extends EntityLiving { this.leftLegPose = EntityArmorStand.bB; this.rightLegPose = EntityArmorStand.bC; this.noclip = this.isNoGravity(); @@ -43,7 +44,7 @@ index c604182dd9..2c54e3e34a 100644 this.setSize(0.5F, 1.975F); this.Q = 0.0F; } -@@ -128,6 +134,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -128,6 +135,7 @@ public class EntityArmorStand extends EntityLiving { this.bF.set(enumitemslot.b(), itemstack); } @@ -51,27 +52,28 @@ index c604182dd9..2c54e3e34a 100644 } public boolean c(int i, ItemStack itemstack) { -@@ -199,6 +206,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -199,6 +207,7 @@ public class EntityArmorStand extends EntityLiving { } nbttagcompound.set("Pose", this.z()); -+ 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 } public void a(NBTTagCompound nbttagcompound) { -@@ -230,6 +238,11 @@ public class EntityArmorStand extends EntityLiving { +@@ -230,6 +239,12 @@ public class EntityArmorStand extends EntityLiving { this.setMarker(nbttagcompound.getBoolean("Marker")); this.bI = !this.isMarker(); this.noclip = this.isNoGravity(); + // 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"); this.g(nbttagcompound1); -@@ -553,7 +566,30 @@ public class EntityArmorStand extends EntityLiving { +@@ -553,7 +568,30 @@ public class EntityArmorStand extends EntityLiving { } public void tick() { @@ -102,7 +104,7 @@ index c604182dd9..2c54e3e34a 100644 Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b); if (!this.headPose.equals(vector3f)) { -@@ -682,31 +718,37 @@ public class EntityArmorStand extends EntityLiving { +@@ -682,31 +720,37 @@ public class EntityArmorStand extends EntityLiving { public void setHeadPose(Vector3f vector3f) { this.headPose = vector3f; this.datawatcher.set(EntityArmorStand.b, vector3f); @@ -141,7 +143,7 @@ index c604182dd9..2c54e3e34a 100644 public Vector3f r() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index bc1ab273bd..cb32d64bd0 100644 +index bc1ab273..cb32d64b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -2083,52 +2083,7 @@ public abstract class EntityLiving extends Entity { @@ -257,10 +259,10 @@ index bc1ab273bd..cb32d64bd0 100644 float f2 = MathHelper.g(f - this.aQ); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 9f5c3b92e3..07ce93f17c 100644 +index 9f5c3b92..73714d71 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -297,5 +297,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -297,5 +297,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot) { return getHandle().isSlotDisabled(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot)); } @@ -273,9 +275,10 @@ index 9f5c3b92e3..07ce93f17c 100644 + @Override + public void setCanTick(final boolean tick) { + this.getHandle().canTick = tick; ++ this.getHandle().canTickSetByAPI = true; + } // Paper end } -- -2.21.0 +2.23.0 diff --git a/Spigot-Server-Patches/0345-Improve-death-events.patch b/Spigot-Server-Patches/0345-Improve-death-events.patch index ddcd256635..0c00c3368a 100644 --- a/Spigot-Server-Patches/0345-Improve-death-events.patch +++ b/Spigot-Server-Patches/0345-Improve-death-events.patch @@ -1,4 +1,4 @@ -From 31b199c08aabc3bac1268a37ab726e9905d67f3c Mon Sep 17 00:00:00 2001 +From 8a1c84ee467ab09199ed78c01b2f88b6a87b7868 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 21 Aug 2018 01:39:35 +0100 Subject: [PATCH] Improve death events @@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index bbd5e2b2a8..19750ceed1 100644 +index bbd5e2b2..19750cee 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java @@ -175,6 +175,7 @@ public class CombatTracker { @@ -27,7 +27,7 @@ index bbd5e2b2a8..19750ceed1 100644 int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 90e0d9d453..c4d4775627 100644 +index 90e0d9d4..c4d47756 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1556,6 +1556,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -55,10 +55,10 @@ index 90e0d9d453..c4d4775627 100644 return SoundCategory.NEUTRAL; } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 2c54e3e34a..a5cc5e2842 100644 +index 32728580..746e3da7 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -659,7 +659,8 @@ public class EntityArmorStand extends EntityLiving { +@@ -661,7 +661,8 @@ public class EntityArmorStand extends EntityLiving { } public void killEntity() { @@ -69,7 +69,7 @@ index 2c54e3e34a..a5cc5e2842 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 6367fdd469..3d1cdd6271 100644 +index 6367fdd4..3d1cdd62 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -76,14 +76,14 @@ public abstract class EntityLiving extends Entity { @@ -206,7 +206,7 @@ index 6367fdd469..3d1cdd6271 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index dc72538de6..62feadc8af 100644 +index dc72538d..62feadc8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -72,6 +72,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -257,7 +257,7 @@ index dc72538de6..62feadc8af 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 17fab031b4..ee8219e3ba 100644 +index 17fab031..ee8219e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java @@ -674,6 +674,22 @@ public enum CraftSound { @@ -284,7 +284,7 @@ index 17fab031b4..ee8219e3ba 100644 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7a918ea72f..8d32982c53 100644 +index 7a918ea7..8d32982c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1691,7 +1691,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -305,7 +305,7 @@ index 7a918ea72f..8d32982c53 100644 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e76862ef49..68e30185a2 100644 +index e76862ef..68e30185 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -600,9 +600,16 @@ public class CraftEventFactory { @@ -374,5 +374,5 @@ index e76862ef49..68e30185a2 100644 * Server methods */ -- -2.21.0 +2.23.0 -- cgit v1.2.3