Remove TODO on Add more Zombie API

Testing in game verified the zombie's arms raise and fall correctly
when using the API.
Renamed the OBFHELPER since the method is placed on EntityInsentient
(since we want to conflict on changes).
This commit is contained in:
Spottedleaf 2019-05-12 18:04:29 -07:00 committed by Zach
parent a22dfd8c16
commit a2db4c09a2

View file

@ -1,24 +1,24 @@
From 18daafb7221a2c0102a2c150b39057d9982393d4 Mon Sep 17 00:00:00 2001
From 1e97a9aac0db26666990c50fd5e02102f277fcd4 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 04:29:59 -0500
Subject: [PATCH] Add more Zombie API
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index a8318c88af..a0c089477a 100644
index a8318c88a..ba90cdef1 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -1250,6 +1250,8 @@ public abstract class EntityInsentient extends EntityLiving {
this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3));
}
+ public boolean isArmsRaised() { return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; } // Paper - OBFHELPER // TODO verify + obfhelper the datawatcher field
+ public void setArmsRaised(boolean flag) { this.q(flag); } // Paper - OBFHELPER // TODO verify
+ public boolean isArmsRaisedZombie() { return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; } // Paper - OBFHELPER
+ public void setArmsRaisedZombie(boolean flag) { this.q(flag); } // Paper - OBFHELPER
public void q(boolean flag) {
byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b);
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 2f0fab469b..dea1d2d4d2 100644
index 2f0fab469..dea1d2d4d 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -31,6 +31,7 @@ public class EntityZombie extends EntityMonster {
@ -92,7 +92,7 @@ index 2f0fab469b..dea1d2d4d2 100644
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
index 0429cf020e..060a6aa027 100644
index 0429cf020..c4320dbb6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
@@ -80,4 +80,41 @@ public class CraftZombie extends CraftMonster implements Zombie {
@ -123,12 +123,12 @@ index 0429cf020e..060a6aa027 100644
+
+ @Override
+ public boolean isArmsRaised() {
+ return getHandle().isArmsRaised();
+ return getHandle().isArmsRaisedZombie();
+ }
+
+ @Override
+ public void setArmsRaised(final boolean raised) {
+ getHandle().q(raised); // TODO add obfhelper and verify
+ getHandle().setArmsRaisedZombie(raised);
+ }
+
+ @Override