Fix llama not moving when ridden, Fixes #1507 (#1684)

Co-authored-by: granny <contact@granny.dev>
This commit is contained in:
MXU
2025-06-30 18:11:04 +01:00
committed by GitHub
parent d0b705e49c
commit 3658291d29
5 changed files with 25 additions and 18 deletions

View File

@@ -2384,10 +2384,10 @@ index 2a1d720557c0bd4895a32723e34512c0a557e4f2..f1cb2e315e1d86f9fcd87db11d3ee7a8
protected void randomizeAttributes(RandomSource random) {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(generateMaxHealth(random::nextInt));
diff --git a/net/minecraft/world/entity/animal/horse/Llama.java b/net/minecraft/world/entity/animal/horse/Llama.java
index 5e3382351b1b5728750534f64babc85c4da3ac54..da6450f7573ca9797577d5afae2bb1365d112177 100644
index 5e3382351b1b5728750534f64babc85c4da3ac54..f7c6b2188ed3801417c7497dbc36749def3e5057 100644
--- a/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
@@ -84,7 +84,51 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
@@ -84,7 +84,58 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
super(entityType, level);
this.getNavigation().setRequiredPathLength(40.0F);
this.maxDomestication = 30; // Paper - Missing entity API; configure max temper instead of a hardcoded value
@@ -2433,13 +2433,20 @@ index 5e3382351b1b5728750534f64babc85c4da3ac54..da6450f7573ca9797577d5afae2bb136
+
+ @Override
+ public boolean isSaddled() {
+ return super.isSaddled() || (isTamed());
+ return super.isWearingBodyArmor() || this.isTamed();
+ }
+
+ @Nullable
+ @Override
+ public LivingEntity getControllingPassenger() {
+ Entity firstPassenger = this.getFirstPassenger();
+ return !this.isNoAi() && firstPassenger instanceof net.minecraft.world.entity.Mob mob && firstPassenger.canControlVehicle() ? mob : null;
}
+ // Purpur end - Ridables
public boolean isTraderLlama() {
return false;
@@ -127,6 +171,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
@@ -127,6 +178,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -2447,7 +2454,7 @@ index 5e3382351b1b5728750534f64babc85c4da3ac54..da6450f7573ca9797577d5afae2bb136
this.goalSelector.addGoal(1, new RunAroundLikeCrazyGoal(this, 1.2));
this.goalSelector.addGoal(2, new LlamaFollowCaravanGoal(this, 2.1F));
this.goalSelector.addGoal(3, new RangedAttackGoal(this, 1.25, 40, 20.0F));
@@ -137,6 +182,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
@@ -137,6 +189,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 0.7));
this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(9, new RandomLookAroundGoal(this));