Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
060bc7bbee
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 4543fb40 SPIGOT-4943: Zombie villager conversion player API. CraftBukkit Changes:585b2ebd
Tweak thresholds for can't keep up message91ada5c2
SPIGOT-4956: EntityTameEvent not triggered when taming a Cat9bda4134
SPIGOT-4943: Zombie villager conversion player API.5a027071
SPIGOT-4947: Allow setting the content on a lectern09d00e9f
SPIGOT-4938: Call EntityPickupItemEvent for dolphinsa278e445
SPIGOT-4948: Lectern.getInventory should return a LecternInventory Spigot Changes: 4f661b22 Rebuild patches
143 Zeilen
5.3 KiB
Diff
143 Zeilen
5.3 KiB
Diff
From da0e83eea89b72a5a1ef53bdc263e7d9800a1cc4 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 90923c753..5cc08ca7c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
@@ -1246,6 +1246,8 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3));
|
|
}
|
|
|
|
+ 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 171c1ae4a..b20fe8e52 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 {
|
|
private int bF;
|
|
public int drownedConversionTime;
|
|
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
|
|
+ private boolean shouldBurnInDay = true; // Paper
|
|
|
|
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
@@ -78,6 +79,7 @@ public class EntityZombie extends EntityMonster {
|
|
this.getDataWatcher().register(EntityZombie.DROWN_CONVERTING, false);
|
|
}
|
|
|
|
+ public boolean isDrowning() { return isDrownConverting(); } // Paper - OBFHELPER
|
|
public boolean isDrownConverting() {
|
|
return (Boolean) this.getDataWatcher().get(EntityZombie.DROWN_CONVERTING);
|
|
}
|
|
@@ -209,6 +211,13 @@ public class EntityZombie extends EntityMonster {
|
|
this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true);
|
|
}
|
|
|
|
+ // Paper start
|
|
+ public void stopDrowning() {
|
|
+ this.drownedConversionTime = -1;
|
|
+ this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, false);
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
protected void eb() {
|
|
this.b(EntityTypes.DROWNED);
|
|
this.world.a((EntityHuman) null, 1040, new BlockPosition(this), 0);
|
|
@@ -253,10 +262,17 @@ public class EntityZombie extends EntityMonster {
|
|
}
|
|
}
|
|
|
|
+ public boolean shouldBurnInDay() { return J_(); } // Paper - OBFHELPER
|
|
protected boolean J_() {
|
|
- return true;
|
|
+ return shouldBurnInDay;
|
|
}
|
|
|
|
+ // Paper start
|
|
+ public void setShouldBurnInDay(boolean shouldBurnInDay) {
|
|
+ this.shouldBurnInDay = shouldBurnInDay;
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
@Override
|
|
public boolean damageEntity(DamageSource damagesource, float f) {
|
|
if (super.damageEntity(damagesource, f)) {
|
|
@@ -374,6 +390,7 @@ public class EntityZombie extends EntityMonster {
|
|
nbttagcompound.setBoolean("CanBreakDoors", this.ef());
|
|
nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bF : -1);
|
|
nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1);
|
|
+ nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper
|
|
}
|
|
|
|
@Override
|
|
@@ -388,7 +405,11 @@ public class EntityZombie extends EntityMonster {
|
|
if (nbttagcompound.hasKeyOfType("DrownedConversionTime", 99) && nbttagcompound.getInt("DrownedConversionTime") > -1) {
|
|
this.startDrownedConversion(nbttagcompound.getInt("DrownedConversionTime"));
|
|
}
|
|
-
|
|
+ // Paper start
|
|
+ if (nbttagcompound.hasKey("Paper.ShouldBurnInDay")) {
|
|
+ shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay");
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
|
|
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 {
|
|
getHandle().startDrownedConversion(time);
|
|
}
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public boolean isDrowning() {
|
|
+ return getHandle().isDrowning();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void startDrowning(int drownedConversionTime) {
|
|
+ getHandle().startDrownedConversion(drownedConversionTime);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void stopDrowning() {
|
|
+ getHandle().stopDrowning();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean shouldBurnInDay() {
|
|
+ return getHandle().shouldBurnInDay();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isArmsRaised() {
|
|
+ return getHandle().isArmsRaisedZombie();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setArmsRaised(final boolean raised) {
|
|
+ getHandle().setArmsRaisedZombie(raised);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setShouldBurnInDay(boolean shouldBurnInDay) {
|
|
+ getHandle().setShouldBurnInDay(shouldBurnInDay);
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
--
|
|
2.21.0
|
|
|