Files
Purpur/patches/server/0053-Add-option-for-boats-to-eject-players-on-land.patch
2024-06-15 23:43:54 -07:00

38 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 7 Sep 2019 22:47:59 -0500
Subject: [PATCH] Add option for boats to eject players on land
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index 907f751c859855484151fb5d607acee2f2a35076..4e1b2d65182f7d562a8470449b9f7c2ef6ab6445 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -543,6 +543,7 @@ public class Boat extends VehicleEntity implements Leashable, VariantHolder<Boat
if (f > 0.0F) {
this.landFriction = f;
+ if (level().purpurConfig.boatEjectPlayersOnLand) ejectPassengers(); // Purpur
return Boat.Status.ON_LAND;
} else {
return Boat.Status.IN_AIR;
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 4e4f037c6b1c75467a4f2c58001c8a1cb7a9d79f..240c34bd95be07f19fb92d9b6678e6feffe2430e 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -95,12 +95,14 @@ 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;
public double voidDamageHeight = -64.0D;
public double voidDamageDealt = 4.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);