Files
Purpur/patches/server/0256-horses-tempted-by-gold-config.patch
William Blake Galbreath 8bd08ceeea Updated Upstream (Paper & Airplane)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
06db5d08b0 Updated Upstream (Bukkit/CraftBukkit) (#6589)
810d200bb4 Improve interact distance check (#6591)

Airplane Changes:
8207533bdf Upstream
2021-09-12 22:24:02 -05:00

39 lines
2.3 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 03ae6519a523ee73cce664d85074b5f9525de6d6..206be7e1fc85fed99118020490d8494d197597ab 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
@@ -168,6 +168,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
protected void addBehaviourGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
+ if (this.level.purpurConfig.horseTemptedByGold) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.25D, Ingredient.of(Items.GOLDEN_CARROT, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE), false)); // Purpur
}
@Override
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index ecc07192df1b7c3e712d4ca415a13241b23dd94d..e5e44a03efdf4c3c7309b0572af275adf8243731 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1504,6 +1504,7 @@ public class PurpurWorldConfig {
public double horseMovementSpeedMax = 0.3375D;
public int horseBreedingTicks = 6000;
public boolean horseStandWithRider = true;
+ public boolean horseTemptedByGold = false;
private void horseSettings() {
horseRidableInWater = getBoolean("mobs.horse.ridable-in-water", horseRidableInWater);
if (PurpurConfig.version < 10) {
@@ -1521,6 +1522,7 @@ public class PurpurWorldConfig {
horseMovementSpeedMax = getDouble("mobs.horse.attributes.movement_speed.max", horseMovementSpeedMax);
horseBreedingTicks = getInt("mobs.horse.breeding-delay-ticks", horseBreedingTicks);
horseStandWithRider = getBoolean("mobs.horse.stand-with-rider", horseStandWithRider);
+ horseTemptedByGold = getBoolean("mobs.horse.tempted-by-gold", horseTemptedByGold);
}
public boolean huskRidable = false;