-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
114 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: 404Setup <153366651+404Setup@users.noreply.github.com> | ||
Date: Tue, 3 Sep 2024 22:59:12 +0800 | ||
Subject: [PATCH] Command Utils | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java | ||
index f171106aadf061b7a420ceb4a79b6f9b285a29a0..90728949052211a33e979fc7839f17f03bc0c523 100644 | ||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java | ||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java | ||
@@ -224,6 +224,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface | ||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); | ||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); | ||
// Paper end - initialize global and world-defaults configuration | ||
+ one.tranic.vine.commands.Command.INSTANCE.register(); // Vine - register commands | ||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save | ||
if (this.convertOldUsers()) { | ||
this.getProfileCache().save(false); // Paper | ||
diff --git a/src/main/kotlin/one/tranic/vine/commands/Command.kt b/src/main/kotlin/one/tranic/vine/commands/Command.kt | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..f268cd373e670493b6b85a7d6fd31d4e3120b494 | ||
--- /dev/null | ||
+++ b/src/main/kotlin/one/tranic/vine/commands/Command.kt | ||
@@ -0,0 +1,10 @@ | ||
+package one.tranic.vine.commands | ||
+ | ||
+import one.tranic.vine.util.Reflect | ||
+import org.bukkit.Bukkit | ||
+ | ||
+object Command { | ||
+ fun register() { | ||
+ Reflect.findClass<org.bukkit.command.Command>("one.tranic.vine.commands.module").forEach { Bukkit.getCommandMap().register(it.name, "vine", it) } | ||
+ } | ||
+} | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: 404Setup <153366651+404Setup@users.noreply.github.com> | ||
Date: Wed, 4 Sep 2024 08:30:54 +0800 | ||
Subject: [PATCH] Config command | ||
|
||
|
||
diff --git a/src/main/kotlin/one/tranic/vine/commands/module/ConfigCommand.kt b/src/main/kotlin/one/tranic/vine/commands/module/ConfigCommand.kt | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..167d67efe14e31e3385339c4cab29ad5c403b17f | ||
--- /dev/null | ||
+++ b/src/main/kotlin/one/tranic/vine/commands/module/ConfigCommand.kt | ||
@@ -0,0 +1,36 @@ | ||
+package one.tranic.vine.commands.module | ||
+ | ||
+import net.kyori.adventure.text.Component | ||
+import net.kyori.adventure.text.format.TextColor | ||
+import one.tranic.vine.config.ConfigUtil | ||
+import org.bukkit.command.Command | ||
+import org.bukkit.command.CommandSender | ||
+ | ||
+class ConfigCommand : Command("vinecfg") { | ||
+ init { | ||
+ this.permission = "vine.commands.cfg" | ||
+ this.description = "Manage config file" | ||
+ } | ||
+ | ||
+ override fun execute(sender: CommandSender, commandLabel: String, args: Array<String>): Boolean { | ||
+ if (!this.testPermission(sender)) { | ||
+ sender.sendMessage( | ||
+ Component | ||
+ .text("No permission to execute this command!") | ||
+ .color(TextColor.color(255, 0, 0)) | ||
+ ) | ||
+ return true | ||
+ } | ||
+ ConfigUtil.reload() | ||
+ sender.sendMessage( | ||
+ Component | ||
+ .text("Reloaded Vine config file!") | ||
+ .color(TextColor.color(0, 255, 0)) | ||
+ ) | ||
+ return true | ||
+ } | ||
+ | ||
+ override fun tabComplete(sender: CommandSender, alias: String, args: Array<String>): List<String> { | ||
+ return emptyList() | ||
+ } | ||
+} | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.