mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
|
--- a/net/minecraft/server/EntityZombieVillager.java
|
||
|
+++ b/net/minecraft/server/EntityZombieVillager.java
|
||
|
@@ -7,6 +7,7 @@
|
||
|
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.h);
|
||
|
private static final DataWatcherObject<Integer> c = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b);
|
||
|
private int conversionTime;
|
||
|
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
|
||
|
|
||
|
public EntityZombieVillager(World world) {
|
||
|
super(world);
|
||
|
@@ -54,6 +55,11 @@
|
||
|
public void A_() {
|
||
|
if (!this.world.isClientSide && this.isConverting()) {
|
||
|
int i = this.dq();
|
||
|
+ // 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) {
|
||
|
@@ -116,7 +122,7 @@
|
||
|
entityvillager.setCustomNameVisible(this.getCustomNameVisible());
|
||
|
}
|
||
|
|
||
|
- this.world.addEntity(entityvillager);
|
||
|
+ this.world.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason
|
||
|
entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0));
|
||
|
this.world.a((EntityHuman) null, 1027, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0);
|
||
|
}
|