2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: TheShermanTanker <tanksherman27@gmail.com>
|
|
|
|
Date: Thu, 1 Oct 2020 01:11:03 +0800
|
|
|
|
Subject: [PATCH] MC-29274: Fix Wither hostility towards players
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-11-20 20:15:36 +01:00
|
|
|
index 843878bb83dfebca8d3574c159c5e338f15104ac..dfd4aac7a6e184a79bfdf15d9b5a92dbcb06fadd 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-11-20 20:15:36 +01:00
|
|
|
@@ -812,5 +812,11 @@ public class PaperWorldConfig {
|
2021-06-11 14:02:28 +02:00
|
|
|
private void setUpdatePathfindingOnBlockUpdate() {
|
|
|
|
updatePathfindingOnBlockUpdate = getBoolean("update-pathfinding-on-block-update", this.updatePathfindingOnBlockUpdate);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean fixWitherTargetingBug = false;
|
|
|
|
+ private void witherSettings() {
|
|
|
|
+ fixWitherTargetingBug = getBoolean("fix-wither-targeting-bug", false);
|
|
|
|
+ log("Withers properly target players: " + fixWitherTargetingBug);
|
|
|
|
+ }
|
|
|
|
}
|
2021-06-15 04:59:31 +02:00
|
|
|
|
2021-06-11 14:02:28 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
2021-10-05 05:14:11 +02:00
|
|
|
index c4b075fffae1e535b887740d48bd26da223d6798..9a5294596eb50cf4f6cf0729f6b94faaa63a5871 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
2021-06-15 04:59:31 +02:00
|
|
|
@@ -105,6 +105,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
2021-06-11 14:02:28 +02:00
|
|
|
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F));
|
|
|
|
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
|
|
|
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0]));
|
|
|
|
+ if(this.level.paperConfig.fixWitherTargetingBug) this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 0, false, false, null)); // Paper - Fix MC-29274
|
|
|
|
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Mob.class, 0, false, false, WitherBoss.LIVING_ENTITY_SELECTOR));
|
|
|
|
}
|
|
|
|
|