Paper/Spigot-Server-Patches/0005-Allow-undead-horse-types-to-be-leashed.patch

42 lines
1.7 KiB
Diff
Raw Normal View History

2015-03-08 01:16:09 +00:00
From 0105ce07d38b5554882c5c8293218219baf01c74 Mon Sep 17 00:00:00 2001
2015-01-29 21:25:50 +00:00
From: Zach Brown <zach.brown@destroystokyo.com>
2015-03-08 01:16:09 +00:00
Date: Sat, 7 Mar 2015 19:57:50 -0600
2014-06-22 20:26:31 +00: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
2015-03-08 01:16:09 +00:00
index 688099f..d1d45b6 100644
2014-06-22 20:26:31 +00:00
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
2015-03-08 01:16:09 +00:00
@@ -179,6 +179,11 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
2014-06-22 20:26:31 +00:00
}
2015-03-08 01:16:09 +00:00
public boolean cb() {
2014-08-05 23:45:22 +00:00
+ // PaperSpigot start - Configurable undead horse leashing
+ if (this.world.paperSpigotConfig.allowUndeadHorseLeashing) {
2015-03-08 01:16:09 +00:00
+ return super.cb();
2014-06-22 20:26:31 +00:00
+ }
+ // PaperSpigot end
2015-03-08 01:16:09 +00:00
return !this.cR() && super.cb();
2014-06-22 20:26:31 +00:00
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2015-03-08 01:16:09 +00:00
index f3bc3aa..0b47234 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 20:26:31 +00:00
}
+
2014-08-05 23:45:22 +00:00
+ public boolean allowUndeadHorseLeashing;
2014-06-22 20:26:31 +00:00
+ private void allowUndeadHorseLeashing()
+ {
2015-03-08 01:16:09 +00:00
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", false );
2014-06-22 20:26:31 +00:00
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
+ }
}
2014-06-22 20:26:31 +00:00
--
1.9.1