2014-07-03 03:47:25 +02:00
|
|
|
From 0690a27be201fcc940f79ed5ad636953a4a11b11 Mon Sep 17 00:00:00 2001
|
2014-06-22 22:26:31 +02:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-07-03 03:47:25 +02:00
|
|
|
Date: Wed, 2 Jul 2014 22:33:09 -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
|
2014-07-03 03:47:25 +02:00
|
|
|
index 76bde8c..dee187c 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
|
2014-06-24 14:21:58 +02:00
|
|
|
@@ -5,6 +5,8 @@ import java.util.List;
|
2014-06-22 22:26:31 +02:00
|
|
|
|
2014-06-24 14:21:58 +02:00
|
|
|
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
|
|
|
|
|
2014-07-03 03:47:25 +02:00
|
|
|
+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();
|
2014-06-24 14:21:58 +02:00
|
|
|
@@ -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();
|
2014-06-24 14:21:58 +02:00
|
|
|
+ // PaperSpigot start - configurable undead horse leashing
|
2014-07-03 03:47:25 +02:00
|
|
|
+ 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) {
|
2014-07-03 03:47:25 +02:00
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
index 95298f3..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-07-03 03:47:25 +02:00
|
|
|
-}
|
|
|
|
\ No newline at end of file
|
2014-06-24 14:21:58 +02:00
|
|
|
+
|
2014-06-22 22:26:31 +02:00
|
|
|
+ public static boolean allowUndeadHorseLeashing;
|
|
|
|
+ private void allowUndeadHorseLeashing()
|
|
|
|
+ {
|
2014-07-03 03:47:25 +02:00
|
|
|
+ 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-07-03 03:47:25 +02:00
|
|
|
+}
|
2014-06-22 22:26:31 +02:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|