Fix Wither not being ridable (#1761)

This commit is contained in:
Amine Kacimi
2026-02-28 20:58:24 +01:00
committed by GitHub
parent 8ce75f6be0
commit e2fb2be5a7
5 changed files with 49 additions and 48 deletions

View File

@@ -2918,7 +2918,7 @@ index 41200efbaa29ee487c0383b261122e0701413865..871adbd10f49a4d59820c089da149a47
protected void defineSynchedData(SynchedEntityData.Builder builder) {
}
diff --git a/net/minecraft/world/entity/boss/wither/WitherBoss.java b/net/minecraft/world/entity/boss/wither/WitherBoss.java
index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e29ec35728 100644
index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..5164a251c67bd3c1ccb8a49a2f1c1196a8a9764e 100644
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -72,6 +72,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@@ -2929,7 +2929,7 @@ index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e2
private boolean canPortal = false; // Paper
public final ServerBossEvent bossEvent = (ServerBossEvent)new ServerBossEvent(
this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS
@@ -81,9 +82,23 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@@ -81,10 +82,23 @@ public class WitherBoss extends Monster implements RangedAttackMob {
&& entity.attackable();
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0).selector(LIVING_ENTITY_SELECTOR);
private java.util.@Nullable UUID summoner; // Purpur - Summoner API
@@ -2937,6 +2937,7 @@ index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e2
public WitherBoss(EntityType<? extends WitherBoss> type, Level level) {
super(type, level);
- this.moveControl = new FlyingMoveControl(this, 10, false);
+ // Purpur start - Ridables
+ this.purpurController = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.1F);
+ this.moveControl = new FlyingMoveControl(this, 10, false) {
@@ -2950,10 +2951,10 @@ index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e2
+ }
+ };
+ // Purpur end - Ridables
this.moveControl = new FlyingMoveControl(this, 10, false);
this.setHealth(this.getMaxHealth());
this.xpReward = 50;
@@ -99,6 +114,105 @@ public class WitherBoss extends Monster implements RangedAttackMob {
}
@@ -99,6 +113,105 @@ public class WitherBoss extends Monster implements RangedAttackMob {
}
// Purpur end - Summoner API
@@ -3059,7 +3060,7 @@ index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e2
@Override
protected PathNavigation createNavigation(Level level) {
FlyingPathNavigation flyingPathNavigation = new FlyingPathNavigation(this, level);
@@ -109,11 +223,13 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@@ -109,11 +222,13 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@Override
protected void registerGoals() {
@@ -3073,7 +3074,7 @@ index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e2
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, LIVING_ENTITY_SELECTOR));
}
@@ -273,6 +389,15 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@@ -273,6 +388,15 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -3089,7 +3090,7 @@ index be74b2f6e21e9adb1e5c96414854a5c4f07655fc..6c516b71b91cdca51d218a154c8ea9e2
if (this.getInvulnerableTicks() > 0) {
int i = this.getInvulnerableTicks() - 1;
this.bossEvent.setProgress(1.0F - i / 220.0F);
@@ -579,11 +704,11 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@@ -579,11 +703,11 @@ public class WitherBoss extends Monster implements RangedAttackMob {
}
public int getAlternativeTarget(int head) {