Paper/Spigot-Server-Patches/0072-Undead-horse-leashing.patch

38 lines
1.7 KiB
Diff
Raw Normal View History

2016-12-20 23:34:27 +01:00
From 1e899a5dc8e3b0a2a2890efe028aa4e3446d721d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 14:19:19 -0400
Subject: [PATCH] Undead horse leashing
default false to match vanilla, but option to allow undead horse types to be leashed.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-11-17 03:23:38 +01:00
index b3678da..029eb39 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-11-17 03:23:38 +01:00
@@ -255,4 +255,9 @@ public class PaperWorldConfig {
private void nonPlayerEntitiesOnScoreboards() {
nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
}
+
+ public boolean allowLeashingUndeadHorse = false;
+ private void allowLeashingUndeadHorse() {
+ allowLeashingUndeadHorse = getBoolean("allow-leashing-undead-horse", false);
+ }
}
2016-11-17 03:23:38 +01:00
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
index d74ccd6..3416c7a 100644
2016-11-17 03:23:38 +01:00
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
@@ -115,7 +115,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
}
public boolean a(EntityHuman entityhuman) {
2016-11-17 03:23:38 +01:00
- return super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD;
+ return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper
}
2016-11-17 03:23:38 +01:00
protected void q(float f) {
--
2.9.3