mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
45 lines
2.4 KiB
Diff
45 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 2fe3af832a228b1352b9b85dec06115009ef658f..cb6f161d32fe9642e9e9b1efc47d88612041ea15 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -2088,6 +2088,13 @@ public abstract class Player extends LivingEntity {
|
|
return slot != EquipmentSlot.BODY;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean dismountsUnderwater() {
|
|
+ return !level().purpurConfig.playerRidableInWater;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
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 36becc96a815ebd0dde7e8b9b8072948df4ee758..ba419b8681659ca1b3cc619915b3a07bdd4abe29 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -379,6 +379,7 @@ public class PurpurWorldConfig {
|
|
public double playerCriticalDamageMultiplier = 1.5D;
|
|
public int playerBurpDelay = 10;
|
|
public boolean playerBurpWhenFull = false;
|
|
+ public boolean playerRidableInWater = false;
|
|
private void playerSettings() {
|
|
if (PurpurConfig.version < 19) {
|
|
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
|
@@ -401,6 +402,7 @@ public class PurpurWorldConfig {
|
|
playerCriticalDamageMultiplier = getDouble("gameplay-mechanics.player.critical-damage-multiplier", playerCriticalDamageMultiplier);
|
|
playerBurpDelay = getInt("gameplay-mechanics.player.burp-delay", playerBurpDelay);
|
|
playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull);
|
|
+ playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
|
|
}
|
|
|
|
public boolean silkTouchEnabled = false;
|