2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-03-18 18:20:11 +00:00
|
|
|
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
|
2020-05-06 09:48:49 +00:00
|
|
|
index 04430aae52205ee167662004e45c145b9d2e8bed..dd21221534542d0265fa7d2178ab69c236579cf7 100644
|
2016-03-18 18:20:11 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-01-18 17:28:32 +00:00
|
|
|
@@ -208,4 +208,9 @@ public class PaperWorldConfig {
|
2016-07-17 01:10:43 +00:00
|
|
|
private void nonPlayerEntitiesOnScoreboards() {
|
|
|
|
nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
|
2016-03-18 18:20:11 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean allowLeashingUndeadHorse = false;
|
|
|
|
+ private void allowLeashingUndeadHorse() {
|
|
|
|
+ allowLeashingUndeadHorse = getBoolean("allow-leashing-undead-horse", false);
|
|
|
|
+ }
|
|
|
|
}
|
2016-11-17 02:23:38 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
2020-06-26 22:54:39 +00:00
|
|
|
index 364697e0155012c300219ad94a3995809e6c2f8f..d45d025fa74a5ff53f0828f51639e19613e30186 100644
|
2016-11-17 02:23:38 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
2020-06-25 11:00:35 +00:00
|
|
|
@@ -106,6 +106,13 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
|
|
|
this.bx = flag;
|
|
|
|
}
|
2016-03-18 18:20:11 +00:00
|
|
|
|
2020-06-25 11:00:35 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
2020-06-26 22:54:39 +00:00
|
|
|
+ public boolean a(EntityHuman entityhuman) {
|
2020-06-25 11:00:35 +00:00
|
|
|
+ return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2019-04-26 01:24:00 +00:00
|
|
|
@Override
|
2020-06-25 11:00:35 +00:00
|
|
|
protected void t(float f) {
|
|
|
|
if (f > 6.0F && this.fa()) {
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2020-06-26 22:54:39 +00:00
|
|
|
index 9715f10c790c0210435622ab9997ac40f98da185..2f85d9799d67d3fb1d340179d8dbd03771467329 100644
|
2020-06-25 11:00:35 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2020-06-26 22:54:39 +00:00
|
|
|
@@ -1282,7 +1282,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
|
|
|
2020-06-25 11:00:35 +00:00
|
|
|
}
|
|
|
|
|
2020-06-26 22:54:39 +00:00
|
|
|
- public boolean a(EntityHuman entityhuman) {
|
|
|
|
+ public boolean a(EntityHuman entityhuman) { // Paper - overriden in EntityHorseAbstract
|
2020-06-25 11:00:35 +00:00
|
|
|
return !this.isLeashed() && !(this instanceof IMonster);
|
2016-03-18 18:20:11 +00:00
|
|
|
}
|
|
|
|
|