Persist ArmorStand canTick API value across restarts

This commit is contained in:
Zach Brown 2018-11-27 18:14:57 -05:00
parent cbac5b0524
commit 6c38478e65
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
2 changed files with 35 additions and 15 deletions

View file

@ -1,4 +1,4 @@
From f3634dbe784005f4a9ceef59cf1b6471979e9ecf Mon Sep 17 00:00:00 2001 From 40c679a084928c09e974747d29b572bab11290c7 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc> From: kashike <kashike@vq.lc>
Date: Wed, 15 Aug 2018 01:26:09 -0700 Date: Wed, 15 Aug 2018 01:26:09 -0700
Subject: [PATCH] Allow disabling armour stand ticking Subject: [PATCH] Allow disabling armour stand ticking
@ -20,7 +20,7 @@ index a2656abaf..95fc2d8ed 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
index 7647311df..d2b208888 100644 index 7647311df..8167fe5c9 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java --- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/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,11 @@ public class EntityArmorStand extends EntityLiving {
@ -51,7 +51,27 @@ index 7647311df..d2b208888 100644
} }
public boolean c(int i, ItemStack itemstack) { public boolean c(int i, ItemStack itemstack) {
@@ -556,7 +563,30 @@ public class EntityArmorStand extends EntityLiving { @@ -202,6 +209,7 @@ public class EntityArmorStand extends EntityLiving {
}
nbttagcompound.set("Pose", this.z());
+ nbttagcompound.setBoolean("Paper.CanTick", this.canTick); // Paper - persist no tick setting
}
public void a(NBTTagCompound nbttagcompound) {
@@ -233,6 +241,11 @@ 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");
+ }
+ // Paper end
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Pose");
this.g(nbttagcompound1);
@@ -556,7 +569,30 @@ public class EntityArmorStand extends EntityLiving {
} }
public void tick() { public void tick() {
@ -82,7 +102,7 @@ index 7647311df..d2b208888 100644
Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b); Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b);
if (!this.headPose.equals(vector3f)) { if (!this.headPose.equals(vector3f)) {
@@ -685,31 +715,37 @@ public class EntityArmorStand extends EntityLiving { @@ -685,31 +721,37 @@ public class EntityArmorStand extends EntityLiving {
public void setHeadPose(Vector3f vector3f) { public void setHeadPose(Vector3f vector3f) {
this.headPose = vector3f; this.headPose = vector3f;
this.datawatcher.set(EntityArmorStand.b, vector3f); this.datawatcher.set(EntityArmorStand.b, vector3f);

View file

@ -1,4 +1,4 @@
From a991a542b14435b8f707a4cd6708d8c4c71332f8 Mon Sep 17 00:00:00 2001 From d8ea5a96611dca8752408160df05409db6832b22 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv> From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100 Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events Subject: [PATCH] Improve death events
@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using
internal code. internal code.
diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java
index 9a74601b..6e60d15c 100644 index 9a74601b0..6e60d15cc 100644
--- a/src/main/java/net/minecraft/server/CombatTracker.java --- a/src/main/java/net/minecraft/server/CombatTracker.java
+++ b/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java
@@ -163,6 +163,7 @@ public class CombatTracker { @@ -163,6 +163,7 @@ public class CombatTracker {
@ -27,7 +27,7 @@ index 9a74601b..6e60d15c 100644
int i = this.f ? 300 : 100; int i = this.f ? 300 : 100;
if (this.g && (!this.b.isAlive() || this.b.ticksLived - this.c > i)) { if (this.g && (!this.b.isAlive() || this.b.ticksLived - this.c > i)) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 665c85ca..8abd71df 100644 index 665c85ca4..8abd71dfc 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1539,6 +1539,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -1539,6 +1539,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -55,10 +55,10 @@ index 665c85ca..8abd71df 100644
return SoundCategory.NEUTRAL; return SoundCategory.NEUTRAL;
} }
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
index d2b20888..965ace8d 100644 index 8167fe5c9..36e2c2e15 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java --- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
@@ -656,7 +656,8 @@ public class EntityArmorStand extends EntityLiving { @@ -662,7 +662,8 @@ public class EntityArmorStand extends EntityLiving {
} }
public void killEntity() { public void killEntity() {
@ -69,7 +69,7 @@ index d2b20888..965ace8d 100644
} }
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 2aedfa80..83d648ff 100644 index 2aedfa808..83d648fff 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/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 { @@ -76,14 +76,14 @@ public abstract class EntityLiving extends Entity {
@ -207,7 +207,7 @@ index 2aedfa80..83d648ff 100644
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; 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 diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 9dcf2960..720eb918 100644 index 9dcf29609..720eb9184 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -258,7 +258,7 @@ index 9dcf2960..720eb918 100644
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
index 17fab031..ee8219e3 100644 index 17fab031b..ee8219e3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
@@ -674,6 +674,22 @@ public enum CraftSound { @@ -674,6 +674,22 @@ public enum CraftSound {
@ -285,7 +285,7 @@ index 17fab031..ee8219e3 100644
this.minecraftKey = minecraftKey; 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8be0a47b..f56ef6f7 100644 index 8be0a47ba..f56ef6f71 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1711,7 +1711,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1711,7 +1711,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -306,7 +306,7 @@ index 8be0a47b..f56ef6f7 100644
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) { public void injectScaledMaxHealth(Collection<AttributeInstance> 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 diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e592dfb4..c70890cc 100644 index e592dfb44..c70890cc5 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -495,9 +495,16 @@ public class CraftEventFactory { @@ -495,9 +495,16 @@ public class CraftEventFactory {
@ -375,5 +375,5 @@ index e592dfb4..c70890cc 100644
* Server methods * Server methods
*/ */
-- --
2.17.1 2.19.1