Skip to content

Commit

Permalink
more easy fork
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed May 8, 2024
1 parent f0c6352 commit 6bb6091
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 154 deletions.
199 changes: 93 additions & 106 deletions patches/server/0003-Rebrand.patch

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions patches/server/0005-Plazma-Configurations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Plazma Configurations


diff --git a/build.gradle.kts b/build.gradle.kts
index e6b6d1f26fd673f35f66a09a64c83810e092e757..1bccc21fa2130e577bd5c64b6ca08e9b2853cc22 100644
index 279e1cfd24f29d3ac55e74759d8b542a7520de3d..5b81ed7a9f978b59b1b287126c9161aa6446a28d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {
Expand All @@ -17,7 +17,7 @@ index e6b6d1f26fd673f35f66a09a64c83810e092e757..1bccc21fa2130e577bd5c64b6ca08e9b

runtimeOnly(common.maven.provider)
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 44dda308913d8d25e53d8d0fc7e50c0c678b76d0..5500196e8ca85f9e4542d2ffd02a6f8f12a09083 100644
index f5d725feb6d32f947eed82073c5594e205f31afe..71be8c8e5bb887a68e9ae5ab822313d7766ad6ca 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -39,28 +39,95 @@ public abstract class Configurations<G, W> {
Expand Down Expand Up @@ -517,18 +517,18 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
+
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b797f719acb2258bee1cc93394561f14a9df5296..aa02d9390a90e235476a25db31c915668ebc0ec9 100644
index 6d549448e67a110a42dde6f8eeaab1f0033f3462..065308f8cca471dee8360857bd627402849976dc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -316,6 +316,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 4 ]; // Purpur
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
+ public final org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations; // Plazma - Configurable Plazma
public static long currentTickLong = 0L; // Paper - track current tick as a long
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
public boolean lagging = false; // Purpur
@@ -427,6 +428,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -425,6 +426,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
Expand Down Expand Up @@ -577,7 +577,7 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..5b3d59cc5e4efd54bea967d2e37dc933
}

diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index ae0849f190f54afa0bae19877189ec2de7521ae9..5fb36396bf0391361d23007c95b05dbffa30c1b0 100644
index d606da8627219b5ecf4f1500086905fb4f572ca9..28e8967a87715fb2db25feb84e8736c446f355b5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -222,6 +222,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand Down Expand Up @@ -666,11 +666,11 @@ index c3805881b675b5c2171a6aadbd2c9057eff1ab9e..76d61c1f0a8e2fd0bed6be3052828a04
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 0d31b43cc7d319accaaf5548df8ea88dcd05a903..c8979f3ec7b5d98daa0ddf75dd1d28da5ca82026 100644
index 369543328531b0bd12c76aa8552e565bc40b51f7..40fd40da9a7fc2b12035b99960e7f38c78eb2a5e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -190,6 +190,14 @@ public class Main {
.defaultsTo("A Plazma Server") // Plazma - Rebrand
.defaultsTo("A " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " Server") // Plazma - Rebrand
.describedAs("Name");
// Paper end
+
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0007-Warn-on-startup.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Warn on startup


diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 2579b32009a5f5e288edf56ee8f1246cd70343fc..dafd37b3a31fbf63113787ccf6697651f5e1770d 100644
index 0fb3eeab083a0b1e9b495bd2c5c556fca2236c22..ce7782dd216922ad536bb435034255508271bfa4 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -127,6 +127,18 @@ public class Main {
Expand All @@ -14,10 +14,10 @@ index 2579b32009a5f5e288edf56ee8f1246cd70343fc..dafd37b3a31fbf63113787ccf6697651
// Plazma end
+ // Plazma start - Warn on startup
+ if (!org.plazmamc.plazma.Options.NO_WARN) {
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ if (com.destroystokyo.paper.PaperVersionFetcher.DEVELOPMENT) {
+ LOGGER.warn("Warning! " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ if (org.bukkit.craftbukkit.util.Versioning.DEVELOPMENT) {
+ LOGGER.error("*********************** CAUTION ***********************");
+ LOGGER.error("This version is a development version of Plazma.");
+ LOGGER.error("This version is a development version of " + org.bukkit.craftbukkit.util.Versioning.BRANDING + ".");
+ LOGGER.error("Nobody knows what kind of problem you're going to have, and there's always the possibility of unexpected problems.");
+ LOGGER.error("Never use this version on a public server, and after you've tested it enough before using it!");
+ LOGGER.error("*******************************************************");
Expand Down
24 changes: 12 additions & 12 deletions patches/server/0008-Development-Build.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Date: Tue, 7 May 2024 22:42:25 +0900
Subject: [PATCH] Development Build


diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 0a846802f053c545992763e0447e15565204e764..31edd38bbcd117dcde867e4cf7d25f657ea16468 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -27,7 +27,7 @@ public class PaperVersionFetcher implements VersionFetcher {
private static final String PROJECT_NAME = "Plazma";
private static final String PROJECT_REPO = "PlazmaMC/PlazmaBukkit";
private static final String DOWNLOAD_PAGE = "https://docs.plazmamc.org/plazma/about/downloads";
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 85265c28d2e5369c812ec856855183a98908680c..3dc8487be735cd13207cc9608e3faf95c3231536 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -18,7 +18,7 @@ public final class Versioning {
public static final String REPOSITORY = "PlazmaMC/PlazmaBukkit";
public static final String DOCUMENT = "https://docs.plazmamc.org/plazma/administration/getting-started";
public static final String STEPUP = "https://docs.plazmamc.org/plazma/administration/getting-started/next-step";
- public static final boolean DEVELOPMENT = false;
+ public static final boolean DEVELOPMENT = true;
// Plazma end

@Override
+ public static final boolean DEVELOPMENT = true; // Plazma - Development build
static {
InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties");
Properties properties = new Properties();
10 changes: 5 additions & 5 deletions patches/server/0009-Port-SparklyPaper-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,18 @@ index f164256d59b761264876ca0c85f812d101bfd5de..deaeb134c47da8710afa747bf980bd00
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c30bc456caf25fa07dc870eb544469e6d1184169..2213f09a99ea832f59ba802d411f11abfdc8141b 100644
index 065308f8cca471dee8360857bd627402849976dc..eb4c8b516be77423c7decb247f261a264b1cfc89 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -325,6 +325,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run

public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1743,17 +1744,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1741,17 +1742,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
Expand All @@ -175,7 +175,7 @@ index c30bc456caf25fa07dc870eb544469e6d1184169..2213f09a99ea832f59ba802d411f11ab
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
//this.profiler.push("commandFunctions"); // Purpur
@@ -1820,7 +1819,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1818,7 +1817,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
Expand All @@ -192,7 +192,7 @@ index c30bc456caf25fa07dc870eb544469e6d1184169..2213f09a99ea832f59ba802d411f11ab
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
regionManager.recalculateRegions();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 5fb36396bf0391361d23007c95b05dbffa30c1b0..f116d7163c71d35668ef7a3c77a627d925bb3550 100644
index 28e8967a87715fb2db25feb84e8736c446f355b5..32332070cc62c0842333b05c53005feb30051914 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -224,6 +224,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand Down
22 changes: 11 additions & 11 deletions patches/server/0015-Completely-remove-Mojang-Profiler.patch
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ index f626a2f28f2aebb3237cebb6afef3c4fa1a6cb37..467e17bfce31d0919d603698c9d88a04
public int forkLimit() {
return this.forkLimit;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db96b287920 100644
index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b61a5237f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -104,18 +104,18 @@ import net.minecraft.util.datafix.DataFixers;
Expand Down Expand Up @@ -97,7 +97,7 @@ index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db9
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
import net.minecraft.world.Difficulty;
import net.minecraft.world.RandomSequences;
@@ -222,14 +222,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -220,14 +220,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public LevelStorageSource.LevelStorageAccess storageSource;
public final PlayerDataStorage playerDataStorage;
private final List<Runnable> tickables = Lists.newArrayList();
Expand All @@ -120,7 +120,7 @@ index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db9
private ServerConnectionListener connection;
public final ChunkProgressListenerFactory progressListenerFactory;
@Nullable
@@ -2596,10 +2596,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2594,10 +2594,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}

Expand All @@ -133,15 +133,15 @@ index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db9

public abstract boolean isSingleplayerOwner(GameProfile profile);

@@ -2843,6 +2845,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2841,6 +2843,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// CraftBukkit end

+ /* // Plazma - Completely remove Mojang's Profiler
private void startMetricsRecordingTick() {
if (false && this.willStartRecordingMetrics) { // Purpur
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
@@ -2869,12 +2872,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2867,12 +2870,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}

public void startRecordingMetrics(Consumer<ProfileResults> resultConsumer, Consumer<Path> dumpConsumer) {
Expand All @@ -156,39 +156,39 @@ index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db9
}

public void stopRecordingMetrics() {
@@ -2889,6 +2892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2887,6 +2890,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//this.metricsRecorder.cancel(); // Purpur
//this.profiler = this.metricsRecorder.getProfiler(); // Purpur
}
+ */ // Plazma - Completely remove Mojang's Profiler

public Path getWorldPath(LevelResource worldSavePath) {
return this.storageSource.getLevelPath(worldSavePath);
@@ -2939,6 +2943,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2937,6 +2941,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.isSaving;
}

+ /* // Plazma - Completely remove Mojang's Profiler
public boolean isTimeProfilerRunning() {
return false; //this.debugCommandProfilerDelayStart || this.debugCommandProfiler != null; // Purpur
}
@@ -2957,6 +2962,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2955,6 +2960,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return methodprofilerresults;
}
}
+ */ // Plazma - Completely remove Mojang's Profiler

public int getMaxChainedNeighborUpdates() {
return 1000000;
@@ -3008,6 +3014,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -3006,6 +3012,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}

+ /* // Plazma - Completely remove Mojang's Profiler
private static class TimeProfiler {

final long startNanos;
@@ -3057,6 +3064,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -3055,6 +3062,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
};
}
}
Expand Down Expand Up @@ -361,7 +361,7 @@ index 8c587f829c5e8c6b6df3150024c4ae704988c47b..319f484b535143a94ee2da11114acacc
}
+// Plazma end - Completely remove Mojang's Profiler
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 1dc1536df986862396aa0f58e834c9c1599bf38e..2d704c3e24505314ec9754cb407fce54e914511b 100644
index 0559c251107ebbcf49940a5c7647dce2310eae92..b8fcb2841abf0b00f278d21cb344866ed987b4ce 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -923,11 +923,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0017-Reduce-create-random-instance.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Reduce create random instance


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 56859a5aebdff201a829b40716c655a0ab7f7e72..e460bbcdc370ef300e6c4fbbacb71fe6172c944c 100644
index da5275e9137023b39f7a0a20255e483b61a5237f..33b7b4f544d3ec597075edcbd265815c65c9f8fa 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -237,6 +237,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -235,6 +235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Nullable
private ServerStatus.Favicon statusIcon;
private final RandomSource random;
Expand All @@ -30,7 +30,7 @@ index b47a8a082170bcb630c4354be7c77a4cac71d105..7fe6b99e146e7374cd29534f1e89046e
double d1 = (double) (center.y - maxRange);
double d2 = (double) (center.x + maxRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 42a623254bd2886d09eb0cfeb01dd12d0dda19cf..feed838fe1ff9db60f1971cbafc25baf9af69fac 100644
index d7e4a9fe9676563845d9981523bff1a7ff12282c..b7b9e02ab31206c48f0db88beabc331b7e73245c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -482,7 +482,7 @@ public class ServerPlayer extends Player {
Expand Down
Loading

0 comments on commit 6bb6091

Please sign in to comment.