Update to 1.18.2

This commit is contained in:
BillyGalbreath
2022-03-01 17:27:08 -06:00
parent 133b3e1719
commit 90adb4e4af
192 changed files with 1500 additions and 1550 deletions

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add uptime command
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 3156e7e43a5114aaaa1276b024f4ec45e797de88..e787ccc3c21f7e966c1e291579bf7550ee6de696 100644
index c137f5299e4a9e2f33aeef77818c62c3805bdc0d..9e7cc8bf867b6e4f86b55e1f1d3a1cb6233c90f1 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -208,6 +208,7 @@ public class Commands {
@@ -210,6 +210,7 @@ public class Commands {
org.purpurmc.purpur.command.CreditsCommand.register(this.dispatcher); // Purpur
org.purpurmc.purpur.command.DemoCommand.register(this.dispatcher); // Purpur
org.purpurmc.purpur.command.PingCommand.register(this.dispatcher); // Purpur
@@ -17,7 +17,7 @@ index 3156e7e43a5114aaaa1276b024f4ec45e797de88..e787ccc3c21f7e966c1e291579bf7550
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 121bc7f3be749a1773ad917023855bae529e6643..793f72254220ab79bec4ba3c36f79309bf99cb3d 100644
index 257226e9ac530482149058986bb81bd699b6a6ed..6f2354856052e348942cc2a42cb6f364bfccc9c6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -294,6 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -29,7 +29,7 @@ index 121bc7f3be749a1773ad917023855bae529e6643..793f72254220ab79bec4ba3c36f79309
public int autosavePeriod;
public Commands vanillaCommandDispatcher;
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 83b21ee1584e217b5a3af92abcaf2da445a4bec1..f577d5cd166a1624e1103b0e0c13a09cde678b04 100644
index 792255c3f9499180a746175bf07f2890577332b5..f5a91db8035509ce42315a75205e9f0ae13ed127 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -178,6 +178,7 @@ public class PurpurConfig {
@@ -82,7 +82,7 @@ index 83b21ee1584e217b5a3af92abcaf2da445a4bec1..f577d5cd166a1624e1103b0e0c13a09c
public static int barrelRows = 3;
diff --git a/src/main/java/org/purpurmc/purpur/command/UptimeCommand.java b/src/main/java/org/purpurmc/purpur/command/UptimeCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..177a03c07c331a505d2b0ccfeb5509058e5449a1
index 0000000000000000000000000000000000000000..2a6685b016cca5a8be554b3b8a928ced8d3cebba
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/command/UptimeCommand.java
@@ -0,0 +1,55 @@
@@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..177a03c07c331a505d2b0ccfeb550905
+import com.mojang.brigadier.CommandDispatcher;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.minimessage.MiniMessage;
+import net.kyori.adventure.text.minimessage.Template;
+import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
+import net.minecraft.commands.CommandSourceStack;
+import net.minecraft.commands.Commands;
+import net.minecraft.server.MinecraftServer;
@@ -121,7 +121,7 @@ index 0000000000000000000000000000000000000000..177a03c07c331a505d2b0ccfeb550905
+ data.hide = false; // never hide seconds
+ process(data, "<seconds>", PurpurConfig.uptimeSecond, PurpurConfig.uptimeSeconds, TimeUnit.SECONDS, TimeUnit.MILLISECONDS::toSeconds);
+
+ Component output = MiniMessage.get().parse(PurpurConfig.uptimeCommandOutput, Template.of("uptime", data.format));
+ Component output = MiniMessage.miniMessage().deserialize(PurpurConfig.uptimeCommandOutput, Placeholder.unparsed("uptime", data.format));
+ sender.sendSuccess(output, false);
+ return 1;
+ }