mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
53 lines
2.3 KiB
Diff
53 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
|
|
Date: Tue, 9 Nov 2077 00:00:00 +0800
|
|
Subject: [PATCH] Fix MC-150224
|
|
|
|
Removed since Leaf 1.21.4, Mojang fixed in Minecraft 1.21.4 24w46a
|
|
|
|
Related MC issue: https://bugs.mojang.com/browse/MC-150224
|
|
|
|
This patch was backported from Minecraft snapshot 24w46a.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
|
index b3a0146ccfcda9fa33b91d33458086b510bb4d7b..c89f1ae4858f5af68bd958c2c92c38d0af150899 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
|
@@ -192,9 +192,11 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
|
// Purpur end
|
|
float f = 0.3F;
|
|
|
|
- if (this.horizontalCollision || this.moveControl.hasWanted() && this.moveControl.getWantedY() > this.getY() + 0.5D) {
|
|
- f = 0.5F;
|
|
+ // Leaf start - Fix MC-150224
|
|
+ if (this.moveControl.getSpeedModifier() <= 0.6) {
|
|
+ f = 0.2F;
|
|
}
|
|
+ // Leaf end - Fix MC-150224
|
|
|
|
Path pathentity = this.navigation.getPath();
|
|
|
|
@@ -206,9 +208,11 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
|
}
|
|
}
|
|
|
|
- if (this.moveControl.getSpeedModifier() <= 0.6D) {
|
|
- f = 0.2F;
|
|
+ // Leaf start - Fix MC-150224
|
|
+ if (this.horizontalCollision || this.jumping && this.moveControl.getWantedY() > this.getY() + 0.5) {
|
|
+ f = 0.5F;
|
|
}
|
|
+ // Leaf end - Fix MC-150224
|
|
|
|
return super.getJumpPower(f / 0.42F);
|
|
}
|
|
@@ -578,7 +582,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
|
public void vanillaTick() { // Purpur
|
|
if (this.rabbit.onGround() && !this.rabbit.jumping && !((Rabbit.RabbitJumpControl) this.rabbit.jumpControl).wantJump()) {
|
|
this.rabbit.setSpeedModifier(0.0D);
|
|
- } else if (this.hasWanted()) {
|
|
+ } else if (this.hasWanted() || this.operation == MoveControl.Operation.JUMPING) { // Leaf - Fix MC-150224
|
|
this.rabbit.setSpeedModifier(this.nextJumpSpeed);
|
|
}
|
|
|