mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-22 16:29:26 +00:00
67 lines
3.3 KiB
Diff
67 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MartijnMuijsers <martijnmuijsers@live.nl>
|
|
Date: Tue, 29 Nov 2022 16:42:48 +0100
|
|
Subject: [PATCH] Fix MC-121706
|
|
|
|
License: MIT (https://opensource.org/licenses/MIT)
|
|
|
|
This patch is based on the following patch:
|
|
"MC-121706 - Fix mobs not looking up and down when strafing"
|
|
By: Krakenied <Krakenied1@gmail.com>
|
|
As part of: Purpur (https://github.com/PurpurMC/Purpur)
|
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
|
index 6558b0d4bea99948fdc2b51751f3cfdc239d4b67..bedb5b8ee24817a494455f17e1f32b42d64c4dd2 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
|
@@ -102,7 +102,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
|
this.strafingTime = 0;
|
|
}
|
|
|
|
- if (this.strafingTime > -1) {
|
|
+ // Gale start - Purpur - fix MC-121706
|
|
+ boolean hasStrafingTime = this.strafingTime > -1;
|
|
+ if (hasStrafingTime) {
|
|
+ // Gale end - Purpur - fix MC-121706
|
|
if (d > (double)(this.attackRadiusSqr * 0.75F)) {
|
|
this.strafingBackwards = false;
|
|
} else if (d < (double)(this.attackRadiusSqr * 0.25F)) {
|
|
@@ -111,7 +114,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
|
|
|
this.mob.getMoveControl().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F);
|
|
this.mob.lookAt(livingEntity, 30.0F, 30.0F);
|
|
- } else {
|
|
+ // Gale start - Purpur - fix MC-121706
|
|
+ }
|
|
+ if (!hasStrafingTime || this.mob.level.galeConfig().gameplayMechanics.fixes.mc121706) {
|
|
+ // Gale end - Purpur - fix MC-121706
|
|
this.mob.getLookControl().setLookAt(livingEntity, 30.0F, 30.0F);
|
|
}
|
|
|
|
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
index a774fbeaa3829b1ae702fb61a0acb9d69d18a081..0ae303da1858ed75cb0eb4b224a0e21fa352fc70 100644
|
|
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
@@ -249,7 +249,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
|
|
public boolean sandDuping = true; // Gale - Purpur - make sand duping fix configurable
|
|
public boolean keepMooshroomRotationAfterShearing = true; // Gale - Purpur - fix cow rotation when shearing mooshroom
|
|
-
|
|
+
|
|
// Gale start - Purpur - fix MC-238526
|
|
@Setting("mc-238526")
|
|
public boolean mc238526 = false;
|
|
@@ -260,6 +260,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
public boolean mc123848 = false;
|
|
// Gale end - Purpur - fix MC-123848
|
|
|
|
+ // Gale start - Purpur - fix MC-121706
|
|
+ @Setting("mc-121706")
|
|
+ public boolean mc121706 = false;
|
|
+ // Gale end - Purpur - fix MC-121706
|
|
+
|
|
}
|
|
|
|
}
|