Skip to content

Commit

Permalink
Updated Upstream (Paper/Gale/Purpur)
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@2cd8c46 Add OMINOUS_ITEM_SPAWNER SpawnReason (#10897)
PaperMC/Paper@ef96a69 Fire EntityChangeBlockEvent for weaving potion effect (#11087)

Gale Changes:
Dreeam-qwq/Gale@d70d3a0 Drop Optimize random calls in chunk ticking
Dreeam-qwq/Gale@0439874 Fix auto upstream workflow (#2)
Dreeam-qwq/Gale@cf49069 Updated Upstream (Paper)

Purpur Changes:
PurpurMC/Purpur@bf63cfa Updated Upstream (Paper)
  • Loading branch information
Dreeam-qwq committed Jul 16, 2024
1 parent feafc64 commit 6f90851
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 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 = cn.dreeam.leaf
mcVersion = 1.21
version = 1.21-R0.1-SNAPSHOT

galeCommit = 65a5517ddefb8cb1a53f3d3c9984532526440f6f
galeCommit = cf49069bb91ac5b6fbeda210769bdc6492e377cd

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
2 changes: 1 addition & 1 deletion patches/api/0004-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: 87cf9f15dc468169a0350d678bf1fdc036eeaf33
Commit: bf63cfab4dfa92afc5c2a12c2c6f4cb1ddfa32df

Patches below are removed in this patch:
Pufferfish-API-Changes.patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur generated-api Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: 87cf9f15dc468169a0350d678bf1fdc036eeaf33
Commit: bf63cfab4dfa92afc5c2a12c2c6f4cb1ddfa32df

diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 3add91218dd3f07052aa932f0503d1f10ac3799b..3e41a4141095bce989c75e989293deb3f47e8e6d 100644
Expand Down
16 changes: 8 additions & 8 deletions patches/server/0009-Purpur-Server-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TODO - Dreeam: Check Fix-pufferfish-issues.patch
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: 87cf9f15dc468169a0350d678bf1fdc036eeaf33
Commit: bf63cfab4dfa92afc5c2a12c2c6f4cb1ddfa32df

Patches below are removed in this patch:
Brand changes in Rebrand.patch
Expand Down Expand Up @@ -1098,7 +1098,7 @@ index c80be65d190c85e7f0ea8233ebbbdbc1ea67f276..97e793c971614299504605aeb4f99cad
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3f787ea97480fa987cc1fc8d64268d46723fe1dd..c4c5b6ce393f023117bd95d874be863a18984d3a 100644
index e6821a3a99eabfd6ea3d4f7fe98e25598c591f86..5c7fc68e5d1c33fd5151512582ba9a0dc2bc6f6e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -220,6 +220,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
Expand Down Expand Up @@ -1198,7 +1198,7 @@ index 3f787ea97480fa987cc1fc8d64268d46723fe1dd..c4c5b6ce393f023117bd95d874be863a
public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) {
Iterator iterator = this.customSpawners.iterator();

@@ -888,10 +930,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -886,10 +928,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 All @@ -1219,7 +1219,7 @@ index 3f787ea97480fa987cc1fc8d64268d46723fe1dd..c4c5b6ce393f023117bd95d874be863a
entityhorseskeleton.setAge(0);
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
@@ -970,7 +1020,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -968,7 +1018,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 All @@ -1228,7 +1228,7 @@ index 3f787ea97480fa987cc1fc8d64268d46723fe1dd..c4c5b6ce393f023117bd95d874be863a

return optional.map((blockposition1) -> {
return blockposition1.above(1);
@@ -1019,11 +1069,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1017,11 +1067,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 Expand Up @@ -1257,23 +1257,23 @@ index 3f787ea97480fa987cc1fc8d64268d46723fe1dd..c4c5b6ce393f023117bd95d874be863a
ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i));
}

@@ -1163,6 +1229,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1161,6 +1227,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....
@@ -1170,6 +1237,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1168,6 +1235,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.serverLevelData.setRainTime(0);
}
// CraftBukkit end
+ if (this.purpurConfig.thunderStopsAfterSleep) // Purpur
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
@@ -2608,7 +2676,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -2606,7 +2674,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
6 changes: 3 additions & 3 deletions patches/server/0010-Fix-Pufferfish-and-Purpur-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb73
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
this.repaint();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 105e3b989440380e8c917075c335f58a96a5dde9..54586bbe25911dbdc5144fe71d6219c759234140 100644
index 3b81ba4c283e474493e9bc97bbfa230a7878cdbc..015780e88997cc0518e5626b3094770a41669fd8 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -467,7 +467,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -466,7 +466,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
this.lastSpawnState = spawnercreature_d;
// Gale start - MultiPaper - skip unnecessary mob spawning computations
} else {
Expand All @@ -100,7 +100,7 @@ index 105e3b989440380e8c917075c335f58a96a5dde9..54586bbe25911dbdc5144fe71d6219c7
// Gale end - MultiPaper - skip unnecessary mob spawning computations

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c4c5b6ce393f023117bd95d874be863a18984d3a..9283242e8cb1831a2867b2dc119b72f4d6f11696 100644
index 5c7fc68e5d1c33fd5151512582ba9a0dc2bc6f6e..c4ad1054ab6334ea33533396ed33e10b214c8721 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -682,7 +682,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
Expand Down
38 changes: 19 additions & 19 deletions patches/server/0013-Remove-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ index 3af290825bbbc461354c6d76b61a0ebf8c8a3ee7..138bb26241ce67d1dd8447a7f1c737ba

}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 54586bbe25911dbdc5144fe71d6219c759234140..04bcc3bfda7669dc446e85b724039dcfa6fb7bf8 100644
index 015780e88997cc0518e5626b3094770a41669fd8..6324bb513d0d7a42f1a411cb6deb4814bf36975f 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -356,9 +356,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
Expand Down Expand Up @@ -1182,23 +1182,23 @@ index 54586bbe25911dbdc5144fe71d6219c759234140..04bcc3bfda7669dc446e85b724039dcf

while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
@@ -438,7 +429,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -437,7 +428,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
boolean flagAndHasNaturalSpawn = flag && this.anySpawnCategoryIsSpawnedThisTick();
if (flagAndHasNaturalSpawn) {
// Gale end - MultiPaper - skip unnecessary mob spawning computations
- this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
int naturalSpawnChunkCount = k;
@@ -462,7 +452,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -461,7 +451,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
}
// Paper end - Optional per player mob spawns
- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings

this.lastSpawnState = spawnercreature_d;
// Gale start - MultiPaper - skip unnecessary mob spawning computations
@@ -507,19 +496,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -506,19 +495,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
}
}
Expand All @@ -1219,7 +1219,7 @@ index 54586bbe25911dbdc5144fe71d6219c759234140..04bcc3bfda7669dc446e85b724039dcf
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9283242e8cb1831a2867b2dc119b72f4d6f11696..2bb56f0e45187d09dfd9cf2222b6300afeba8050 100644
index c4ad1054ab6334ea33533396ed33e10b214c8721..6b6a01ae372d88aee2853d96203b952667443932 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,7 +1,6 @@
Expand Down Expand Up @@ -1281,7 +1281,7 @@ index 9283242e8cb1831a2867b2dc119b72f4d6f11696..2bb56f0e45187d09dfd9cf2222b6300a
this.tickBlockEntities();
}

@@ -966,12 +953,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -964,12 +951,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
} // Paper - Option to disable ice and snow

Expand All @@ -1294,7 +1294,7 @@ index 9283242e8cb1831a2867b2dc119b72f4d6f11696..2bb56f0e45187d09dfd9cf2222b6300a
}

@VisibleForTesting
@@ -1300,31 +1284,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1298,31 +1282,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
currentlyTickingEntity.lazySet(entity);
}
// Paper end - log detailed entity tick information
Expand Down Expand Up @@ -1326,15 +1326,15 @@ index 9283242e8cb1831a2867b2dc119b72f4d6f11696..2bb56f0e45187d09dfd9cf2222b6300a
Iterator iterator = entity.getPassengers().iterator();

while (iterator.hasNext()) {
@@ -1332,7 +1306,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1330,7 +1304,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.

this.tickPassenger(entity, entity1);
}
- // } finally { timer.stopTiming(); } // Paper - timings - move up
// Paper start - log detailed entity tick information
} finally {
if (currentlyTickingEntity.get() == entity) {
@@ -1347,9 +1320,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1345,9 +1318,6 @@ 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 @@ -1344,7 +1344,7 @@ index 9283242e8cb1831a2867b2dc119b72f4d6f11696..2bb56f0e45187d09dfd9cf2222b6300a
passenger.setOldPosAndRot();
++passenger.tickCount;

@@ -1371,8 +1341,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1369,8 +1339,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.

this.tickPassenger(passenger, entity2);
}
Expand All @@ -1353,31 +1353,31 @@ index 9283242e8cb1831a2867b2dc119b72f4d6f11696..2bb56f0e45187d09dfd9cf2222b6300a
}
} else {
passenger.stopRiding();
@@ -1392,7 +1360,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1390,7 +1358,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
}

- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) {
if (doFull) {
this.saveLevelData(true);
}
@@ -1409,7 +1376,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1407,7 +1374,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
}
// CraftBukkit end
- }
}
// Paper end - Incremental chunk and player saving

@@ -1423,7 +1389,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1421,7 +1387,6 @@ 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
- try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
if (progressListener != null) {
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
}
@@ -1433,10 +1398,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1431,10 +1396,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}

Expand Down Expand Up @@ -1660,34 +1660,34 @@ index cd0e43f4c53a746dd6183a8406269f9b11ad3571..54657ac895fb2fa9c58910d5421f0082
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 4d04efcc4c902c1c108d142b9486d080aff7cd44..6b967b41160691a8429ec8a3f42469c63c609e75 100644
index b07763aa7b3b92e24891b4ba346334ba8984ed67..db16be7db9d1df323f150dfd6f3d893b79d79838 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -657,7 +657,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -644,7 +644,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system

if (this.needsDecoration) {
- try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(this.level.getSeed());
@@ -677,7 +676,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -664,7 +663,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
- } // Paper
}
}
}
@@ -1014,7 +1012,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1001,7 +999,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p

if (LevelChunk.this.isTicking(blockposition)) {
try {
- this.blockEntity.tickTimer.startTiming(); // Spigot
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);

if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1037,14 +1034,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1024,14 +1021,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
LevelChunk.this.removeBlockEntity(this.getPos());
// Paper end - Prevent block entity and entity crashes
Expand Down
Loading

0 comments on commit 6f90851

Please sign in to comment.