mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@9f1fa0b Fix item gravity on inactive items, remove dumb active skipping PaperMC/Paper@1a1d0cf Use target pitch in teleport (generally the same thing) PaperMC/Paper@8ba3073 fix "is_freezing" damage type tag PaperMC/Paper@1523212 don't resend effects when PlayerItemConsumeEvent is cancelled PaperMC/Paper@1330880 Add Friction API to minecarts PaperMC/Paper@580a610 Allow using old ender pearl behavior & apply ender pearl exploit patch (#11524) PaperMC/Paper@40a960d Rebuild patches PaperMC/Paper@dfedf79 Correctly cancel consumption of consumable PaperMC/Paper@147b796 get previous redstone level from the right state for experimental wires PaperMC/Paper@ad9c58e Only expose velocity relative tp flags to API (#11532) PaperMC/Paper@f273e6e Set updatingMinecraft to false PaperMC/Paper@c5c1250 [ci skip] Remove leftover todo file (#11540) PaperMC/Paper@7ee4835 Correctly clear explosion density cache(#11541) PaperMC/Paper@52a0590 Updated Upstream (Bukkit/CraftBukkit) (#11543) PaperMC/Paper@5c0930d Fix fix recipe iterator patch PaperMC/Paper@1de0130 re-add a dispense fix patch PaperMC/Paper@16d7d73 bunch more general fixes PaperMC/Paper@a5d7426 Correctly support RecipeChoice.empty (#11550) PaperMC/Paper@85c870e Correct update cursor (#11554) PaperMC/Paper@d19be64 Fix NPE with spark when CraftServer is not init yet (#11558) PaperMC/Paper@92131ad Decrease dead entity teleport warning (#11559)
50 lines
2.4 KiB
Diff
50 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: granny <granny@purpurmc.org>
|
|
Date: Sun, 5 May 2024 02:27:52 -0700
|
|
Subject: [PATCH] config for startup commands
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index d1c13456353b5c83bd764bfa1ec2076b88e356ba..0a5cbfee55020e16af86044dbcd173cd3cd96f34 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1290,6 +1290,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
}
|
|
// Purpur end
|
|
+
|
|
+ // Purpur start
|
|
+ if (!Boolean.getBoolean("Purpur.IReallyDontWantStartupCommands") && !org.purpurmc.purpur.PurpurConfig.startupCommands.isEmpty()) {
|
|
+ LOGGER.info("Purpur: Running startup commands specified in purpur.yml.");
|
|
+ for (final String startupCommand : org.purpurmc.purpur.PurpurConfig.startupCommands) {
|
|
+ LOGGER.info("Purpur: Running the following command: \"{}\"", startupCommand);
|
|
+ ((DedicatedServer) this).handleConsoleInput(startupCommand, this.createCommandSourceStack());
|
|
+ }
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
while (this.running) {
|
|
long i;
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
index 8ceec24eeb4b441bcc37e75d4b6a778cc6184f31..ed54fc4104ac5e38490bc5390f8351eb5a9c039d 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
@@ -587,4 +587,16 @@ public class PurpurConfig {
|
|
private static void registerMinecraftDebugCommands() {
|
|
registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
|
|
}
|
|
+
|
|
+ public static List<String> startupCommands = new ArrayList<>();
|
|
+ private static void startupCommands() {
|
|
+ startupCommands.clear();
|
|
+ getList("settings.startup-commands", new ArrayList<String>()).forEach(line -> {
|
|
+ String command = line.toString();
|
|
+ if (command.startsWith("/")) {
|
|
+ command = command.substring(1);
|
|
+ }
|
|
+ startupCommands.add(command);
|
|
+ });
|
|
+ }
|
|
}
|