Skip to content

Commit

Permalink
Update to the latest Paper 1.21.3 commit, disable automatic updates b…
Browse files Browse the repository at this point in the history
…ecause Paper did not release a ver/1.21.3 branch, remove the max height fix patch because this was fixed in Spigot
  • Loading branch information
MrPowerGamerBR committed Dec 8, 2024
1 parent 727305a commit db8ee6c
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 46 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Automatically update Paper commit hash
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
# Paper did not release a ver/1.21.3 branch, so we need to disable it manually
# schedule:
# - cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group=net.sparklypower.sparklypaper
version=1.21.3-R0.1-SNAPSHOT

mcVersion=1.21.3
paperRef=5403894bd447327d4bc0c8495b1ed371e0980a29
paperRef=da7138233f6392e791d790d1c3407414c855f9c2

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0004-SPARKLYPOWER-Add-custom-blocks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ index 41eaa8159f8c028faa118300e95f6a0fb9cfe989..5b5ddb19b39d5201da422f9b10e2491a

/**
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index c7ce8fa1ff9feda66d5a4e497112a24ff51c9d2b..b121cf287460b9256eb6c26fae98d831b9bc7eea 100644
index 028ac35df6c4d044d07b3869751736d418c1eb0e..dd9795e0725275b0fe5a3f4ecfd4d587a23f963f 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -3843,6 +3843,22 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
Expand All @@ -57,5 +57,5 @@ index c7ce8fa1ff9feda66d5a4e497112a24ff51c9d2b..b121cf287460b9256eb6c26fae98d831
+ SPARKLYPOWER_ASPHALT_PLAYER_SLAB(13009, Slab.class),
+ // SparklyPaper end
// ----- Legacy Separator -----
@Deprecated
@Deprecated(since = "1.13")
LEGACY_AIR(0, 0),
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..15b21fa3907db1b77ed5b5d1050a37f4
throw new IllegalStateException("Ticking retired scheduler");
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c26e3a239441376f2694782d4f07943538677c71..114b379bb3a56099dbd4e4bf11f6a1b7ddc488f7 100644
index 4158473fd553a16fec23bcbcf9a278d413120600..8cc953b72a7132a92390ab1f5e62b267d08e706a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -333,7 +333,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -86,7 +86,7 @@ index c26e3a239441376f2694782d4f07943538677c71..114b379bb3a56099dbd4e4bf11f6a1b7
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
@@ -1803,6 +1804,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1804,6 +1805,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
Expand All @@ -105,7 +105,7 @@ index c26e3a239441376f2694782d4f07943538677c71..114b379bb3a56099dbd4e4bf11f6a1b7
getAllLevels().forEach(level -> {
for (final Entity entity : level.getEntities().getAll()) {
if (entity.isRemoved()) {
@@ -1814,6 +1827,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1815,6 +1828,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0015-Track-how-much-MSPT-each-world-used.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..601198a33adb29316b0617d5390d1620
}

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ae085afa4d532c13a02321407d9f5059e4a3e567..712ca8371188fceb99e1e3a898e5f8067e5a8a5a 100644
index 9fd2bb0441b614d0a1abf8a8000eece14dcd6bbe..e168e5f433da40f3bdd5821451c3f3572b69a48c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1888,7 +1888,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1889,7 +1889,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
gameprofilerfiller.push("tick");

try {
Expand All @@ -77,7 +77,7 @@ index ae085afa4d532c13a02321407d9f5059e4a3e567..712ca8371188fceb99e1e3a898e5f806
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 957cae6ddeba9efe3b55588567ae51e8b86b6a42..be488eb582f15996921eab5d63bcc73655e61a0b 100644
index 585e2b43a0326f0b81597fa1234d3c67c76af550..ba899bcf05b967db784b7435895d6ff7b72b40f2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -595,6 +595,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
Expand Down
30 changes: 15 additions & 15 deletions patches/server/0023-Parallel-world-ticking.patch
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ index 8f9fde5489c0e1d0a91203536caddec5a9c96f6c..84617a7d6fae4a67f07d50a8e9410e35
}

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fd5a0b0eaece1fcee3513df52f0c1ad420832af8..c9149c3b3da4589844ef721a62210b8b47227654 100644
index e168e5f433da40f3bdd5821451c3f3572b69a48c..2a9f9e37fcaf70bff89f5adfbf54a0d95a14bb3a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,9 +3,6 @@ package net.minecraft.server;
Expand Down Expand Up @@ -774,7 +774,7 @@ index fd5a0b0eaece1fcee3513df52f0c1ad420832af8..c9149c3b3da4589844ef721a62210b8b

public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1865,50 +1799,71 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1866,50 +1800,71 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
Expand Down Expand Up @@ -883,7 +883,7 @@ index fd5a0b0eaece1fcee3513df52f0c1ad420832af8..c9149c3b3da4589844ef721a62210b8b
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked

gameprofilerfiller.popPush("connection");
@@ -2002,6 +1957,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2003,6 +1958,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Map<ResourceKey<Level>, ServerLevel> oldLevels = this.levels;
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
newLevels.remove(level.dimension());
Expand All @@ -905,7 +905,7 @@ index e49e8e98ebbd3c8ba8a784f1626132699209b4e3..d952d42b8faee38f9d55fe578c030891
// SparklyPaper start - Spooky month optimizations
halloweenManager.startHalloweenEpochTask();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8de30b5dff3dc0e30f1a56303abcb31df8f85c9f..b3917c319c32eb9926418f788faf4adecf40a09a 100644
index ba899bcf05b967db784b7435895d6ff7b72b40f2..f750d015bf8ffb533713f298a9d1df13de60693e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -200,7 +200,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
Expand Down Expand Up @@ -1022,7 +1022,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..f58331b6be3a26e76082d16894d3eb4d
// Paper end - Inventory close reason
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 30de3d1a7792c38ae946f19cb0e14637919b5001..0ea2d2b32aacdbfca80c0c626520bd863601bbd2 100644
index 1a956249828156fdc273888de59128c3d1a0b898..6484a87853eb2a907f729365edadc39e87e395bb 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -137,7 +137,7 @@ public abstract class PlayerList {
Expand Down Expand Up @@ -1505,10 +1505,10 @@ index 84f4664950e0cef7bd823bfc74f37cefce620d9e..b0c3b64da7aed676a5614c442948bbe9
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..12f780b349e825747c2441d9636ae1dc667312e5 100644
index 57da11c0da7322e74810e7108e9c8000b0c36520..71709c8a8c5cec6403ec92badde412427c8f276b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -458,7 +458,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -459,7 +459,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}

private boolean unloadChunk0(int x, int z, boolean save) {
Expand All @@ -1517,23 +1517,23 @@ index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..12f780b349e825747c2441d9636ae1dc
if (!this.isChunkLoaded(x, z)) {
return true;
}
@@ -481,6 +481,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -482,6 +482,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
if (!unloadChunk0(x, z, false)) {
return false;
}
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, x, z, "Cannot regenerate chunk asynchronously"); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
warnUnsafeChunk("regenerating a faraway chunk", x, z); // Paper

final long chunkKey = ChunkCoordIntPair.pair(x, z);
@@ -502,6 +503,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -503,6 +504,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public boolean refreshChunk(int x, int z) {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, x, z, "Cannot refresh chunk asynchronously"); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
if (playerChunk == null) return false;

@@ -562,7 +564,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -563,7 +565,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public boolean loadChunk(int x, int z, boolean generate) {
Expand All @@ -1542,39 +1542,39 @@ index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..12f780b349e825747c2441d9636ae1dc
warnUnsafeChunk("loading a faraway chunk", x, z); // Paper
ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper

@@ -814,6 +816,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -815,6 +817,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, loc.getX(), loc.getZ(), "Cannot generate tree asynchronously"); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
this.world.captureTreeGeneration = true;
this.world.captureBlockStates = true;
boolean grownTree = this.generateTree(loc, type);
@@ -929,6 +932,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -930,6 +933,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source, Consumer<net.minecraft.world.level.ServerExplosion> configurator) {
// Paper end - expand explosion API
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, x, z, "Cannot create explosion asynchronously"); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
net.minecraft.world.level.Level.ExplosionInteraction explosionType;
if (!breakBlocks) {
explosionType = net.minecraft.world.level.Level.ExplosionInteraction.NONE; // Don't break blocks
@@ -1020,6 +1024,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1021,6 +1025,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) {
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, x >> 4, z >> 4, "Cannot retrieve chunk asynchronously"); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper
// Transient load for this tick
return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z);
@@ -1050,6 +1055,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1051,6 +1056,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setBiome(int x, int y, int z, Holder<net.minecraft.world.level.biome.Biome> bb) {
BlockPos pos = new BlockPos(x, 0, z);
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, pos, "Cannot retrieve chunk asynchronously"); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
if (this.world.hasChunkAt(pos)) {
net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos);

@@ -2322,6 +2328,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2327,6 +2333,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) {
Expand Down

This file was deleted.

0 comments on commit db8ee6c

Please sign in to comment.