mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Purpur client stuffs
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Mon, 8 Mar 2021 16:46:54 -0500
|
||||
Subject: [PATCH] Config to ignore nearby mobs when sleeping
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 96f36bf1443bddcdca2f471e8beb56fd9ef37e16..acbc7f61fe3669679f559f2942675c0fde61a8ec 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1304,7 +1304,7 @@ public class ServerPlayer extends Player {
|
||||
return entitymonster.isPreventingPlayerRest((Player) this);
|
||||
});
|
||||
|
||||
- if (!list.isEmpty()) {
|
||||
+ if (!this.level.purpurConfig.playerSleepNearMonsters && !list.isEmpty()) { // Purpur
|
||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 2595fc1fc1fd89238d9217339fefc6a4fd1ac6a9..66f49b451cee6f8e42df5172e55a22d225fd0759 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -309,6 +309,7 @@ public class PurpurWorldConfig {
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
public boolean playerFixStuckPortal = false;
|
||||
public boolean creativeOnePunch = false;
|
||||
+ public boolean playerSleepNearMonsters = 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);
|
||||
@@ -322,6 +323,7 @@ public class PurpurWorldConfig {
|
||||
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
||||
playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
|
||||
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
|
||||
+ playerSleepNearMonsters = getBoolean("gameplay-mechanics.player.sleep-ignore-nearby-mobs", playerSleepNearMonsters);
|
||||
}
|
||||
|
||||
public int snowballDamage = -1;
|
||||
Reference in New Issue
Block a user