diff --git a/paper-server/patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch new file mode 100644 index 0000000000..a7f4ebaaef --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch @@ -0,0 +1,16 @@ +--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java ++++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java +@@ -262,7 +_,12 @@ + } + + private void finishConversion() { +- this.convertTo(EntityType.ZOGLIN, ConversionParams.single(this, true, false), mob -> mob.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0))); ++ final Entity converted = this.convertTo(EntityType.ZOGLIN, ConversionParams.single(this, true, false), mob -> {mob.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));}, org.bukkit.event.entity.EntityTransformEvent.TransformReason.PIGLIN_ZOMBIFIED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PIGLIN_ZOMBIFIED); // CraftBukkit - add spawn and transform reasons ++ // Paper start - Fix issues with mob conversion; reset to prevent event spam ++ if (converted == null) { ++ this.timeInOverworld = 0; ++ } ++ // Paper end - Fix issues with mob conversion + } + + @Override diff --git a/paper-server/patches/sources/net/minecraft/world/entity/monster/hoglin/HoglinBase.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/monster/hoglin/HoglinBase.java.patch new file mode 100644 index 0000000000..273ab55a4d --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/entity/monster/hoglin/HoglinBase.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/entity/monster/hoglin/HoglinBase.java ++++ b/net/minecraft/world/entity/monster/hoglin/HoglinBase.java +@@ -45,7 +_,7 @@ + double d3 = d * (hoglin.level().random.nextFloat() * 0.5F + 0.2F); + Vec3 vec3 = new Vec3(d1, 0.0, d2).normalize().scale(d3).yRot(f); + double d4 = d * hoglin.level().random.nextFloat() * 0.5; +- target.push(vec3.x, d4, vec3.z); ++ target.push(vec3.x, d4, vec3.z, hoglin); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent + target.hurtMarked = true; + } + } diff --git a/paper-server/patches/unapplied/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch b/paper-server/patches/unapplied/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch deleted file mode 100644 index 345420cb17..0000000000 --- a/paper-server/patches/unapplied/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java -+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java -@@ -63,7 +63,8 @@ - public int timeInOverworld; - public boolean cannotBeHunted; - protected static final ImmutableList>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.NEAREST_ADULT, SensorType.HOGLIN_SPECIFIC_SENSOR); -- protected static final ImmutableList> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULT, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED, MemoryModuleType.IS_PANICKING}); -+ // CraftBukkit - decompile error -+ protected static final ImmutableList> MEMORY_TYPES = ImmutableList.>of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULT, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED, MemoryModuleType.IS_PANICKING}); - - public Hoglin(EntityType type, Level world) { - super(type, world); -@@ -134,7 +135,7 @@ - - @Override - public Brain getBrain() { -- return super.getBrain(); -+ return (Brain) super.getBrain(); // CraftBukkit - decompile error - } - - @Override -@@ -240,9 +241,15 @@ - } - - private void finishConversion() { -- this.convertTo(EntityType.ZOGLIN, ConversionParams.single(this, true, false), (entityzoglin) -> { -+ net.minecraft.world.entity.Entity converted = this.convertTo(EntityType.ZOGLIN, ConversionParams.single(this, true, false), (entityzoglin) -> { - entityzoglin.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0)); -- }); -+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.PIGLIN_ZOMBIFIED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PIGLIN_ZOMBIFIED); // CraftBukkit - add spawn and transform reasons -+ -+ // Paper start - Fix issues with mob conversion; reset to prevent event spam -+ if (converted == null) { -+ this.timeInOverworld = 0; -+ } -+ // Paper end - Fix issues with mob conversion - } - - @Override -@@ -326,7 +333,7 @@ - - @Override - protected SoundEvent getAmbientSound() { -- return this.level().isClientSide ? null : (SoundEvent) HoglinAi.getSoundForCurrentActivity(this).orElse((Object) null); -+ return this.level().isClientSide ? null : (SoundEvent) HoglinAi.getSoundForCurrentActivity(this).orElse(null); // CraftBukkit - decompile error - } - - @Override diff --git a/paper-server/patches/unapplied/net/minecraft/world/entity/monster/hoglin/HoglinBase.java.patch b/paper-server/patches/unapplied/net/minecraft/world/entity/monster/hoglin/HoglinBase.java.patch deleted file mode 100644 index 634a383e72..0000000000 --- a/paper-server/patches/unapplied/net/minecraft/world/entity/monster/hoglin/HoglinBase.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/entity/monster/hoglin/HoglinBase.java -+++ b/net/minecraft/world/entity/monster/hoglin/HoglinBase.java -@@ -45,7 +45,7 @@ - double j = f * (double)(attacker.level().random.nextFloat() * 0.5F + 0.2F); - Vec3 vec3 = new Vec3(g, 0.0, h).normalize().scale(j).yRot(i); - double k = f * (double)attacker.level().random.nextFloat() * 0.5; -- target.push(vec3.x, k, vec3.z); -+ target.push(vec3.x, k, vec3.z, attacker); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent - target.hurtMarked = true; - } - }