Yatopia/patches/Purpur/patches/server/0056-Add-option-to-allow-lo...

36 lines
2.1 KiB
Diff

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/world/entity/projectile/EntityThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/EntityThrownTrident.java
index 646043987e1102ae8e9becc9820e6c6d86ef844d..7aadfe6598f0d3d41b94cfc003fcc9d075ee6ae5 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityThrownTrident.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityThrownTrident.java
@@ -60,7 +60,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 28ac3fcfb73acddd13712f5c625bd61be99cb7c5..5d4432177aabbfd72e549b3bb5cf5381f71ce07a 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;