mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-27 19:09:23 +00:00
Update Paper
This commit is contained in:
46
patches/server/0100-Leaves-Reload-Command.patch
Normal file
46
patches/server/0100-Leaves-Reload-Command.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Tue, 5 Sep 2023 00:07:10 +0800
|
||||
Subject: [PATCH] Leaves Reload Command
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java b/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java
|
||||
index f9a1f2d7f319c22178c2254347bcdc15f19badd9..139c807916ec1be7bf993b34f52343f12eea888a 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java
|
||||
@@ -36,6 +36,7 @@ public final class LeavesCommand extends Command {
|
||||
commands.put(Set.of("update"), new UpdateCommand());
|
||||
commands.put(Set.of("peaceful"), new PeacefulModeSwitchCommand());
|
||||
commands.put(Set.of("counter"), new CounterCommand());
|
||||
+ commands.put(Set.of("reload"), new ReloadCommand());
|
||||
|
||||
return commands.entrySet().stream()
|
||||
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/subcommands/ReloadCommand.java b/src/main/java/org/leavesmc/leaves/command/subcommands/ReloadCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..749718287eb5364001176927248a4094afaf8750
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/subcommands/ReloadCommand.java
|
||||
@@ -0,0 +1,22 @@
|
||||
+package org.leavesmc.leaves.command.subcommands;
|
||||
+
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.leavesmc.leaves.LeavesConfig;
|
||||
+import org.leavesmc.leaves.command.LeavesSubcommand;
|
||||
+
|
||||
+import java.io.File;
|
||||
+
|
||||
+import static net.kyori.adventure.text.Component.text;
|
||||
+import static net.kyori.adventure.text.format.NamedTextColor.GREEN;
|
||||
+
|
||||
+public class ReloadCommand implements LeavesSubcommand {
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String subCommand, String[] args) {
|
||||
+ MinecraftServer server = MinecraftServer.getServer();
|
||||
+ LeavesConfig.init((File) server.options.valueOf("leaves-settings"));
|
||||
+ Command.broadcastCommandMessage(sender, text("Leaves config reload complete.", GREEN));
|
||||
+ return false;
|
||||
+ }
|
||||
+}
|
||||
Reference in New Issue
Block a user