mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
register minecraft debug commands
This commit is contained in:
@@ -1,47 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: granny <contact@granny.dev>
|
|
||||||
Date: Sun, 18 Feb 2024 16:28:32 -0800
|
|
||||||
Subject: [PATCH] register minecraft debug commands
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
|
||||||
index 93c07a4c96e25ed1db5e1f721ab5d53192a0225f..fe9a01e19ef182fb8e9c653fc1232ec7f13037e4 100644
|
|
||||||
--- a/net/minecraft/commands/Commands.java
|
|
||||||
+++ b/net/minecraft/commands/Commands.java
|
|
||||||
@@ -226,8 +226,8 @@ public class Commands {
|
|
||||||
JfrCommand.register(this.dispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (SharedConstants.IS_RUNNING_IN_IDE) {
|
|
||||||
- TestCommand.register(this.dispatcher);
|
|
||||||
+ if (org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands || SharedConstants.IS_RUNNING_IN_IDE) { // Purpur
|
|
||||||
+ if (!org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands) TestCommand.register(this.dispatcher); // Purpur
|
|
||||||
RaidCommand.register(this.dispatcher, commandRegistryAccess);
|
|
||||||
DebugPathCommand.register(this.dispatcher);
|
|
||||||
DebugMobSpawningCommand.register(this.dispatcher);
|
|
||||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
|
||||||
index 978c0d7296f400fe2ebda89e4f61386e6e87fe0c..a880f4e5cf712654649ad043e58e073e9a87c0fe 100644
|
|
||||||
--- a/net/minecraft/server/Main.java
|
|
||||||
+++ b/net/minecraft/server/Main.java
|
|
||||||
@@ -125,6 +125,7 @@ public class Main {
|
|
||||||
// Purpur start - load config files early
|
|
||||||
org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("purpur-settings"));
|
|
||||||
org.purpurmc.purpur.PurpurConfig.clampEnchantLevels = purpurConfiguration.getBoolean("settings.enchantment.clamp-levels", true);
|
|
||||||
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands = purpurConfiguration.getBoolean("settings.register-minecraft-debug-commands");
|
|
||||||
// Purpur end - load config files early
|
|
||||||
|
|
||||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionset); // Paper
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
||||||
index ab672b9041ae40ba3e78bc5f9f465ee70e420993..2d76827f83638c7f6bfa0d45bf950e18df22063e 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
||||||
@@ -582,4 +582,9 @@ public class PurpurConfig {
|
|
||||||
private static void playerDeathsAlwaysShowItem() {
|
|
||||||
playerDeathsAlwaysShowItem = getBoolean("settings.player-deaths-always-show-item", playerDeathsAlwaysShowItem);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public static boolean registerMinecraftDebugCommands = false;
|
|
||||||
+ private static void registerMinecraftDebugCommands() {
|
|
||||||
+ registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,17 @@
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
public class Commands {
|
public class Commands {
|
||||||
|
@@ -216,8 +_,8 @@
|
||||||
|
JfrCommand.register(this.dispatcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (SharedConstants.IS_RUNNING_IN_IDE) {
|
||||||
|
- TestCommand.register(this.dispatcher);
|
||||||
|
+ if (org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands || SharedConstants.IS_RUNNING_IN_IDE) { // Purpur - register minecraft debug commands
|
||||||
|
+ if (!org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands) TestCommand.register(this.dispatcher); // Purpur - register minecraft debug commands
|
||||||
|
RaidCommand.register(this.dispatcher, context);
|
||||||
|
DebugPathCommand.register(this.dispatcher);
|
||||||
|
DebugMobSpawningCommand.register(this.dispatcher);
|
||||||
@@ -245,6 +_,14 @@
|
@@ -245,6 +_,14 @@
|
||||||
StopCommand.register(this.dispatcher);
|
StopCommand.register(this.dispatcher);
|
||||||
TransferCommand.register(this.dispatcher);
|
TransferCommand.register(this.dispatcher);
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
--- a/net/minecraft/server/Main.java
|
--- a/net/minecraft/server/Main.java
|
||||||
+++ b/net/minecraft/server/Main.java
|
+++ b/net/minecraft/server/Main.java
|
||||||
@@ -108,6 +_,11 @@
|
@@ -108,6 +_,12 @@
|
||||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Purpur start - Add toggle for enchant level clamping - load config files early
|
+ // Purpur start - Add toggle for enchant level clamping - load config files early
|
||||||
+ org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("purpur-settings"));
|
+ org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("purpur-settings"));
|
||||||
+ org.purpurmc.purpur.PurpurConfig.clampEnchantLevels = purpurConfiguration.getBoolean("settings.enchantment.clamp-levels", true);
|
+ org.purpurmc.purpur.PurpurConfig.clampEnchantLevels = purpurConfiguration.getBoolean("settings.enchantment.clamp-levels", true);
|
||||||
|
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands = purpurConfiguration.getBoolean("settings.register-minecraft-debug-commands"); // Purpur - register minecraft debug commands
|
||||||
+ // Purpur end - Add toggle for enchant level clamping - load config files early
|
+ // Purpur end - Add toggle for enchant level clamping - load config files early
|
||||||
+
|
+
|
||||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
||||||
|
|||||||
@@ -578,4 +578,9 @@ public class PurpurConfig {
|
|||||||
private static void playerDeathsAlwaysShowItem() {
|
private static void playerDeathsAlwaysShowItem() {
|
||||||
playerDeathsAlwaysShowItem = getBoolean("settings.player-deaths-always-show-item", playerDeathsAlwaysShowItem);
|
playerDeathsAlwaysShowItem = getBoolean("settings.player-deaths-always-show-item", playerDeathsAlwaysShowItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean registerMinecraftDebugCommands = false;
|
||||||
|
private static void registerMinecraftDebugCommands() {
|
||||||
|
registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user