Paper/nms-patches/EntityZombieVillager.patch

32 lines
1.4 KiB
Diff
Raw Normal View History

2016-11-17 02:41:03 +01:00
--- a/net/minecraft/server/EntityZombieVillager.java
+++ b/net/minecraft/server/EntityZombieVillager.java
2017-05-14 04:00:00 +02:00
@@ -9,6 +9,7 @@
2016-11-17 02:41:03 +01:00
private static final DataWatcherObject<Integer> c = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b);
private int conversionTime;
2017-05-14 04:00:00 +02:00
private UUID by;
2016-11-17 02:41:03 +01:00
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
public EntityZombieVillager(World world) {
super(world);
2017-05-14 04:00:00 +02:00
@@ -60,6 +61,11 @@
public void B_() {
2016-11-17 02:41:03 +01:00
if (!this.world.isClientSide && this.isConverting()) {
2017-05-14 04:00:00 +02:00
int i = this.ds();
2016-11-17 02:41:03 +01:00
+ // CraftBukkit start - Use wall time instead of ticks for villager conversion
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
+ this.lastTick = MinecraftServer.currentTick;
+ i *= elapsedTicks;
+ // CraftBukkit end
this.conversionTime -= i;
if (this.conversionTime <= 0) {
2017-05-14 04:00:00 +02:00
@@ -123,7 +129,7 @@
2016-11-17 02:41:03 +01:00
entityvillager.setCustomNameVisible(this.getCustomNameVisible());
}
- this.world.addEntity(entityvillager);
+ this.world.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason
2017-05-14 04:00:00 +02:00
EntityHuman entityhuman = this.world.b(this.by);
if (entityhuman instanceof EntityPlayer) {