Skip to content

Commit

Permalink
temporarily remove pufferfish, closes #1625
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Dec 20, 2024
1 parent f06fd5b commit 4bf1b98
Show file tree
Hide file tree
Showing 341 changed files with 470 additions and 469 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ Subject: [PATCH] Rebrand


diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index a7c0936a1ee80618f9a504087c88814f738f4693..7196594e07af19a14c320d77df893978525fe386 100644
index 652ff54e7c50412503725d628bfe72ed03059790..fb1fe2651e53a9bf46b3632c638e13eea9dcda93 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -26,6 +26,13 @@ public interface ServerBuildInfo {
Key BRAND_PUFFERFISH_ID = Key.key("pufferfish", "pufferfish");
// Purpur end
@@ -19,6 +19,12 @@ 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}.
*
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Build System Changes


diff --git a/build.gradle.kts b/build.gradle.kts
index 5ceaca1bd75335f85b4876a394ea8c2643cda694..49546dfbb4dd006b5a2419908890ba4c2a0e207a 100644
index 571534b42cd9c33d6a7bb6fe3bf3a28e33f8e5de..ff4b6b735bf0117845cdb316af115079937792ed 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -170,6 +170,8 @@ tasks.jar {
@@ -162,6 +162,8 @@ tasks.jar {
}

tasks.withType<Javadoc> {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add log suppression for LibraryLoader


diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 45a9ca8969f635d20cc44c062fda85bbccd8f8ff..e2b631fc160f13ea6e27b69f835bbdf83d6d3dec 100644
index b412aaf08901d169ac9fc89b36f9d6ccb95c53d3..43a0de7394eb786e9c87611003cc820424979205 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -55,6 +55,7 @@ public final class JavaPluginLoader implements PluginLoader {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ Subject: [PATCH] Rebrand


diff --git a/build.gradle.kts b/build.gradle.kts
index 83e2c8784eaa77851e9efc6b889d673c1fd046d0..624588207afdc52adae14e5de3d18fe1c330d832 100644
index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..8e1d6848e5da82db4c38c27af6bef71c6d843036 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
// Paper end - configure mockito agent that is needed in newer java versions

dependencies {
- implementation(project(":pufferfish-api")) // Pufferfish // Paper
- implementation(project(":paper-api"))
+ implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur - Rebrand
implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency
// Paper start
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
@@ -68,6 +68,10 @@ dependencies {
}
// Pufferfish end
@@ -61,6 +61,10 @@ dependencies {
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")

+ implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur - Rebrand
+ implementation("org.mozilla:rhino-engine:1.7.14") // Purpur - Rebrand
Expand All @@ -28,27 +28,27 @@ index 83e2c8784eaa77851e9efc6b889d673c1fd046d0..624588207afdc52adae14e5de3d18fe1
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
@@ -115,14 +119,14 @@ tasks.jar {
@@ -100,14 +104,14 @@ tasks.jar {
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
- "Implementation-Title" to "Pufferfish", // Pufferfish
- "Implementation-Title" to "Paper",
+ "Implementation-Title" to "Purpur", // Pufferfish // Purpur - Rebrand
"Implementation-Version" to implementationVersion,
"Implementation-Vendor" to date, // Paper
- "Specification-Title" to "Pufferfish", // Pufferfish
- "Specification-Title" to "Paper",
+ "Specification-Title" to "Purpur", // Pufferfish // Purpur - Rebrand
"Specification-Version" to project.version,
- "Specification-Vendor" to "Pufferfish Studios LLC", // Pufferfish
- "Brand-Id" to "pufferfish:pufferfish", // Pufferfish
- "Brand-Name" to "Pufferfish", // Pufferfish
- "Specification-Vendor" to "Paper Team",
- "Brand-Id" to "papermc:paper",
- "Brand-Name" to "Paper",
+ "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur - Rebrand
+ "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur - Rebrand
+ "Brand-Name" to "Purpur", // Pufferfish // Purpur - Rebrand
"Build-Number" to (build ?: ""),
"Build-Time" to Instant.now().toString(),
"Git-Branch" to gitBranch, // Paper
@@ -188,7 +192,7 @@ fun TaskContainer.registerRunTask(
@@ -173,7 +177,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
Expand Down Expand Up @@ -151,35 +151,35 @@ index 6ee39b534b8d992655bc0cef3c299d12cbae0034..bc7e4e5560708fea89c584b1d8b471f4
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
index 19d602e4e6fa5abf59559eab4132677b09a967a1..0843e7c5c335a58d955a0841f2e02a9e4ac824d9 100644
index 790bad0494454ca12ee152e3de6da3da634d9b20..b36e30fd4057a938e4d90cb42a2dca661f16478e 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
@@ -32,6 +32,7 @@ public record ServerBuildInfoImpl(
@@ -31,6 +31,7 @@ public record ServerBuildInfoImpl(
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";

private static final String BRAND_PAPER_NAME = "Paper";
private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur - Fix pufferfish issues
+ private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur - Rebrand

private static final String BUILD_DEV = "DEV";

@@ -43,9 +44,9 @@ public record ServerBuildInfoImpl(
@@ -42,9 +43,9 @@ public record ServerBuildInfoImpl(
this(
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
.map(Key::key)
- .orElse(BRAND_PUFFERFISH_ID), // Purpur - Fix pufferfish issues
- .orElse(BRAND_PAPER_ID),
+ .orElse(BRAND_PURPUR_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
- .orElse(BRAND_PUFFERFISH_NAME), // Purpur - Fix pufferfish issues
- .orElse(BRAND_PAPER_NAME),
+ .orElse(BRAND_PURPUR_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand
SharedConstants.getCurrentVersion().getId(),
SharedConstants.getCurrentVersion().getName(),
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
@@ -62,7 +63,7 @@ public record ServerBuildInfoImpl(
@@ -61,7 +62,7 @@ public record ServerBuildInfoImpl(

@Override
public boolean isBrandCompatible(final @NotNull Key brandId) {
- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // Purpur - Fix pufferfish issues
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur - Fix pufferfish issues // Purpur - Rebrand
- return brandId.equals(this.brandId);
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // Purpur - Fix pufferfish issues // Purpur - Rebrand
}

@Override
Expand Down Expand Up @@ -267,27 +267,27 @@ index 1354ccfbf525e5e64483ac5f443cc2325ba63850..2e7c3d4befeb6256ce81ecaa9ed4e8fb
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 6ef651e6dc16bad45aeb76f8e17b97871c506a64..d60e190ce5bfb0f57d282b8471faf61de5977076 100644
index 15892c7769caa15f3d52a1ee2147cf9615aa0e25..d60e190ce5bfb0f57d282b8471faf61de5977076 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -505,7 +505,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
// Paper start
@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
- return new gg.pufferfish.pufferfish.PufferfishVersionFetcher(); // Pufferfish
- return new com.destroystokyo.paper.PaperVersionFetcher();
+ return new com.destroystokyo.paper.PaperVersionFetcher(); // Pufferfish // Purpur - Rebrand
}

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 80553face9c70c2a3d897681e7761df85b22d464..99eb04643fce44c37fd96c99756837ccafe7b559 100644
index 774556a62eb240da42e84db4502e2ed43495be17..99eb04643fce44c37fd96c99756837ccafe7b559 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";

- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.pufferfish.pufferfish/pufferfish-api/pom.properties"); // Pufferfish
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties");
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur - Rebrand
Properties properties = new Properties();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Subject: [PATCH] Purpur config files


diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 8433c3ac440faa969069d1929b8b77fcb1080be7..be1bb14dca9367b9685841985b6198376986c496 100644
index 8f62879582195d8ae4f64bd23f752fa133b1c973..be1bb14dca9367b9685841985b6198376986c496 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -592,7 +592,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Pufferfish", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish
- Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger());
+ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur - Purpur config files

metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
Expand All @@ -26,11 +26,11 @@ index 8433c3ac440faa969069d1929b8b77fcb1080be7..be1bb14dca9367b9685841985b619837
- final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
- if (implVersion != null) {
- final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
- paperVersion = "git-Pufferfish-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Pufferfish
- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
- } else {
- paperVersion = "unknown";
- }
- metrics.addCustomChart(new Metrics.SimplePie("pufferfish_version", () -> paperVersion)); // Pufferfish
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
+ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur - Purpur config files
+ metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur - Purpur config files

Expand Down Expand Up @@ -72,7 +72,7 @@ index 13bd145b1e8006a53c22f5dc0c78f29b540c7663..7b2daf47e411362a462019a1612a99c9
boolean flag1 = this.source.acceptsSuccess() && !this.silent;
boolean flag2 = broadcastToOps && this.source.shouldInformAdmins() && !this.silent;
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8ccf355a2541c8fb725c312c6955bb6cf624ff0f..135dd18f143e2cfe21ac35019aee61f6cdc80ef7 100644
index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..cf63c64b8c2ac148b83325209940713a91b91bad 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -235,6 +235,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand All @@ -89,10 +89,10 @@ index 8ccf355a2541c8fb725c312c6955bb6cf624ff0f..135dd18f143e2cfe21ac35019aee61f6
+ org.purpurmc.purpur.PurpurConfig.registerCommands();
+ // Purpur end - Purpur config files
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur - Fix pufferfish issues
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish

this.setPvpAllowed(dedicatedserverproperties.pvp);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 6470f145e2470574a40ddce6ca5bf924c1bb094c..62d4ccafc005ff00c17db9863db56b9ec77735c7 100644
index 27f9d167b5ae9ce5117798ea44324107df59425f..f3c5e076558cd8d7b9d9b3212872f8675670b2dd 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
Expand Down Expand Up @@ -159,13 +159,13 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..cc2f23613644126c3f7506b26db8e6a8
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index d74f885fcdf686359f761aa7356fe03cf293ee59..31b08d0c879ca7af6e186bf93095cd01e2565fcf 100644
index 1c2439ffc1e407ff69286817d22f127470ce07ba..d313f3a9b31d4ecc3b48f8fc2e44d3b445e8e2c5 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -183,6 +183,13 @@ public class Main {
.defaultsTo(new File("pufferfish.yml"))
.describedAs("Yml file");
// Purpur end - Fix pufferfish issues
@@ -176,6 +176,13 @@ public class Main {
.describedAs("Jar file");
// Paper end

+ // Purpur start - Purpur config files
+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings")
+ .withRequiredArg()
Expand Down
File renamed without changes.
Loading

0 comments on commit 4bf1b98

Please sign in to comment.