Skip to content

Commit

Permalink
[ci skip] merge pufferfish config relocatable patch into pufferfish i…
Browse files Browse the repository at this point in the history
…ssues patch
  • Loading branch information
granny committed Dec 20, 2024
1 parent 908f152 commit f06fd5b
Show file tree
Hide file tree
Showing 44 changed files with 93 additions and 103 deletions.
53 changes: 50 additions & 3 deletions patches/server/0002-Fix-pufferfish-issues.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,27 @@ index 96d831791edbe6ae07325008b760f70f75c4d713..83e2c8784eaa77851e9efc6b889d673c
}
// Pufferfish end
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index f5a43a1e1a78b3eaabbcadc7af09750ee478eeb6..68fec1c808a16ecbf2451daa3bb8f02c1bdfe7c4 100644
index f5a43a1e1a78b3eaabbcadc7af09750ee478eeb6..3ff4f092a59242a8cb930c084915a774db881652 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -229,7 +229,7 @@ public class PufferfishConfig {
@@ -25,6 +25,7 @@ public class PufferfishConfig {

private static final YamlFile config = new YamlFile();
private static int updates = 0;
+ public static File pufferfishFile; // Purpur - Fix pufferfish issues

private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) {
ConfigurationSection newSection = new MemoryConfiguration();
@@ -47,7 +48,7 @@ public class PufferfishConfig {
}

public static void load() throws IOException {
- File configFile = new File("pufferfish.yml");
+ File configFile = pufferfishFile; // Purpur - Fix pufferfish issues

if (configFile.exists()) {
try {
@@ -229,7 +230,7 @@ public class PufferfishConfig {
public static int activationDistanceMod;

private static void dynamicActivationOfBrains() throws IOException {
Expand All @@ -30,7 +47,7 @@ index f5a43a1e1a78b3eaabbcadc7af09750ee478eeb6..68fec1c808a16ecbf2451daa3bb8f02c
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -256,7 +256,7 @@ public class PufferfishConfig {
@@ -256,7 +257,7 @@ public class PufferfishConfig {

public static boolean throttleInactiveGoalSelectorTick;
private static void inactiveGoalSelectorThrottle() {
Expand Down Expand Up @@ -72,6 +89,18 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..19d602e4e6fa5abf59559eab4132677b
}

@Override
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index d62f7375394409a278bc565c8263506c598ceeba..8ccf355a2541c8fb725c312c6955bb6cf624ff0f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -236,6 +236,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
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
+ gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur - Fix pufferfish issues
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish

diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 593b343b7cd5a24e34ad19a9e93eb9258f862357..80ff364514d071d1862c4b3aa5d01b9c39062946 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
Expand All @@ -98,3 +127,21 @@ index 99a95d77f44dddfd7be6c2ebd60e827d9de956b7..00ea1c2037c7c7780764bfcc3e07b655
}

// CraftBukkit start
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 1c2439ffc1e407ff69286817d22f127470ce07ba..d74f885fcdf686359f761aa7356fe03cf293ee59 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -176,6 +176,13 @@ public class Main {
.describedAs("Jar file");
// Paper end

+ // Purpur start - Fix pufferfish issues
+ acceptsAll(asList("pufferfish", "pufferfish-settings"), "File for pufferfish settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("pufferfish.yml"))
+ .describedAs("Yml file");
+ // Purpur end - Fix pufferfish issues
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
15 changes: 7 additions & 8 deletions patches/server/0004-Purpur-config-files.patch
Original file line number Diff line number Diff line change
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 d62f7375394409a278bc565c8263506c598ceeba..fca644c904fe5f4b2637ed9d3062ae247751b9f1 100644
index 8ccf355a2541c8fb725c312c6955bb6cf624ff0f..135dd18f143e2cfe21ac35019aee61f6cdc80ef7 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,8 +89,8 @@ index d62f7375394409a278bc565c8263506c598ceeba..fca644c904fe5f4b2637ed9d3062ae24
+ 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
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish
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
--- a/src/main/java/net/minecraft/world/level/Level.java
Expand Down Expand Up @@ -159,21 +159,20 @@ 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 1c2439ffc1e407ff69286817d22f127470ce07ba..4257352ca30c2bf6de2c2cc700f9799263ae7c7e 100644
index d74f885fcdf686359f761aa7356fe03cf293ee59..31b08d0c879ca7af6e186bf93095cd01e2565fcf 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -176,6 +176,14 @@ public class Main {
.describedAs("Jar file");
// Paper end

@@ -183,6 +183,13 @@ public class Main {
.defaultsTo(new File("pufferfish.yml"))
.describedAs("Yml file");
// Purpur end - Fix pufferfish issues
+ // Purpur start - Purpur config files
+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("purpur.yml"))
+ .describedAs("Yml file");
+ // Purpur end - Purpur config files
+
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0024-Disable-outdated-build-check.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Disable outdated build check


diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index ae274a56f7cb6200b3c556ed61254bb28146c771..628f7f784c830189c5718a20ce43a9352e400c33 100644
index 31b08d0c879ca7af6e186bf93095cd01e2565fcf..10aa600fab7146b330d46b5fd2fe596da222a70a 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -267,7 +267,7 @@ public class Main {
@@ -273,7 +273,7 @@ public class Main {
System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
}

Expand Down
10 changes: 5 additions & 5 deletions patches/server/0114-Implement-TPSBar.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index 719fbce359f8c2c52ee4e9da3dfe9566f58c0346..f01fff591efc92267d96084660f9e968

if (environment.includeIntegrated) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 16ab1d7735789d69f265092151db696d8f23f071..5ed363f80c7071995d24c8de1dd7ce7c88cdf6b6 100644
index 0b89eeab47d143b260aa5f8bb10197a95f4045e2..95350ac6f92c52918f4b760bb4f63f1720151db1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1159,6 +1159,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -29,10 +29,10 @@ index 16ab1d7735789d69f265092151db696d8f23f071..5ed363f80c7071995d24c8de1dd7ce7c
this.hasLoggedStop = true; // Paper - Debugging
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 7ced95af8da7150caf115508f8cb694ad737a27f..fe4d240ae0a1c83efa968e41284aacefb3f6215e 100644
index ba318228ce89493b95d96375bd3e2ffb500db7a6..62edb3d26b4b05bebf6f281225e27fdc4ab081e4 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -377,6 +377,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -378,6 +378,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}

if (gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish
Expand All @@ -41,7 +41,7 @@ index 7ced95af8da7150caf115508f8cb694ad737a27f..fe4d240ae0a1c83efa968e41284aacef
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 06da0a206c3e0bf07875c6dd6e80646053c0ba0c..ce5c62cdd19f2202234d27fa2a9a380cc5b3c004 100644
index 51e58f447cc07224b2d9bbeff3719a719931a40c..303c9b2c6f1a62e40c5657248b727c14bb9c613a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -328,6 +328,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
Expand Down Expand Up @@ -83,7 +83,7 @@ index 06da0a206c3e0bf07875c6dd6e80646053c0ba0c..ce5c62cdd19f2202234d27fa2a9a380c
// Purpur end
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f4b70fdb8efbd4da0cad8cd5fcdb7381ce548201..1ed7348fb2e10160eacee6c24691e7c8e074f428 100644
index 8596e1c016c51a840b8c0c6a8d5c8e0893c4f1c7..0969a713df3150b0b2d2dd2d595e5f49e491f8af 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -419,6 +419,7 @@ public abstract class PlayerList {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0211-UPnP-Port-Forwarding.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] UPnP Port Forwarding


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 474f700049b6a84b890fa759e8655562786e9b64..7203f7d84987ebdc98b85a733e823e472c53bebc 100644
index f83e41b3550fba692378bf7a6f8a12bba4249f0e..260df0edd90d6b27f9525683a84887a1cf94542a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -331,6 +331,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down Expand Up @@ -33,10 +33,10 @@ index 474f700049b6a84b890fa759e8655562786e9b64..7203f7d84987ebdc98b85a733e823e47
if (this.server != null) {
this.server.spark.disable(); // Paper - spark
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index fe4d240ae0a1c83efa968e41284aacefb3f6215e..044cd4d2f9ad008a9078f5b20241c484bffb4b15 100644
index 62edb3d26b4b05bebf6f281225e27fdc4ab081e4..a73bf35ac75bb3c9f82f8300d65af839fb97a77f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -303,6 +303,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -304,6 +304,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (true) throw new IllegalStateException("Failed to bind to port", ioexception); // Paper - Propagate failed to bind to port error
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Give bee counts in beehives to Purpur clients


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7203f7d84987ebdc98b85a733e823e472c53bebc..6cc112b6b79d2a14afed86029453b96a9feab8e9 100644
index 260df0edd90d6b27f9525683a84887a1cf94542a..827e8b9b0fb0fa64f56de54a562f65e200c7b50f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1171,6 +1171,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -17,10 +17,10 @@ index 7203f7d84987ebdc98b85a733e823e472c53bebc..6cc112b6b79d2a14afed86029453b96a
this.hasLoggedStop = true; // Paper - Debugging
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 044cd4d2f9ad008a9078f5b20241c484bffb4b15..8bb2f70c448c9cffd9db8e44191ecfe4d4d40332 100644
index a73bf35ac75bb3c9f82f8300d65af839fb97a77f..07ec10fe4c96d0fd2a5f8a3df11c37cda7fff76a 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -402,6 +402,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -403,6 +403,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

if (gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish
org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ index 5873f74df67d59f25682286a5b027963d8a6d382..93c07a4c96e25ed1db5e1f721ab5d531

if (environment.includeIntegrated) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 4e8d7eba351c5f244c29c81555fb88ddb52262e3..dd4ed8f0b71e51ad196f39059149617d16d9a8b7 100644
index d97db4d05d7940d8408e7e0d473a3b17d956b858..6f39fd99ffb28d6c0267f4251c54af0c519289db 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -330,6 +330,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
Expand Down
56 changes: 0 additions & 56 deletions patches/server/0257-Make-pufferfish-config-relocatable.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ index 6376b8b3ff444f4cab93e2bb5d2becc77c33c118..c8ae6e4cd74549f753ec04def5d882de
protected final SoundType soundType;
protected final float friction;
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 7164788c20483a78a92ccdcf480bd95651d84825..a282e1a0c832174a70c7b317f547c5d250fe37ad 100644
index dca02d697dd0982b006d4d975e7df745ab62dac5..87ae04dff2645ba058325077cae4bcb20c7eab40 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -498,4 +498,19 @@ public class PurpurConfig {
Expand Down
Loading

0 comments on commit f06fd5b

Please sign in to comment.