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

51 lines
No EOL
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -0,0 +0,0 @@ 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();
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -0,0 +0,0 @@ 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 );
+ }
}
--