PaperMC/patches/server/0624-Fix-issues-with-mob-conversion.patch

60 lines
3.2 KiB
Diff
Raw Normal View History

2021-11-06 01:06:19 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sun, 24 Oct 2021 20:29:45 -0700
Subject: [PATCH] Fix issues with mob conversion
diff --git a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
index e88af2dcc0f7fc5190654e2640f67d706e6c8c81..92974452d8f63fde8524cfac305ee2ef5212f840 100644
2021-11-06 01:06:19 +01:00
--- a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
2022-12-07 21:16:54 +01:00
@@ -90,10 +90,15 @@ public class Skeleton extends AbstractSkeleton {
2021-11-06 01:06:19 +01:00
}
protected void doFreezeConversion() {
- this.convertTo(EntityType.STRAY, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN); // CraftBukkit - add spawn and transform reasons
+ Stray stray = this.convertTo(EntityType.STRAY, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN); // CraftBukkit - add spawn and transform reasons // Paper - Fix issues with mob conversion
2023-06-08 04:12:38 +02:00
if (!this.isSilent()) {
this.level().levelEvent((Player) null, 1048, this.blockPosition(), 0);
2021-11-06 01:06:19 +01:00
}
+ // Paper start - Fix issues with mob conversion; reset conversion time to prevent event spam
2021-11-06 01:06:19 +01:00
+ if (stray == null) {
+ this.conversionTime = 300;
+ }
+ // Paper end - Fix issues with mob conversion
2021-11-06 01:06:19 +01:00
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
index 7bcd5498c734873b74bee503992ec4806ae61df7..01a2016ac82807d28ffe407b7dbb74bdbcde503e 100644
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
2023-09-22 15:32:32 +02:00
@@ -241,6 +241,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
if (zoglin != null) {
zoglin.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
}
+ // Paper start - Fix issues with mob conversion; reset to prevent event spam
+ else {
+ this.timeInOverworld = 0;
+ }
+ // Paper end - Fix issues with mob conversion
}
2021-11-06 01:06:19 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
index 22c8d6233be5e4f7fb4f03176e83dbee02256b1f..c575a86ca5c1bbdd6d2faf6e4a609af8ba03cab6 100644
2021-11-06 01:06:19 +01:00
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
2023-09-22 15:32:32 +02:00
@@ -120,6 +120,11 @@ public abstract class AbstractPiglin extends Monster {
2021-11-06 01:06:19 +01:00
if (entitypigzombie != null) {
entitypigzombie.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
}
+ // Paper start - Fix issues with mob conversion; reset to prevent event spam
2021-11-06 01:06:19 +01:00
+ else {
+ this.timeInOverworld = 0;
+ }
+ // Paper end - Fix issues with mob conversion
2021-11-06 01:06:19 +01:00
}