mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
net.minecraft.world.entity.monster.hoglin
This commit is contained in:
@@ -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
|
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user