Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
32 Zeilen
1.4 KiB
Diff
32 Zeilen
1.4 KiB
Diff
--- a/net/minecraft/server/EntityZombieVillager.java
|
|
+++ b/net/minecraft/server/EntityZombieVillager.java
|
|
@@ -9,6 +9,7 @@
|
|
private static final DataWatcherObject<Integer> c = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b);
|
|
private int conversionTime;
|
|
private UUID by;
|
|
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
|
|
|
|
public EntityZombieVillager(World world) {
|
|
super(world);
|
|
@@ -60,6 +61,11 @@
|
|
public void B_() {
|
|
if (!this.world.isClientSide && this.isConverting()) {
|
|
int i = this.ds();
|
|
+ // 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) {
|
|
@@ -123,7 +129,7 @@
|
|
entityvillager.setCustomNameVisible(this.getCustomNameVisible());
|
|
}
|
|
|
|
- this.world.addEntity(entityvillager);
|
|
+ this.world.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason
|
|
EntityHuman entityhuman = this.world.b(this.by);
|
|
|
|
if (entityhuman instanceof EntityPlayer) {
|