Paper/CraftBukkit-Patches/0003-Allow-undead-horse-typ...

54 lines
1.9 KiB
Diff

From e68eda97f02a4f7e595977de5259eb89eb4f6dbd Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 24 Jun 2014 07:32:04 -0500
Subject: [PATCH] Allow undead horse types to be leashed
diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java
index 76bde8c..2b783e5 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -5,6 +5,8 @@ import java.util.List;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
+import org.spigotmc.SpigotWorldConfig; // PaperSpigot
+
public class EntityHorse extends EntityAnimal implements IInventoryListener {
private static final IEntitySelector bu = new EntitySelectorHorse();
@@ -169,7 +171,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
}
public boolean bM() {
- return !this.cE() && super.bM();
+ // PaperSpigot start - configurable undead horse leashing
+ if (SpigotWorldConfig.allowUndeadHorseLeashing) {
+ return super.bM();
+ } else {
+ return !this.cE() && super.bM();
+ }
+ // PaperSpigot end
}
protected void o(float f) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index a81b7c9..b3015bb 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -317,4 +317,11 @@ public class SpigotWorldConfig
{
witherSpawnSoundRadius = getInt( "wither-spawn-sound-radius", 0 );
}
+
+ public static boolean allowUndeadHorseLeashing;
+ private void allowUndeadHorseLeashing()
+ {
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true);
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
+ }
}
--
1.9.1