Fix cow rotation when shearing mooshroom

This commit is contained in:
William Blake Galbreath
2025-01-05 14:33:24 -08:00
committed by granny
parent 5b5266b61b
commit ae7a31be29
2 changed files with 16 additions and 24 deletions

View File

@@ -0,0 +1,16 @@
--- a/net/minecraft/world/entity/animal/MushroomCow.java
+++ b/net/minecraft/world/entity/animal/MushroomCow.java
@@ -192,6 +_,13 @@
level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, soundSource, 1.0F, 1.0F);
this.convertTo(EntityType.COW, ConversionParams.single(this, false, false), mob -> {
level.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5), this.getZ(), 1, 0.0, 0.0, 0.0, 0.0);
+ // Purpur start - Fix cow rotation when shearing mooshroom
+ mob.copyPosition(this);
+ mob.yBodyRot = this.yBodyRot;
+ mob.setYHeadRot(this.getYHeadRot());
+ mob.yRotO = this.yRotO;
+ mob.xRotO = this.xRotO;
+ // Purpur end - Fix cow rotation when shearing mooshroom
// Paper start - custom shear drops; moved drop generation to separate method
drops.forEach(drop -> {
this.spawnAtLocation(level, new ItemEntity(this.level(), this.getX(), this.getY(1.0), this.getZ(), drop));