From 1f36eb12edee837e45332436eae8508514fc278b Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 5 Jan 2025 16:56:10 -0800 Subject: [PATCH] Add option for boats to eject players on land --- ...n-for-boats-to-eject-players-on-land.patch | 35 ------------------- .../entity/vehicle/AbstractBoat.java.patch | 10 ++++++ .../purpurmc/purpur/PurpurWorldConfig.java | 2 ++ 3 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 patches/server/0055-Add-option-for-boats-to-eject-players-on-land.patch create mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/AbstractBoat.java.patch diff --git a/patches/server/0055-Add-option-for-boats-to-eject-players-on-land.patch b/patches/server/0055-Add-option-for-boats-to-eject-players-on-land.patch deleted file mode 100644 index 09b48eee7..000000000 --- a/patches/server/0055-Add-option-for-boats-to-eject-players-on-land.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: William Blake Galbreath -Date: Sat, 7 Sep 2019 22:47:59 -0500 -Subject: [PATCH] Add option for boats to eject players on land - - -diff --git a/net/minecraft/world/entity/vehicle/AbstractBoat.java b/net/minecraft/world/entity/vehicle/AbstractBoat.java -index b87fd952020d88a6612429df73121422bf9ae422..a301f32a292afb010f3888732e339897b176243d 100644 ---- a/net/minecraft/world/entity/vehicle/AbstractBoat.java -+++ b/net/minecraft/world/entity/vehicle/AbstractBoat.java -@@ -499,6 +499,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { - - if (f > 0.0F) { - this.landFriction = f; -+ if (level().purpurConfig.boatEjectPlayersOnLand) ejectPassengers(); // Purpur - return AbstractBoat.Status.ON_LAND; - } else { - return AbstractBoat.Status.IN_AIR; -diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 04b3b0661143d4d600dd34cd91498acbc929b10d..3e78e57f29e98db2dde7d650b65ee23f99238ff7 100644 ---- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -96,10 +96,12 @@ public class PurpurWorldConfig { - armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight); - } - -+ public boolean boatEjectPlayersOnLand = false; - public boolean disableDropsOnCrammingDeath = false; - public boolean milkCuresBadOmen = true; - public double tridentLoyaltyVoidReturnHeight = 0.0D; - private void miscGameplayMechanicsSettings() { -+ boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand); - 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); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/AbstractBoat.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/AbstractBoat.java.patch new file mode 100644 index 000000000..430b15eb4 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/AbstractBoat.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/entity/vehicle/AbstractBoat.java ++++ b/net/minecraft/world/entity/vehicle/AbstractBoat.java +@@ -483,6 +_,7 @@ + float groundFriction = this.getGroundFriction(); + if (groundFriction > 0.0F) { + this.landFriction = groundFriction; ++ if (level().purpurConfig.boatEjectPlayersOnLand) ejectPassengers(); // Purpur - Add option for boats to eject players on land + return AbstractBoat.Status.ON_LAND; + } else { + return AbstractBoat.Status.IN_AIR; diff --git a/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index d0a0652c4..259e7f0d2 100644 --- a/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -84,10 +84,12 @@ public class PurpurWorldConfig { armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight); } + public boolean boatEjectPlayersOnLand = false; public boolean disableDropsOnCrammingDeath = false; public boolean milkCuresBadOmen = true; public double tridentLoyaltyVoidReturnHeight = 0.0D; private void miscGameplayMechanicsSettings() { + boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand); 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);