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 8d62bbb4fb818bea940bbac565cb8e30cb85818e..4d7e9a0d59ca2e3d9df1a7e47637bdbd6bf26809 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2062,6 +2062,11 @@ public abstract class Player extends LivingEntity {
         return this.inventory.armor;
     }
 
+    @Override
+    public boolean rideableUnderWater() {
+        return this.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/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 83a042dacf5c2746406dda579d4d4b8230717aa6..84b41052b3d3f1d99c1edc17e752ff0306eff9fa 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -348,6 +348,7 @@ public class PurpurWorldConfig {
     public boolean playerBurpWhenFull = false;
     public boolean playerArmorSwapping = false;
     public boolean playerArmorSwappingCreativeMakesCopy = true;
+    public boolean playerRidableInWater = false;
     private void playerSettings() {
         idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
         idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
@@ -368,6 +369,7 @@ public class PurpurWorldConfig {
         playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull);
         playerArmorSwapping = getBoolean("gameplay-mechanics.player.armor-click-equip.allow-hot-swapping", playerArmorSwapping);
         playerArmorSwappingCreativeMakesCopy = getBoolean("gameplay-mechanics.player.armor-click-equip.creative-makes-copy", playerArmorSwappingCreativeMakesCopy);
+        playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
     }
 
     public int snowballDamage = -1;
