summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-12-13 14:10:36 +1100
committermd_5 <git@md-5.net>2018-12-13 14:10:36 +1100
commit6ec8ea5cf4f8db20562abdead706982d4e842943 (patch)
tree9c9c9d3852da9b0baeb77c2e0d92b13177753186 /nms-patches
parentc64fe5080c996e8ea29b3e113043dd0aa962aaee (diff)
downloadcraftbukkit-6ec8ea5cf4f8db20562abdead706982d4e842943.tar
craftbukkit-6ec8ea5cf4f8db20562abdead706982d4e842943.tar.gz
craftbukkit-6ec8ea5cf4f8db20562abdead706982d4e842943.tar.lz
craftbukkit-6ec8ea5cf4f8db20562abdead706982d4e842943.tar.xz
craftbukkit-6ec8ea5cf4f8db20562abdead706982d4e842943.zip
SPIGOT-4526: Add conversion time API for Zombie & subclasses
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityZombie.patch23
-rw-r--r--nms-patches/EntityZombieVillager.patch15
2 files changed, 31 insertions, 7 deletions
diff --git a/nms-patches/EntityZombie.patch b/nms-patches/EntityZombie.patch
index d4176432..6912ad16 100644
--- a/nms-patches/EntityZombie.patch
+++ b/nms-patches/EntityZombie.patch
@@ -16,8 +16,17 @@
public class EntityZombie extends EntityMonster {
protected static final IAttribute c = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
-@@ -21,6 +30,7 @@
- private int drownedConversionTime;
+@@ -14,13 +23,14 @@
+ private static final DataWatcherObject<Boolean> bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
+ private static final DataWatcherObject<Integer> bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
+ private static final DataWatcherObject<Boolean> bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
+- private static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
++ public static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); // PAIL
+ private final PathfinderGoalBreakDoor bG;
+ private boolean bH;
+ private int bI;
+- private int drownedConversionTime;
++ public int drownedConversionTime; // PAIL
private float bK;
private float bL;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@@ -39,7 +48,7 @@
if (this.drownedConversionTime < 0) {
this.dE();
}
-@@ -182,7 +196,14 @@
+@@ -182,14 +196,21 @@
}
if (flag) {
@@ -55,6 +64,14 @@
}
}
+ super.movementTick();
+ }
+
+- private void a(int i) {
++ public void a(int i) { // PAIL
+ this.drownedConversionTime = i;
+ this.getDataWatcher().set(EntityZombie.bF, true);
+ }
@@ -221,7 +242,12 @@
entityzombie.setCustomNameVisible(this.getCustomNameVisible());
}
diff --git a/nms-patches/EntityZombieVillager.patch b/nms-patches/EntityZombieVillager.patch
index e1a51981..f497e0a5 100644
--- a/nms-patches/EntityZombieVillager.patch
+++ b/nms-patches/EntityZombieVillager.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityZombieVillager.java
+++ b/net/minecraft/server/EntityZombieVillager.java
-@@ -2,6 +2,10 @@
+@@ -2,13 +2,18 @@
import java.util.UUID;
import javax.annotation.Nullable;
@@ -11,9 +11,11 @@
public class EntityZombieVillager extends EntityZombie {
-@@ -9,6 +13,7 @@
+- private static final DataWatcherObject<Boolean> a = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.i);
++ public static final DataWatcherObject<Boolean> a = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.i); // PAIL
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b);
- private int conversionTime;
+- private int conversionTime;
++ public int conversionTime; // PAIL
private UUID bD;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@@ -34,7 +36,12 @@
this.conversionTime -= i;
if (this.conversionTime <= 0) {
-@@ -100,8 +110,10 @@
+@@ -96,12 +106,14 @@
+ return (Boolean) this.getDataWatcher().get(EntityZombieVillager.a);
+ }
+
+- protected void a(@Nullable UUID uuid, int i) {
++ public void a(@Nullable UUID uuid, int i) { // PAIL
this.bD = uuid;
this.conversionTime = i;
this.getDataWatcher().set(EntityZombieVillager.a, true);