Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jul 22, 2024
1 parent 658cb0e commit d2a4562
Show file tree
Hide file tree
Showing 19 changed files with 162 additions and 128 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ version=1.21-R0.1-SNAPSHOT

mcVersion=1.21
org.gradle.jvmargs=-Xmx2G
paperRef=d08e8d1afabcce6a40bab5863f2c297cd7ba8cfa
paperRef=aa36ae65764f652a16517a994e8d9cf4a89136c8
preVersion=true
updatingMinecraft=true
104 changes: 69 additions & 35 deletions patches/api/0007-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ Subject: [PATCH] Delete Timings

diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
deleted file mode 100644
index 36b8fe86335df851f9c85d6bb2a91368b4d945d1..0000000000000000000000000000000000000000
index 3e747abde6fefae90f1c15cb00158bc5303cbe50..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
@@ -1,89 +0,0 @@
-package co.aikar.timings;
-
-import static co.aikar.timings.TimingsManager.*;
-
-import org.bukkit.Bukkit;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-public class FullServerTickHandler extends TimingHandler {
- private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null);
Expand Down Expand Up @@ -98,10 +101,10 @@ index 36b8fe86335df851f9c85d6bb2a91368b4d945d1..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java
deleted file mode 100644
index 81671cf40feeed2844ee8d92348d48062aaf2c46..0000000000000000000000000000000000000000
index 42e7e712403676171d34d5f2be27e48e7a071ebd..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/NullTimingHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
@@ -1,72 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
Expand Down Expand Up @@ -130,6 +133,9 @@ index 81671cf40feeed2844ee8d92348d48062aaf2c46..00000000000000000000000000000000
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-public final class NullTimingHandler implements Timing {
- public static final Timing NULL = new NullTimingHandler();
Expand Down Expand Up @@ -173,10 +179,10 @@ index 81671cf40feeed2844ee8d92348d48062aaf2c46..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
deleted file mode 100644
index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..0000000000000000000000000000000000000000
index 157617933a772451f6c073d97afaf305769b4d40..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
+++ /dev/null
@@ -1,90 +0,0 @@
@@ -1,93 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
Expand Down Expand Up @@ -213,6 +219,9 @@ index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..00000000000000000000000000000000
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-public class TimedEventExecutor implements EventExecutor {
-
Expand Down Expand Up @@ -269,7 +278,7 @@ index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java
deleted file mode 100644
index 7514fad26f955329f8bf17ff17db75f0c8301ee5..0000000000000000000000000000000000000000
index 4195efcfe044618052bb03dea34a4fb2ca7c44f0..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/Timing.java
+++ /dev/null
@@ -1,86 +0,0 @@
Expand Down Expand Up @@ -304,7 +313,7 @@ index 7514fad26f955329f8bf17ff17db75f0c8301ee5..00000000000000000000000000000000
-/**
- * Provides an ability to time sections of code within the Minecraft Server
- *
- * @deprecated Timings will likely be replaced with Spark in the future
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-public interface Timing extends AutoCloseable {
Expand Down Expand Up @@ -720,10 +729,11 @@ index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
index 2d87237ea99d42c6ce896d52a1b2e5c3ec4d4568..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
deleted file mode 100644
index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingHistory.java
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -1,352 +0,0 @@
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
Expand Down Expand Up @@ -776,6 +786,11 @@ index 2d87237ea99d42c6ce896d52a1b2e5c3ec4d4568..e69de29bb2d1d6434b8b29ae775ad8c2
-import static co.aikar.timings.TimingsManager.MINUTE_REPORTS;
-import static co.aikar.util.JSONUtil.*;
-
-/**
- * Internal.
- *
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-@SuppressWarnings({"deprecation", "SuppressionAnnotation", "Convert2Lambda", "Anonymous2MethodRef"})
-public class TimingHistory {
Expand Down Expand Up @@ -1264,10 +1279,10 @@ index df142a89b8c43acb81eb383eac0ef048a1f49a6e..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
deleted file mode 100644
index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..0000000000000000000000000000000000000000
index e81d0bc309de877ed2b5da6122f55c162e9b5f10..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/Timings.java
+++ /dev/null
@@ -1,337 +0,0 @@
@@ -1,331 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
Expand Down Expand Up @@ -1311,7 +1326,7 @@ index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..00000000000000000000000000000000
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @deprecated Timings will likely be replaced with Spark in the future
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"})
Expand Down Expand Up @@ -1429,23 +1444,17 @@ index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..00000000000000000000000000000000
-
- public static Component deprecationMessage() {
- return Component.text()
- .color(TextColor.color(0xf3ef91))
- .color(TextColor.color(0xffc93a))
- .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future."))
- .append(Component.newline())
- .append(
- Component.text(" We recommend installing the spark profiler as a replacement: ")
- .append(
- Component.text()
- .content("https://spark.lucko.me/")
- .clickEvent(ClickEvent.openUrl("https://spark.lucko.me/")))
- )
- .append(Component.text(" We recommend migrating to the spark profiler."))
- .append(Component.newline())
- .append(
- Component.text(" For more information please visit: ")
- .append(
- Component.text()
- .content("https://github.com/PaperMC/Paper/issues/8948")
- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/issues/8948")))
- .content("https://github.com/PaperMC/Paper/discussions/10565")
- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/discussions/10565")))
- )
- .build();
- }
Expand Down Expand Up @@ -1607,10 +1616,10 @@ index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..00000000000000000000000000000000
-
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
deleted file mode 100644
index e801e79fa57c44b2e5d359647c920f88064826f1..0000000000000000000000000000000000000000
index 95d87c9dbf2b237787294dfbe7fed87a36e6dedf..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
+++ /dev/null
@@ -1,124 +0,0 @@
@@ -1,126 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
Expand Down Expand Up @@ -1649,7 +1658,9 @@ index e801e79fa57c44b2e5d359647c920f88064826f1..00000000000000000000000000000000
-
-import static net.kyori.adventure.text.Component.text;
-
-
-/**
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-public class TimingsCommand extends BukkitCommand {
- private static final List<String> TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff");
Expand Down Expand Up @@ -1737,7 +1748,7 @@ index e801e79fa57c44b2e5d359647c920f88064826f1..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
deleted file mode 100644
index 5e1558ca3ffeeaf2645fa003965474a442d650bf..0000000000000000000000000000000000000000
index e72ad05abada04426e32a73d02b21cb69079d268..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingsManager.java
+++ /dev/null
@@ -1,192 +0,0 @@
Expand Down Expand Up @@ -1783,7 +1794,7 @@ index 5e1558ca3ffeeaf2645fa003965474a442d650bf..00000000000000000000000000000000
-import org.jetbrains.annotations.Nullable;
-
-/**
- * @deprecated Timings will likely be replaced with Spark in the future
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-public final class TimingsManager {
Expand Down Expand Up @@ -1935,10 +1946,10 @@ index 5e1558ca3ffeeaf2645fa003965474a442d650bf..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
deleted file mode 100644
index 3af5b8ea795311582044c712de50d29412024b77..0000000000000000000000000000000000000000
index df066d6f8d55afbc0c1897c486d638657a5f8df9..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
+++ /dev/null
@@ -1,87 +0,0 @@
@@ -1,90 +0,0 @@
-package co.aikar.timings;
-
-import com.google.common.base.Preconditions;
Expand All @@ -1953,6 +1964,9 @@ index 3af5b8ea795311582044c712de50d29412024b77..00000000000000000000000000000000
-
-import java.util.List;
-
-/**
- * @deprecated Timings will be removed in the future
- */
-@Deprecated(forRemoval = true)
-@SuppressWarnings("WeakerAccess")
-public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
Expand Down Expand Up @@ -2086,19 +2100,28 @@ index 632c4961515f5052551f841cfa840e60bba7a257..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index c7cdc2ad8a2c43e8c0fcaa1761d3b81726c5ebcb..3ab75d571be4032e1bcfc5bb38168b81af63f0ad 100644
index 0a26fffe9b1e5080b5639767a03af11006108b4a..3b73c0e59788f5f49ca2423032550f11855d52ae 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,7 +33,6 @@ public abstract class Command {
@@ -33,16 +33,6 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private net.kyori.adventure.text.Component permissionMessage; // Paper
- /**
- * @deprecated Timings will be removed in the future
- */
- @Deprecated(forRemoval = true)
- public co.aikar.timings.Timing timings; // Paper
@NotNull public String getTimingName() {return getName();} // Paper
- /**
- * @deprecated Timings will be removed in the future
- */
- @Deprecated(forRemoval = true)
- @NotNull public String getTimingName() {return getName();} // Paper

protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
index abe256e1e45ce28036da4aa1586715bc8a1a3414..b359306500e640f4b0761ae9aa996cf64e4fe63f 100644
index abe256e1e45ce28036da4aa1586715bc8a1a3414..9eab8024e0675865f17669847759a26d28f74f3a 100644
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
+++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
@@ -12,7 +12,6 @@ public class FormattedCommandAlias extends Command {
Expand All @@ -2109,6 +2132,17 @@ index abe256e1e45ce28036da4aa1586715bc8a1a3414..b359306500e640f4b0761ae9aa996cf6
this.formatStrings = formatStrings;
}

@@ -120,10 +119,6 @@ public class FormattedCommandAlias extends Command {
return formatString.trim(); // Paper - Causes an extra space at the end, breaks with brig commands
}

- @NotNull
- @Override // Paper
- public String getTimingName() {return "Command Forwarder - " + super.getTimingName();} // Paper
-
private static boolean inRange(int i, int j, int k) {
return i >= j && i <= k;
}
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index 5df19bd701c67506689fc7f49d91f99ebfbc83f0..940565704d0e8914a76cf25daf7d1f5ecd99bad4 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
Expand Down
24 changes: 12 additions & 12 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes


diff --git a/build.gradle.kts b/build.gradle.kts
index 1a734293c9416f13324bb0edf8f950c9029f8bc4..d0caefc335e85afede34ad3b804bd6996fa0181c 100644
index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..cf8a410dedf26e48617ccad7e899edc26cf5f7c9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
Expand All @@ -17,7 +17,7 @@ index 1a734293c9416f13324bb0edf8f950c9029f8bc4..d0caefc335e85afede34ad3b804bd699
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -67,6 +67,15 @@ paperweight {
@@ -71,6 +71,15 @@ paperweight {
craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment
}

Expand All @@ -33,7 +33,7 @@ index 1a734293c9416f13324bb0edf8f950c9029f8bc4..d0caefc335e85afede34ad3b804bd699
tasks.jar {
archiveClassifier.set("dev")

@@ -80,14 +89,14 @@ tasks.jar {
@@ -84,14 +93,14 @@ tasks.jar {
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
Expand All @@ -53,7 +53,7 @@ index 1a734293c9416f13324bb0edf8f950c9029f8bc4..d0caefc335e85afede34ad3b804bd699
"Build-Number" to (build ?: ""),
"Build-Time" to Instant.now().toString(),
"Git-Branch" to gitBranch, // Paper
@@ -144,7 +153,7 @@ fun TaskContainer.registerRunTask(
@@ -148,7 +157,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
Expand All @@ -62,7 +62,7 @@ index 1a734293c9416f13324bb0edf8f950c9029f8bc4..d0caefc335e85afede34ad3b804bd699
mainClass.set("org.bukkit.craftbukkit.Main")
standardInput = System.`in`
workingDir = rootProject.layout.projectDirectory
@@ -213,13 +222,13 @@ tasks.registerRunTask("runReobfBundler") {
@@ -217,13 +226,13 @@ tasks.registerRunTask("runReobfBundler") {
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createReobfBundlerJar").flatMap { it.outputZip })
mainClass.set(null as String?)
}
Expand Down Expand Up @@ -184,10 +184,10 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..c060857cb0551fff8f5033553b887f3a
private static final String BUILD_DEV = "DEV";

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 57e84cf2219d28c37e4c042371afddf585334954..56b030a8dc0a335a88179e49d9165e0e9310420f 100644
index 9325d6f95165a7cee00d7de736af723681cc16b4..b5a216dbf3f73c32ac4e930a694527dc13df0b5d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1241,7 +1241,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1243,7 +1243,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.info("*************************************************************************************");
LOGGER.info("This is the first time you're starting this server.");
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
Expand All @@ -196,7 +196,7 @@ index 57e84cf2219d28c37e4c042371afddf585334954..56b030a8dc0a335a88179e49d9165e0e
LOGGER.info("*************************************************************************************");
}
// Paper end - Add onboarding message for initial server start
@@ -1937,7 +1937,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1941,7 +1941,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
Expand All @@ -206,13 +206,13 @@ index 57e84cf2219d28c37e4c042371afddf585334954..56b030a8dc0a335a88179e49d9165e0e

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 7d82cc6b847124cf4225428ba310309544928148..4214ed228125c6ba36ef2c763f842a54f33446fc 100644
index dd56c8e041116ef3602a9f89c998c8208ab89b51..0b4a70ebd312038d5b128c9e1f990666d1642a1a 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -235,9 +235,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
@@ -237,9 +237,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
- com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now

Expand All @@ -235,7 +235,7 @@ index 759062d219ff490a3cb19e710c4d18e3e08288e0..3952428c02fe87477f4139f4fa983815

javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 38083fc6dc60673562f2d05aa354c365571baff8..c2e2e0ea5f2bb8204cb698db7904b0f863d2506f 100644
index 618f4b2e1d012b647b3e7bf359c8ecdd7f159e63..c2c421b1caf76b40542fdc436801accbe97a38cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -273,7 +273,7 @@ public class Main {
Expand Down
Loading

0 comments on commit d2a4562

Please sign in to comment.