Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@0a1be9a Make loadChunksForMoveAsync use new chunk system load calls
  • Loading branch information
granny committed Jul 31, 2024
1 parent 0bd5579 commit b3623fa
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 48 deletions.
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 = org.purpurmc.purpur
version = 1.21-R0.1-SNAPSHOT

mcVersion = 1.21
paperCommit = 58c7ea3193c5c192fb09b0197b86f0ff5dbe2dfd
paperCommit = 0a1be9ae87416ffca38cf20412e248c78a9d6a3c

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0024-Zombie-horse-naturally-spawn.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Zombie horse naturally spawn


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1d0f9fa24e8ead7710249575795951dad97ea51f..67304b6c7b33d163802a4eb725a449c1d310453b 100644
index 559bec25060eb8981bf80213ceedb79d6c99e411..2b7f3935b5224709a295b8ed16ac28f6c67b36fc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -915,10 +915,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -872,10 +872,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper - Configurable spawn chances for skeleton horses

if (flag1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Allow toggling special MobSpawners per world
In vanilla, these are all hardcoded on for world type 0 (overworld) and hardcoded off for every other world type. Default config behaviour matches this.

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 67304b6c7b33d163802a4eb725a449c1d310453b..804059a642f3ae53cd9732841c829aedc40b9ef2 100644
index 2b7f3935b5224709a295b8ed16ac28f6c67b36fc..648aa9ec26ee2291a0caf2c61a3da4429566c343 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -563,7 +563,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -520,7 +520,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.dragonParts = new Int2ObjectOpenHashMap();
this.tickTime = flag1;
this.server = minecraftserver;
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0092-Configurable-daylight-cycle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ index f2d977a4a984e8354cd09e756362c062e25cd834..545e4d618a06d100a85731418222acf0
}
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 804059a642f3ae53cd9732841c829aedc40b9ef2..f7e586f069a55728939c435ee9127b3f04941991 100644
index 648aa9ec26ee2291a0caf2c61a3da4429566c343..ce5da7fc2d94a4b54e2a33de1e3ac629e4ed80bc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -221,6 +221,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
Expand All @@ -43,15 +43,15 @@ index 804059a642f3ae53cd9732841c829aedc40b9ef2..f7e586f069a55728939c435ee9127b3f
private final RandomSequences randomSequences;

// CraftBukkit start
@@ -651,6 +653,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -608,6 +610,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.chunkTaskScheduler = new ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler((ServerLevel)(Object)this, ca.spottedleaf.moonrise.common.util.MoonriseCommon.WORKER_POOL);
// Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
+ this.preciseTime = this.serverLevelData.getDayTime(); // Purpur
}

// Paper start
@@ -827,6 +830,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -784,6 +787,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.serverLevelData.setGameTime(i);
this.serverLevelData.getScheduledEvents().tick(this.server, i);
if (this.levelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
Expand All @@ -65,7 +65,7 @@ index 804059a642f3ae53cd9732841c829aedc40b9ef2..f7e586f069a55728939c435ee9127b3f
this.setDayTime(this.levelData.getDayTime() + 1L);
}

@@ -835,7 +845,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -792,7 +802,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.

public void setDayTime(long timeOfDay) {
this.serverLevelData.setDayTime(timeOfDay);
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0138-Config-for-skipping-night.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Config for skipping night


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f7e586f069a55728939c435ee9127b3f04941991..6754f41a302d496d3796155665af7aebb716c4b4 100644
index ce5da7fc2d94a4b54e2a33de1e3ac629e4ed80bc..0d690ba8f752cc95812da2cad5b7c297b0289b30 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -704,7 +704,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -661,7 +661,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
long j;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Make lightning rod range configurable


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 6754f41a302d496d3796155665af7aebb716c4b4..e144c56fc79cc5f257ae840c0460d23b931a14d7 100644
index 0d690ba8f752cc95812da2cad5b7c297b0289b30..d70af5d1e743a981ffc3d85d06a7602925664148 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1050,7 +1050,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1007,7 +1007,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return holder.is(PoiTypes.LIGHTNING_ROD);
}, (blockposition1) -> {
return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Customizable sleeping actionbar messages


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e144c56fc79cc5f257ae840c0460d23b931a14d7..5422949d30e01070da58fbdfe480c61830eea6ab 100644
index d70af5d1e743a981ffc3d85d06a7602925664148..9b38adcdabb22c42611aad8d1ed226542d34ac34 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1099,11 +1099,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1056,11 +1056,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (this.canSleepThroughNights()) {
if (!this.getServer().isSingleplayer() || this.getServer().isPublished()) {
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Option for if rain and thunder should stop on sleep


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5422949d30e01070da58fbdfe480c61830eea6ab..12efa265ec4369279b844253273c58e7d7082a61 100644
index 9b38adcdabb22c42611aad8d1ed226542d34ac34..40d2472cebbde4a435d1b65ec8062c18b87c0cdb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1259,6 +1259,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1216,6 +1216,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@VisibleForTesting
public void resetWeatherCycle() {
// CraftBukkit start
+ if (this.purpurConfig.rainStopsAfterSleep) // Purpur
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -1266,6 +1267,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1223,6 +1224,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.serverLevelData.setRainTime(0);
}
// CraftBukkit end
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0227-Allow-void-trading.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Allow void trading


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 12efa265ec4369279b844253273c58e7d7082a61..ca9f42837b0ef21795dfb76b6a9ead07810b483a 100644
index 40d2472cebbde4a435d1b65ec8062c18b87c0cdb..e2f8ee57eeeceba632ff04c434fba82f9d22625b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2708,7 +2708,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -2665,7 +2665,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start - Fix merchant inventory not closing on entity removal
Expand Down
30 changes: 15 additions & 15 deletions patches/server/0250-Remove-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ index dcb5651d1d9b10b40430fb2f713beedf68336704..4aa9fbdf1eda91a5c54ff53709d94f30
gameprofilerfiller.pop();
gameprofilerfiller.pop();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2efc0b3e99 100644
index e2f8ee57eeeceba632ff04c434fba82f9d22625b..dc7db7a2c8b42f7ed2b7b28fe2ed6224be8da2fe 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -730,7 +730,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -687,7 +687,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}

gameprofilerfiller.popPush("tickPending");
Expand All @@ -352,7 +352,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
if (!this.isDebug() && flag) {
j = this.getGameTime();
gameprofilerfiller.push("blockTicks");
@@ -739,24 +739,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -696,24 +696,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
gameprofilerfiller.pop();
}
Expand Down Expand Up @@ -384,7 +384,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
}

this.handlingTick = false;
@@ -769,7 +769,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -726,7 +726,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.

if (flag1 || this.emptyTime++ < 300) {
gameprofilerfiller.push("entities");
Expand All @@ -393,7 +393,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
if (this.dragonFight != null && flag) {
gameprofilerfiller.push("dragonFight");
this.dragonFight.tick();
@@ -777,7 +777,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -734,7 +734,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}

org.spigotmc.ActivationRange.activateEntities(this); // Spigot
Expand All @@ -402,7 +402,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
this.entityTickList.forEach((entity) -> {
if (!entity.isRemoved()) {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
@@ -804,8 +804,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -761,8 +761,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
}
});
Expand All @@ -413,7 +413,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
gameprofilerfiller.pop();
this.tickBlockEntities();
}
@@ -995,12 +995,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -952,12 +952,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
} // Paper - Option to disable ice and snow

gameprofilerfiller.popPush("tickBlocks");
Expand All @@ -428,7 +428,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
gameprofilerfiller.pop();
}

@@ -1343,8 +1343,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1300,8 +1300,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Spigot end
// Paper start- timings
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
Expand All @@ -439,7 +439,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
// Paper end - timings
entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler();
@@ -1360,7 +1360,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1317,7 +1317,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
entity.postTick(); // CraftBukkit
} else { entity.inactiveTick(); } // Paper - EAR 2
this.getProfiler().pop();
Expand All @@ -448,7 +448,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
Iterator iterator = entity.getPassengers().iterator();

while (iterator.hasNext()) {
@@ -1383,8 +1383,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1340,8 +1340,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
// Paper - EAR 2
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
Expand All @@ -459,7 +459,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -1414,7 +1414,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1371,7 +1371,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(passenger, entity2);
}

Expand All @@ -468,7 +468,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
}
} else {
passenger.stopRiding();
@@ -1434,7 +1434,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1391,7 +1391,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
}

Expand All @@ -477,7 +477,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
if (doFull) {
this.saveLevelData(true);
}
@@ -1451,7 +1451,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1408,7 +1408,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
}
// CraftBukkit end
Expand All @@ -486,7 +486,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
}
// Paper end - Incremental chunk and player saving

@@ -1465,7 +1465,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1422,7 +1422,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.

if (!savingDisabled) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
Expand All @@ -495,7 +495,7 @@ index ca9f42837b0ef21795dfb76b6a9ead07810b483a..270986af40f1f91448cb6d1ab1560d2e
if (progressListener != null) {
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
}
@@ -1475,10 +1475,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1432,10 +1432,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}

Expand Down
Loading

0 comments on commit b3623fa

Please sign in to comment.