Files
Purpur/patches/server/0194-Player-ridable-in-water-option.patch
Ben Kerllenevich 8768f54932 save stuff here
2023-06-09 00:01:03 -04:00

43 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 17 Jul 2021 15:55:14 -0500
Subject: [PATCH] Player ridable in water option
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index a8656e55383739cd694cdf94654ad90890b61095..3661f60cf1be5ecbd5a8a3f07553f2b42b52a4f0 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2104,6 +2104,11 @@ public abstract class Player extends LivingEntity {
return this.inventory.armor;
}
+ @Override
+ public boolean dismountsUnderwater() {
+ return !level().purpurConfig.playerRidableInWater;
+ }
+
public boolean setEntityOnShoulder(CompoundTag entityNbt) {
if (!this.isPassenger() && this.onGround() && !this.isInWater() && !this.isInPowderSnow) {
if (this.getShoulderEntityLeft().isEmpty()) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 62225e7978e9f2982ccba4245c47df53f625043b..b3b08dcacdff3b055345ff5a5056510904488f9a 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -400,6 +400,7 @@ public class PurpurWorldConfig {
public boolean playerBurpWhenFull = false;
public int playerPortalWaitTime = 80;
public int playerCreativePortalWaitTime = 1;
+ public boolean playerRidableInWater = false;
private void playerSettings() {
if (PurpurConfig.version < 19) {
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
@@ -426,6 +427,7 @@ public class PurpurWorldConfig {
playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull);
playerPortalWaitTime = getInt("gameplay-mechanics.player.portal-wait-time", playerPortalWaitTime);
playerCreativePortalWaitTime = getInt("gameplay-mechanics.player.creative-portal-wait-time", playerCreativePortalWaitTime);
+ playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
}
private static boolean projectileDespawnRateSettingsMigrated = false;