Skip to content

Commit

Permalink
Updated Upstream (Paper, Purpur)
Browse files Browse the repository at this point in the history
[Purpur Changes]
PlazmaMC/Purpur@ceeec1c: work
PlazmaMC/Purpur@e8f8f93: Updated Upstream (Paper, Pufferfish)

[Paper Changes]
PaperMC/Paper@f175193: Expose server build information (#10729)
PaperMC/Paper@d8d59e0: Fix NPE sending resource pack without prompt
PaperMC/Paper@5a9afbe: Fixes issues in the suppress dismount cancellation patch (#10735)
PaperMC/Paper@0ad09de: Make PaperSimplePluginClassLoader show class which is not found
PaperMC/Paper@b3b3406: fix CompassMeta not being correct (#10737)
PaperMC/Paper@591521e: Check for more correct profile validation (#10730)
PaperMC/Paper@7d2e5c3: Add an 'empty' RecipeChoice for certain ingredient slots (#10710)
PaperMC/Paper@9bf4855: Add a better warning message than "Server performance will be affected" for CommandRegisteredEvent use (#10754)
PaperMC/Paper@66cb880: Remove ThreadedWorldUpgrader patch
PaperMC/Paper@980cff9: Fix compile
PaperMC/Paper@d3ffa62: fix default item attributes
PaperMC/Paper@b149584: Always show command exception stack traces in logs (#10766)
PaperMC/Paper@a9201d4: [ci skip] Move logic in our patches to ItemType/BlockType (#10772)
PaperMC/Paper@3de408e: Fix equipment slot and group API (#10767)
PaperMC/Paper@d408381: Print CommandRegisteredEvent deprecation warnings again (#10756)
PaperMC/Paper@6de7a1f: Improve default item attributes API (#10765)
PaperMC/Paper@2a90732: Remove incorrect logic for Fireball#setVelocity (#10764)
PaperMC/Paper@5e7b65a: Allow using PluginLoader classpath API from Bukkit plugins (#10758)
PaperMC/Paper@3004717: Do not re-wrap vanilla goals (#10751)
PaperMC/Paper@377733d: Use getter/setter on Mob for equipment drop chances (#10780)
PaperMC/Paper@dff591d: Allow to define new map cursor types (#10782)
PaperMC/Paper@4fd3ac0: [ci skip] Update Player#getListeningPluginChannels Jdoc (#10778)
PaperMC/Paper@535dca5: Fix a few issues with ItemMeta (#10740)
PaperMC/Paper@26e90b9: Fix CraftMetaBlockState for data components (#10731)
PaperMC/Paper@f0bd0cc: Expose anvil cost in the API (#10682)
PaperMC/Paper@41bee55: Fix NPE for color-related metas
PaperMC/Paper@4e10fad: reset meta block state on BlockStateMeta#setBlockState
  • Loading branch information
AlphaKR93 committed May 26, 2024
1 parent c3681a2 commit 15a9cac
Show file tree
Hide file tree
Showing 27 changed files with 1,779 additions and 1,880 deletions.
38 changes: 15 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ plugins {
}

val jdkVersion = property("jdkVersion").toString().toInt()
val projectName = property("projectName").toString()
val projectRepo = property("projectRepo").toString()
val providerRepo = property("providerRepo").toString()
val brandName = property("brandName").toString()

kotlin.jvmToolchain(jdkVersion)

Expand All @@ -35,21 +35,13 @@ allprojects {

java.toolchain.languageVersion.set(JavaLanguageVersion.of(jdkVersion))

publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/$projectRepo")
publishing.repositories.maven("https://maven.pkg.github.com/$providerRepo") {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/$providerRepo")

credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}

publications.register<MavenPublication>("gpr") {
from(components["java"])
}
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down Expand Up @@ -90,18 +82,18 @@ subprojects {
}

paperweight {
serverProject = project(":${projectName.lowercase()}-server")
serverProject = project(":${brandName.lowercase()}-server")

remapRepo = "https://repo.papermc.io/repository/maven-public/"
decompileRepo = "https://repo.papermc.io/repository/maven-public/"

usePaperUpstream(providers.gradleProperty("paperCommit")) {
withPaperPatcher {
apiPatchDir.set(projectDir.resolve("patches/api"))
apiOutputDir.set(projectDir.resolve("$projectName-API"))
apiOutputDir.set(projectDir.resolve("$brandName-API"))

serverPatchDir.set(projectDir.resolve("patches/server"))
serverOutputDir.set(projectDir.resolve("$projectName-Server"))
serverOutputDir.set(projectDir.resolve("$brandName-Server"))
}

patchTasks.register("generatedApi") {
Expand Down Expand Up @@ -139,10 +131,10 @@ tasks {
}

generateDevelopmentBundle {
apiCoordinates.set("${project.group}:${projectName.lowercase()}-api")
apiCoordinates.set("${project.group}:${brandName.lowercase()}-api")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://maven.pkg.github.com/$projectRepo",
"https://maven.pkg.github.com/$providerRepo",
"https://papermc.io/repo/repository/maven-public/"
)
}
Expand All @@ -151,8 +143,8 @@ tasks {
doLast {
listOf(
".gradle/caches",
"$projectName-API",
"$projectName-Server",
"$brandName-API",
"$brandName-Server",
"paper-api-generator",
"run",

Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ paper.runMemoryGb = 8
paper.runDisableWatchdog = true

group = org.plazmamc.plazma
projectName = Plazma
projectRepo = PlazmaMC/PlazmaBukkit
brandName = Plazma
providerName = PlazmaMC
providerRepo = PlazmaMC/PlazmaBukkit

version = 1.20.6-R0.1-SNAPSHOT
mcVersion = 1.20.6
Expand All @@ -23,5 +24,5 @@ pufferfishRepo = https://github.com/PlazmaMC/Pufferfish
pufferfishBranch = ver/1.20
usePufferfish = true

paperCommit = 3fc93581bb876e8149b2ca423375a98f5ca12d27
purpurCommit = 150395f1dc7bc64b1e8099f9f41ee7f9bcc94519
paperCommit = 4e10fadfdc8f854feeabf916c23a71e21fb0b29f
purpurCommit = e8f8f9345b7f7110e8f85e542c0cbccbb0fb1475
2 changes: 1 addition & 1 deletion patches/api/0001-Pufferfish-API-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <[email protected]>
Date: Tue, 14 May 2024 19:21:24 +0900
Date: Sun, 26 May 2024 19:50:35 +0900
Subject: [PATCH] Pufferfish API Changes


Expand Down
50 changes: 34 additions & 16 deletions patches/api/0002-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: granny <[email protected]>
Date: Wed, 15 May 2024 03:16:50 +0000
Date: Sun, 26 May 2024 20:53:49 +0900
Subject: [PATCH] Purpur API Changes

PurpurMC
Expand Down Expand Up @@ -198,11 +198,29 @@ index ab5fea0b03224bf249352ce340e94704ff713345..3441cdad70da1bd523c5933b1a914688
return false;
} else {
SIMDDetection.testRun = true;
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index 9df9d09aa477d4cd3c496ba0933c816df1ef0964..7107eabf02d9d9b69d97c978ba421ad52031ec3f 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -18,6 +18,13 @@ public interface ServerBuildInfo {
*/
Key BRAND_PAPER_ID = Key.key("papermc", "paper");

+ // Purpur start
+ /**
+ * The brand id for Purpur.
+ */
+ Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
+ // Purpur end
+
/**
* Gets the {@code ServerBuildInfo}.
*
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 5d1b55fdbcbe63f6b42b694d05211a3cc691a09d..70ef8f63ab79e102cb4326c21cc344488f4fbdd3 100644
index 9a219b255b63f10005fc68faacb771dd32f61ac2..83b979fbb8c0dd64f0a19feef654af2b165bd603 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2910,4 +2910,127 @@ public final class Bukkit {
@@ -2913,4 +2913,127 @@ public final class Bukkit {
public static Server.Spigot spigot() {
return server.spigot();
}
Expand Down Expand Up @@ -421,10 +439,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 81f9ad99699a78b97e4accaaf1a98eacf29493ce..e3e996d932db689ba62a43f7f01d6f003f8337d3 100644
index 7509b61dfdc0a6675256970cb850b08f9e814580..c1986ca90c3adb81daca4f72b62cda65e5465bff 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -5701,4 +5701,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -5733,4 +5733,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
return Registry.BLOCK.get(material.key);
}
Expand Down Expand Up @@ -577,7 +595,7 @@ index 30298a629b39bd43ce14b414fc697b2dfcbea89c..ce00af9121de7a910aaea4e0685a06d4
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c8595ffcfcbdd79794d464415287d46acef72b72..ec8b9b2cbe65838a194281f7d76d0e17defc5211 100644
index 49d2547fcdaf779e284f513e58c1ac2ae3000bda..916db0d6096338c4f1b8707048eb38b50a2b027d 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2257,6 +2257,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
Expand All @@ -599,7 +617,7 @@ index c8595ffcfcbdd79794d464415287d46acef72b72..ec8b9b2cbe65838a194281f7d76d0e17
/**
* Sends the component to the player
*
@@ -2542,4 +2554,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2546,4 +2558,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API
Expand Down Expand Up @@ -864,7 +882,7 @@ index c3a9cf65db73ed534bf20996c7f05b5eb0aaebe1..fdedac32544be6534288c8ba28abe7f5
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
//target.timings.stopTiming(); // Spigot // Paper
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index fd5d9881abfd930bb883120f018f76dc78b62b14..d3dadad49df09e85c724c93e8cc88da2c985e9b4 100644
index fd5d9881abfd930bb883120f018f76dc78b62b14..3d29c47ac0620af82d990faf5dfc266c6f0235f1 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -214,7 +214,7 @@ public class VersionCommand extends BukkitCommand {
Expand All @@ -886,7 +904,7 @@ index fd5d9881abfd930bb883120f018f76dc78b62b14..d3dadad49df09e85c724c93e8cc88da2
+ // Purpur start
+ int distance = getVersionFetcher().distance();
+ final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
+ ChatColor.parseMM("<grey>Current: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
+ ChatColor.parseMM("<grey>Current Purpur Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
+ // Purpur end
msg
);
Expand Down Expand Up @@ -2041,7 +2059,7 @@ index c64413a6740b604282984dea2a8430a6e7478d68..5c609d916e2d2f08ba90ebd23f13c5c9
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
index c143b0d8b97d514566bac8413d0346cf50822aeb..032a21766ce91471cb7d91b663d70e0d9fa66a26 100644
index 1cd6601c9d2e86ef850011fcb9e59811207b4af7..5ec7d9dab1935bb743e3264d9f7390795fd9f55c 100644
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
Expand All @@ -2052,23 +2070,23 @@ index c143b0d8b97d514566bac8413d0346cf50822aeb..032a21766ce91471cb7d91b663d70e0d

/**
* Represents a potential item match within a recipe. All choices within a
@@ -157,6 +158,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -180,6 +181,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
public static class ExactChoice implements RecipeChoice {

private List<ItemStack> choices;
+ private Predicate<ItemStack> predicate; // Purpur

public ExactChoice(@NotNull ItemStack stack) {
this(Arrays.asList(stack));
@@ -206,6 +208,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -229,6 +231,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {

@Override
public boolean test(@NotNull ItemStack t) {
+ if (predicate != null) return predicate.test(t); // Purpur
for (ItemStack match : choices) {
if (t.isSimilar(match)) {
return true;
@@ -215,6 +218,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -238,6 +241,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
return false;
}

Expand Down Expand Up @@ -2138,7 +2156,7 @@ index 301e82369603f3dd6e6c1bd380da4bacacd7ef6c..0c6ca7588fb3d6b6497ddf032fe75e5c
/**
* This class was not meant to be constructed explicitly
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
index 8e1b6be2462aaa692efa1f72986921a6dc357196..b6e18b12fd4d61ce92203582906d24b4d14e6cc5 100644
index c66252802c51174bc26f266cb5cdecdd856ff220..97f580fccd06a8db5f592a53c8b95a7a6159adac 100644
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
@@ -68,6 +68,7 @@ public class LibraryLoader
Expand All @@ -2149,15 +2167,15 @@ index 8e1b6be2462aaa692efa1f72986921a6dc357196..b6e18b12fd4d61ce92203582906d24b4
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
}
} );
@@ -88,6 +89,7 @@ public class LibraryLoader
@@ -94,6 +95,7 @@ public class LibraryLoader
{
return null;
}
+ if (!JavaPluginLoader.SuppressLibraryLoaderLogger) // Purpur
logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
{
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix
@@ -135,6 +137,7 @@ public class LibraryLoader
@@ -144,6 +146,7 @@ public class LibraryLoader
}

jarFiles.add( url );
Expand Down
87 changes: 87 additions & 0 deletions patches/api/0004-Rebrand.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,90 @@ index 0000000000000000000000000000000000000000..67d405764ed68083d0164b1af0eabc0a
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..3b3bcfa6fa2dbcc7fef899cc7570da097437ab3a 100644
--- a/src/main/java/co/aikar/timings/TimingHandler.java
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
@@ -127,7 +127,7 @@ class TimingHandler implements Timing {
while ((last = TIMING_STACK.removeLast()) != this) {
last.timingDepth = 0;
if ("Minecraft".equalsIgnoreCase(last.identifier.group)) {
- Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to Paper unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)");
+ Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)");
} else {
Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Report this to the plugin " + last.identifier.group + " (Look for errors above this in the logs) (" + last.identifier + " did not stopTiming)", new Throwable());
}
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index 7107eabf02d9d9b69d97c978ba421ad52031ec3f..098125a57409b480f045c3a8c3b58db74a6605f3 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -25,6 +25,29 @@ public interface ServerBuildInfo {
Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
// Purpur end

+ // Plazma start - Rebranding
+ /**
+ * The brand id for Plazma.
+ */
+ Key BRAND_PLAZMA_ID = Key.key("plazmamc", "plazma");
+
+ // For those who fork Plazma - please add the new branding key here
+
+ /**
+ * The brand id of the server.
+ */
+ Key BRAND_ID = BRAND_PLAZMA_ID;
+
+ /**
+ * Supported brands of the server.
+ */
+ java.util.List<Key> SUPPORTED_BRANDS = java.util.Arrays.asList(
+ BRAND_PAPER_ID,
+ BRAND_PURPUR_ID,
+ BRAND_PLAZMA_ID
+ );
+ // Plazma end - Rebranding
+
/**
* Gets the {@code ServerBuildInfo}.
*
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index 3d29c47ac0620af82d990faf5dfc266c6f0235f1..0dd22efb7f318867d0f099e336505d2830883745 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -258,7 +258,7 @@ public class VersionCommand extends BukkitCommand {
// Purpur start
int distance = getVersionFetcher().distance();
final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
- ChatColor.parseMM("<grey>Current Purpur Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
+ ChatColor.parseMM("<grey>Current " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
// Purpur end
msg
);
@@ -281,6 +281,7 @@ public class VersionCommand extends BukkitCommand {
}
}

+ /* // Plazma - Fork-friendly Rebranding
private static int getDistance(@NotNull String repo, @NotNull String hash) {
try {
BufferedReader reader = Resources.asCharSource(
@@ -301,4 +302,5 @@ public class VersionCommand extends BukkitCommand {
return -1;
}
}
+ */ // Plazma - Fork-friendly Rebranding
}
diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java
index 60e086be70529e0804280b24a2a3e7ae72d8d363..dcf1d53af919e94a6947bc3f81121bd4fad1a163 100644
--- a/src/main/java/org/bukkit/plugin/EventExecutor.java
+++ b/src/main/java/org/bukkit/plugin/EventExecutor.java
@@ -54,7 +54,7 @@ public interface EventExecutor {
if (m.getReturnType() != Void.TYPE) {
final org.bukkit.plugin.java.JavaPlugin plugin = org.bukkit.plugin.java.JavaPlugin.getProvidingPlugin(m.getDeclaringClass());
org.bukkit.Bukkit.getLogger().warning("@EventHandler method " + m.getDeclaringClass().getName() + (Modifier.isStatic(m.getModifiers()) ? '.' : '#') + m.getName()
- + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of Paper."
+ + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + "." // Plazma - Fork-friendly Rebranding
+ " This should be reported to the developers of " + plugin.getPluginMeta().getDisplayName() + " (" + String.join(",", plugin.getPluginMeta().getAuthors()) + ')');
}
if (Modifier.isStatic(m.getModifiers())) {
Loading

0 comments on commit 15a9cac

Please sign in to comment.