From 563f4c8b84fb361f7d7e6bb0da475b7494f29007 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Thu, 19 Mar 2020 20:43:17 -0500 Subject: [PATCH] Add option to allow loyalty on tridents to work in the void --- docs/source/configuration.rst | 4 ++ ...low-loyalty-on-tridents-to-work-in-t.patch | 46 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 patches/server/0107-Add-option-to-allow-loyalty-on-tridents-to-work-in-t.patch diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 7354eea18..c395a8853 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -314,6 +314,10 @@ gameplay-mechanics - **default**: false - **description**: Boats should eject players when on land +* trident-loyalty-void-return-height + - **default**: 0.0 + - **description**: The void height at which a trident with loyalty will return to it's thrower. A value of 0.0 or higher disables this feature. + * void-damage-height - **default**: -64.0 - **description**: Lower limit where void damage starts to happen diff --git a/patches/server/0107-Add-option-to-allow-loyalty-on-tridents-to-work-in-t.patch b/patches/server/0107-Add-option-to-allow-loyalty-on-tridents-to-work-in-t.patch new file mode 100644 index 000000000..2342fa3eb --- /dev/null +++ b/patches/server/0107-Add-option-to-allow-loyalty-on-tridents-to-work-in-t.patch @@ -0,0 +1,46 @@ +From a60b14502a3461edc2ea3ae6a635254eb508c79b Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +Date: Thu, 19 Mar 2020 19:39:34 -0500 +Subject: [PATCH] Add option to allow loyalty on tridents to work in the void + +--- + src/main/java/net/minecraft/server/EntityThrownTrident.java | 2 +- + src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/main/java/net/minecraft/server/EntityThrownTrident.java b/src/main/java/net/minecraft/server/EntityThrownTrident.java +index ed8e26aa45..ca6c0ec299 100644 +--- a/src/main/java/net/minecraft/server/EntityThrownTrident.java ++++ b/src/main/java/net/minecraft/server/EntityThrownTrident.java +@@ -38,7 +38,7 @@ public class EntityThrownTrident extends EntityArrow { + + Entity entity = this.getShooter(); + +- if ((this.as || this.v()) && entity != null) { ++ if ((this.as || this.v() || (world.purpurConfig.tridentLoyaltyVoidReturnHeight < 0.0D && locY() < world.purpurConfig.tridentLoyaltyVoidReturnHeight)) && entity != null) { // Purpur + byte b0 = (Byte) this.datawatcher.get(EntityThrownTrident.ap); + + if (b0 > 0 && !this.z()) { +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index 0180d76845..0ba454b823 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -198,6 +198,7 @@ public class PurpurWorldConfig { + public String playerSleepCondition = "time >= 12541 && time <= 23458"; + public boolean useBetterMending = false; + public boolean saveProjectilesToDisk = true; ++ public double tridentLoyaltyVoidReturnHeight = 0.0D; + public double voidDamageHeight = -64.0D; + private void gameplayMechanicsSettings() { + armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight); +@@ -255,6 +256,7 @@ public class PurpurWorldConfig { + set("gameplay-mechanics.saveProjectilesToDisk", null); + } + saveProjectilesToDisk = getBoolean("gameplay-mechanics.save-projectiles-to-disk", saveProjectilesToDisk); ++ tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight); + voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight); + } + +-- +2.24.0 +