Add option to allow loyalty on tridents to work in the void

This commit is contained in:
William Blake Galbreath
2020-03-19 20:43:17 -05:00
parent 66f4378995
commit 563f4c8b84
2 changed files with 50 additions and 0 deletions

View File

@@ -314,6 +314,10 @@ gameplay-mechanics
- **default**: false - **default**: false
- **description**: Boats should eject players when on land - **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 * void-damage-height
- **default**: -64.0 - **default**: -64.0
- **description**: Lower limit where void damage starts to happen - **description**: Lower limit where void damage starts to happen

View File

@@ -0,0 +1,46 @@
From a60b14502a3461edc2ea3ae6a635254eb508c79b 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
---
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