mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-27 10:59:16 +00:00
Prevent change non-editable sign warning spam in console
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||
Date: Thu, 28 Mar 2024 14:04:35 -0400
|
||||
Subject: [PATCH] Prevent change non-editable sign warning spam in console
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
index 93764bf849ad8e427bf119f6ff3dbcbcc4c2415e..6116ccf6c5edef3edd19d3c777f18568c4d5ff3e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -188,7 +188,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
this.setAllowedPlayerEditor((UUID) null);
|
||||
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
|
||||
} else {
|
||||
- SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString());
|
||||
+ if (!org.dreeam.leaf.config.modules.misc.RemoveChangeNonEditableSignWarning.enabled) SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); // Leaf - Remove change non-editable sign warning
|
||||
if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < 32 * 32) // Paper - Dont send far away sign update
|
||||
((ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveChangeNonEditableSignWarning.java b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveChangeNonEditableSignWarning.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3f7c987793202114b11a08f4e02182311c9640e3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/config/modules/misc/RemoveChangeNonEditableSignWarning.java
|
||||
@@ -0,0 +1,29 @@
|
||||
+package org.dreeam.leaf.config.modules.misc;
|
||||
+
|
||||
+import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
+import org.dreeam.leaf.config.ConfigInfo;
|
||||
+import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
+import org.dreeam.leaf.config.IConfigModule;
|
||||
+
|
||||
+public class RemoveChangeNonEditableSignWarning implements IConfigModule {
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.MISC;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "remove_change_non_editable_sign_warning";
|
||||
+ }
|
||||
+
|
||||
+ @ConfigInfo(baseName = "enabled")
|
||||
+ public static boolean enabled = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public void onLoaded(CommentedFileConfig config) {
|
||||
+ config.setComment("misc.remove_change_non_editable_sign_warning", """
|
||||
+ Enable to prevent console spam.
|
||||
+ """);
|
||||
+ }
|
||||
+}
|
||||
Reference in New Issue
Block a user