mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Config to prevent horses from standing when hurt (#957)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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 f7088aaf65ee5725e928845a634852119b403cef..443d1bdb352352909a1d8859ae2eb93b4331f45f 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
|
||||
@@ -386,7 +386,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 992a2e37fa093196165b67e88123e00100ae6208..aefbd3e53d3b608d58b6f051bc775eedb1edc397 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1686,6 +1686,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);
|
||||
@@ -1705,6 +1706,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user