aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0063-Undead-horse-leashing.patch
blob: d377ad7cc62dc48515d397193a3822d451714f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 1124538dbf20a006fbefe28d8b32c01c922f1f0c 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
index 30f0dcfd51..89556dc94a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -201,4 +201,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);
+    }
 }
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
index cb77d6bd21..b06bbc45cf 100644
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
@@ -107,7 +107,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
 
     @Override
     public boolean a(EntityHuman entityhuman) {
-        return super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD;
+        return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper
     }
 
     @Override
-- 
2.22.0