Files
Purpur/patches/server/0268-Config-to-prevent-horses-from-standing-when-hurt.patch
Krakenied fff2015d52 Updated Upstream (Paper) (#1174)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@7b3b593 [ci skip] Update checkout action in workflow (#8510)
PaperMC/Paper@36869cc Fix new block data in EntityChangeBlockEvent for silverfish when mobGriefing isn't enabled (#8099)
PaperMC/Paper@2432233 Add allow server listing & text filtering client options (#7595)
PaperMC/Paper@954e6f0 Fix a bunch more forceDrops for dropping items (#8095)
PaperMC/Paper@32d95e9 Track projectile source for fireworks from dispensers (#8044)
PaperMC/Paper@0249750 Fix EntityArgument suggestion permissions to align with EntitySelector#checkPermissions (#8511)
PaperMC/Paper@8acb05d Make CommandSyntaxException implement ComponentMessageThrowable (#8513)
PaperMC/Paper@c264018 [ci skip] Undo modification to removed patches in latest commit (#8512)
PaperMC/Paper@304ab35 [ci skip] Remove old todo file
PaperMC/Paper@8a4b752 Fix wrong descriptor in ASMEventExecutorGenerator (#8506)
PaperMC/Paper@b743144 Fix MC-147659 (#8423)
PaperMC/Paper@aaf5e39 Deprecate unused VehicleEntityCollisionEvent methods (#8498)
2022-10-29 22:47:43 -07:00

43 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: galacticwarrior9 <zareef1@yahoo.com>
Date: Thu, 14 Apr 2022 17:48:07 +0100
Subject: [PATCH] Config to prevent horses from standing when hurt
Horses have a chance to stand when their hurt noise plays (i.e. when taking damage).
This patch adds an option to toggle this behaviour ('stand-when-hurt').
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
index 7466c437b2e996f16a08aaefc5c2b7cba216a14c..205ce2bd91a98a0c67d3c5dd640eb88c052f9425 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
@@ -388,7 +388,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
@Nullable
@Override
protected SoundEvent getHurtSound(DamageSource source) {
- if (this.random.nextInt(3) == 0) {
+ if (this.level.purpurConfig.horseStandWhenHurt && this.random.nextInt(3) == 0) { // Purpur
this.stand();
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 8a3b8bed4058336625cc3dcbe9449416dc666476..d9f6345190d6efa330a680bc4d46962e47ad50f2 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1682,6 +1682,7 @@ public class PurpurWorldConfig {
public int horseBreedingTicks = 6000;
public boolean horseTakeDamageFromWater = false;
public boolean horseStandWithRider = true;
+ public boolean horseStandWhenHurt = true;
public boolean horseAlwaysDropExp = false;
private void horseSettings() {
horseRidableInWater = getBoolean("mobs.horse.ridable-in-water", horseRidableInWater);
@@ -1701,6 +1702,7 @@ public class PurpurWorldConfig {
horseBreedingTicks = getInt("mobs.horse.breeding-delay-ticks", horseBreedingTicks);
horseTakeDamageFromWater = getBoolean("mobs.horse.takes-damage-from-water", horseTakeDamageFromWater);
horseStandWithRider = getBoolean("mobs.horse.stand-with-rider", horseStandWithRider);
+ horseStandWhenHurt = getBoolean("mobs.horse.stand-when-hurt", horseStandWhenHurt);
horseAlwaysDropExp = getBoolean("mobs.horse.always-drop-exp", horseAlwaysDropExp);
}