Files
Purpur/patches/server/0243-horses-tempted-by-gold-config.patch

39 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: oharass <oharass@bk.ru>
Date: Mon, 6 Sep 2021 05:13:09 +0300
Subject: [PATCH] horses tempted by gold config
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 c9daf65ce500e29ce8f73d1ec6379fc2e172ae64..ea6b49cb000fb94e51df087fcc051d1cc50c05d1 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
@@ -169,6 +169,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
protected void addBehaviourGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
+ if (this.level.purpurConfig.horseTemptedByGold) // Purpur
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.GOLDEN_CARROT, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE), false));
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index a42ca33ad5cdaabfba014bb52aa85bd9002f3abd..68a38651aac5ce09b8825320de4090afdc6cd568 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1532,6 +1532,7 @@ public class PurpurWorldConfig {
public int horseBreedingTicks = 6000;
public boolean horseTakeDamageFromWater = false;
public boolean horseStandWithRider = true;
+ public boolean horseTemptedByGold = true;
private void horseSettings() {
horseRidableInWater = getBoolean("mobs.horse.ridable-in-water", horseRidableInWater);
if (PurpurConfig.version < 10) {
@@ -1550,6 +1551,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);
+ horseTemptedByGold = getBoolean("mobs.horse.tempted-by-gold", horseTemptedByGold);
}
public boolean huskRidable = false;