From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Thu, 19 Mar 2020 19:39:34 -0500
Subject: [PATCH] Add option to allow loyalty on tridents to work in the void


diff --git a/src/main/java/net/minecraft/server/EntityThrownTrident.java b/src/main/java/net/minecraft/server/EntityThrownTrident.java
index 8026a55d462a646d6b39db21d52ba0871dfbc4d3..2acbe7437df71fc27580deddee8eb7655a297b70 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.ai || this.t()) && entity != null) {
+        if ((this.ai || this.t() || (world.purpurConfig.tridentLoyaltyVoidReturnHeight < 0.0D && locY() < world.purpurConfig.tridentLoyaltyVoidReturnHeight)) && entity != null) { // Purpur
             byte b0 = (Byte) this.datawatcher.get(EntityThrownTrident.g);
 
             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 d6a95f47c42538b574ec55c0cfffe064b80fdef0..4a0bbc0cd41b4a50ebad9b4569e07d727fc3e482 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -114,9 +114,11 @@ public class PurpurWorldConfig {
 
     public boolean disableDropsOnCrammingDeath = false;
     public boolean milkCuresBadOmen = true;
+    public double tridentLoyaltyVoidReturnHeight = 0.0D;
     private void miscGameplayMechanicsSettings() {
         disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
         milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
+        tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
     }
 
     public int playerSpawnInvulnerableTicks = 60;
