Paper/CraftBukkit-Patches/0003-Allow-undead-horse-types-to-be-leashed.patch

54 lines
2.1 KiB
Diff
Raw Normal View History

From 393ee89fabd9b0576d7e3d63305b064fd28ec2bb Mon Sep 17 00:00:00 2001
2014-06-22 22:26:31 +02:00
From: Zach Brown <Zbob750@live.com>
Date: Sat, 12 Jul 2014 19:36:18 -0500
2014-06-22 22:26:31 +02:00
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 e9f6236..5b17bcb 100644
2014-06-22 22:26:31 +02:00
--- 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;
2014-06-22 22:26:31 +02:00
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
2014-06-22 22:26:31 +02:00
+
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 {
2014-06-22 22:26:31 +02:00
}
public boolean bM() {
- return !this.cE() && super.bM();
+ // PaperSpigot start - configurable undead horse leashing
+ if (PaperSpigotWorldConfig.allowUndeadHorseLeashing) {
2014-06-22 22:26:31 +02:00
+ return super.bM();
+ } else {
+ return !this.cE() && super.bM();
+ }
+ // PaperSpigot end
}
protected void o(float f) {
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index f3bc3aa..1eb5e47 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -74,4 +74,11 @@ public class PaperSpigotWorldConfig
config.addDefault( "world-settings.default." + path, def );
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
2014-06-22 22:26:31 +02:00
}
+
2014-06-22 22:26:31 +02:00
+ public static boolean allowUndeadHorseLeashing;
+ private void allowUndeadHorseLeashing()
+ {
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
2014-06-22 22:26:31 +02:00
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
+ }
}
2014-06-22 22:26:31 +02:00
--
1.9.1