Skip to content

Commit b81ab42

Browse files
committed
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@cdad49b7 Do not mark plugin tickets as forced; keep correct ticket types PaperMC/Paper@a1c4fc96 Add generic ticket identifier PaperMC/Paper@745881bb Update Moonrise common for 1.21.5 PaperMC/Paper@e9d00eb6 Apply Moonrise patch PaperMC/Paper@ef0f0d10 Copy Moonrise 1.21.5 update over
1 parent aa0bf38 commit b81ab42

15 files changed

+85
-85
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ group = org.purpurmc.purpur
22
version = 1.21.5-R0.1-SNAPSHOT
33

44
mcVersion = 1.21.5
5-
paperCommit = db8c646d00d3ede50650ae27c89fd66be3be89e6
5+
paperCommit = ef0f0d101f97523b7b2df22fa90c04951bb48bca
66

77
org.gradle.configuration-cache = true
88
org.gradle.caching = true

purpur-server/minecraft-patches/features/0001-Ridables.patch

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ index fa7a2a85adf7758a753c54a7cf75cc667922d3d7..b0a86aac9603e72062f59dbe67c88ed8
1818
public boolean isClientAuthoritative() {
1919
return false;
2020
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
21-
index f34bc75f324454bf48f0ebf79111706bb027a54b..6ad266592c16bdeccfb689fb2ef2ee37e79a7b41 100644
21+
index f9aa990f0efa7abb681dd82fd5c8be9f8fcf917a..be8be8e3da80823917633de22985f7f4ef26dfe6 100644
2222
--- a/net/minecraft/server/MinecraftServer.java
2323
+++ b/net/minecraft/server/MinecraftServer.java
24-
@@ -1634,6 +1634,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
24+
@@ -1722,6 +1722,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
2525
serverLevel.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
2626
serverLevel.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
2727
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
@@ -30,7 +30,7 @@ index f34bc75f324454bf48f0ebf79111706bb027a54b..6ad266592c16bdeccfb689fb2ef2ee37
3030
/* Drop global time updates
3131
if (this.tickCount % 20 == 0) {
3232
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
33-
index 0e7405a480bffa81493ef2f2078c36ccda542cde..bc5c30430e79e2feb69c165d9e3e9b6a899b66ea 100644
33+
index 6e314abd57045693fd6016bce2b791eb68e40bb5..9b35652ed35c0b7ddb200239d932c83945ea4575 100644
3434
--- a/net/minecraft/server/level/ServerLevel.java
3535
+++ b/net/minecraft/server/level/ServerLevel.java
3636
@@ -212,6 +212,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -42,10 +42,10 @@ index 0e7405a480bffa81493ef2f2078c36ccda542cde..bc5c30430e79e2feb69c165d9e3e9b6a
4242
@Override
4343
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
4444
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
45-
index 839975cf328268e1f476f5c59e3323a395929395..bba6b5234b668827f90991e4885b5e19c2f97728 100644
45+
index 6f2640c7d7df73fc4ef5ad3f0b232bb3c4c4da47..86964fd2231bca608c2cb3155f70086e893dc1f7 100644
4646
--- a/net/minecraft/server/level/ServerPlayer.java
4747
+++ b/net/minecraft/server/level/ServerPlayer.java
48-
@@ -764,6 +764,15 @@ public class ServerPlayer extends Player {
48+
@@ -794,6 +794,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
4949
this.trackEnteredOrExitedLavaOnVehicle();
5050
this.updatePlayerAttributes();
5151
this.advancements.flushDirty(this, true);
@@ -75,10 +75,10 @@ index 63e01ec7e4ab04bb7d389bff485dfedca344bfa2..84b1570d0d88f57f33ff8179f0a78d37
7575
if ((target instanceof net.minecraft.world.entity.animal.Bucketable && target instanceof LivingEntity && origItem != null && origItem == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelectedItem().isEmpty() || !ServerGamePacketListenerImpl.this.player.getInventory().getSelectedItem().is(origItem))) {
7676
target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it
7777
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
78-
index d1899b2411e90b4641dcbc58760e4a19b62846c5..1335a04edd053c06e290c070e3c03d02598d97e7 100644
78+
index f6edaef36f55ef971386972b8c80d70aa4883ec7..6d18921bf283dac5279c82ae0562927db0f7f14f 100644
7979
--- a/net/minecraft/world/entity/Entity.java
8080
+++ b/net/minecraft/world/entity/Entity.java
81-
@@ -2856,6 +2856,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
81+
@@ -3093,6 +3093,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
8282
this.passengers = ImmutableList.copyOf(list);
8383
}
8484

@@ -92,7 +92,7 @@ index d1899b2411e90b4641dcbc58760e4a19b62846c5..1335a04edd053c06e290c070e3c03d02
9292
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
9393
}
9494
}
95-
@@ -2897,6 +2904,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
95+
@@ -3134,6 +3141,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
9696
return false;
9797
}
9898
// CraftBukkit end
@@ -107,7 +107,7 @@ index d1899b2411e90b4641dcbc58760e4a19b62846c5..1335a04edd053c06e290c070e3c03d02
107107
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
108108
this.passengers = ImmutableList.of();
109109
} else {
110-
@@ -4823,4 +4838,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
110+
@@ -5136,4 +5151,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
111111
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
112112
}
113113
// Paper end - Expose entity id counter

purpur-server/minecraft-patches/features/0006-Minecart-settings-and-WASD-controls.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Subject: [PATCH] Minecart settings and WASD controls
55

66

77
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
8-
index 6c5dab657ae7a7f5fd6fb73a86b3e8e4803dae50..998ce3a34e48e56cd907fc61cc3715518cbfae28 100644
8+
index 86964fd2231bca608c2cb3155f70086e893dc1f7..786222aeb501fb31e0d77661b87e8d097c88b8b7 100644
99
--- a/net/minecraft/server/level/ServerPlayer.java
1010
+++ b/net/minecraft/server/level/ServerPlayer.java
11-
@@ -1153,6 +1153,11 @@ public class ServerPlayer extends Player {
11+
@@ -1183,6 +1183,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
1212
} else {
1313
// Purpur start - Add boat fall damage config
1414
if (damageSource.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {

purpur-server/minecraft-patches/features/0008-Configurable-void-damage-height-and-damage.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ temporarily migrate to paper's config
77
drop patch on the next minecraft release
88

99
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
10-
index 6ad266592c16bdeccfb689fb2ef2ee37e79a7b41..e950e74d7c14d2e180e5ca879eb1048866d85051 100644
10+
index be8be8e3da80823917633de22985f7f4ef26dfe6..195dd839c50f5a86dffcbd3b6b82b5fb30a54e16 100644
1111
--- a/net/minecraft/server/MinecraftServer.java
1212
+++ b/net/minecraft/server/MinecraftServer.java
13-
@@ -1140,6 +1140,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
13+
@@ -1220,6 +1220,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
1414
}
1515
// Purpur end - config for startup commands
1616

@@ -28,7 +28,7 @@ index 6ad266592c16bdeccfb689fb2ef2ee37e79a7b41..e950e74d7c14d2e180e5ca879eb10488
2828
long l;
2929
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
3030
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
31-
index 19bb96242fed268c23381a6f3eaef21e723666c5..127935326dbfa0aa454dc12d52dcef328fcf2771 100644
31+
index d02f2bb68b46678bf5033e2d310fcc6b22bd038f..8bb2c4266a543c4b6a3d9686d6010241a0f40c86 100644
3232
--- a/net/minecraft/server/dedicated/DedicatedServer.java
3333
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
3434
@@ -168,6 +168,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

purpur-server/minecraft-patches/features/0019-API-for-any-mob-to-burn-daylight.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
66
Co-authored by: Encode42 <[email protected]>
77

88
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
9-
index 1335a04edd053c06e290c070e3c03d02598d97e7..7148e8c6deeb1e5f99eb6d2fe6c0fc9583e44934 100644
9+
index 6d18921bf283dac5279c82ae0562927db0f7f14f..f55db145661cab3cfc9ffa755792be2c3d80f50a 100644
1010
--- a/net/minecraft/world/entity/Entity.java
1111
+++ b/net/minecraft/world/entity/Entity.java
12-
@@ -415,6 +415,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
12+
@@ -521,6 +521,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
1313
}
1414
// Purpur end - Add canSaveToDisk to Entity
1515

purpur-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
2828
AtomicReference<S> atomicReference = new AtomicReference<>();
29-
@@ -917,6 +_,15 @@
29+
@@ -993,6 +_,15 @@
3030

3131
LOGGER.info("Stopping server");
3232
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -42,7 +42,7 @@
4242
// CraftBukkit start
4343
if (this.server != null) {
4444
this.server.spark.disable(); // Paper - spark
45-
@@ -1011,6 +_,8 @@
45+
@@ -1091,6 +_,8 @@
4646
this.safeShutdown(waitForServer, false);
4747
}
4848
public void safeShutdown(boolean waitForServer, boolean isRestarting) {
@@ -51,15 +51,15 @@
5151
this.isRestarting = isRestarting;
5252
this.hasLoggedStop = true; // Paper - Debugging
5353
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
54-
@@ -1030,6 +_,7 @@
54+
@@ -1110,6 +_,7 @@
5555
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
5656
private long lastTick = 0;
5757
private long catchupTime = 0;
5858
+ public final RollingAverage tps5s = new RollingAverage(5); // Purpur - Add 5 second tps average in /tps
5959
public final RollingAverage tps1 = new RollingAverage(60);
6060
public final RollingAverage tps5 = new RollingAverage(60 * 5);
6161
public final RollingAverage tps15 = new RollingAverage(60 * 15);
62-
@@ -1115,6 +_,16 @@
62+
@@ -1195,6 +_,16 @@
6363
}
6464
// Paper end - Add onboarding message for initial server start
6565

@@ -76,7 +76,7 @@
7676
while (this.running) {
7777
long l;
7878
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
79-
@@ -1139,14 +_,19 @@
79+
@@ -1219,14 +_,19 @@
8080
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
8181
final long diff = currentTime - tickSection;
8282
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
@@ -99,7 +99,7 @@
9999
tickSection = currentTime;
100100
}
101101
// Paper end - further improve server tick loop
102-
@@ -1171,6 +_,12 @@
102+
@@ -1258,6 +_,12 @@
103103
profilerFiller.popPush("nextTickWait");
104104
this.mayHaveDelayedTasks = true;
105105
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
@@ -112,7 +112,7 @@
112112
this.startMeasuringTaskExecutionTime();
113113
this.waitUntilNextTick();
114114
this.finishMeasuringTaskExecutionTime();
115-
@@ -1580,7 +_,7 @@
115+
@@ -1668,7 +_,7 @@
116116
long worldTime = level.getGameTime();
117117
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
118118
for (Player entityhuman : level.players()) {
@@ -121,7 +121,7 @@
121121
continue;
122122
}
123123
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
124-
@@ -1744,7 +_,7 @@
124+
@@ -1832,7 +_,7 @@
125125

126126
@DontObfuscate
127127
public String getServerModName() {

purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
private final RandomSequences randomSequences;
1010

1111
// CraftBukkit start
12-
@@ -350,7 +_,24 @@
12+
@@ -586,7 +_,24 @@
1313
// CraftBukkit end
1414
this.tickTime = tickTime;
1515
this.server = server;
@@ -35,15 +35,15 @@
3535
this.serverLevelData = serverLevelData;
3636
ChunkGenerator chunkGenerator = levelStem.generator();
3737
// CraftBukkit start
38-
@@ -431,6 +_,7 @@
39-
this.gameEventDispatcher = new GameEventDispatcher(this);
40-
this.randomSequences = Objects.requireNonNullElseGet(randomSequences, () -> this.getDataStorage().computeIfAbsent(RandomSequences.TYPE));
38+
@@ -670,6 +_,7 @@
39+
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
40+
// Paper end - rewrite chunk system
4141
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
4242
+ this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
4343
}
4444

4545
// Paper start
46-
@@ -477,7 +_,7 @@
46+
@@ -716,7 +_,7 @@
4747
}
4848

4949
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
@@ -52,7 +52,7 @@
5252
// Paper start - create time skip event - move up calculations
5353
final long newDayTime = this.levelData.getDayTime() + 24000L;
5454
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
55-
@@ -594,6 +_,13 @@
55+
@@ -835,6 +_,13 @@
5656
this.serverLevelData.getScheduledEvents().tick(this.server, l);
5757
Profiler.get().pop();
5858
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
@@ -66,7 +66,7 @@
6666
this.setDayTime(this.levelData.getDayTime() + 1L);
6767
}
6868
}
69-
@@ -601,7 +_,21 @@
69+
@@ -842,7 +_,21 @@
7070

7171
public void setDayTime(long time) {
7272
this.serverLevelData.setDayTime(time);
@@ -89,7 +89,7 @@
8989

9090
public void tickCustomSpawners(boolean spawnEnemies, boolean spawnFriendlies) {
9191
for (CustomSpawner customSpawner : this.customSpawners) {
92-
@@ -678,9 +_,17 @@
92+
@@ -946,9 +_,17 @@
9393
&& this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
9494
&& !this.getBlockState(blockPos.below()).is(Blocks.LIGHTNING_ROD);
9595
if (flag) {
@@ -109,7 +109,7 @@
109109
skeletonHorse.setAge(0);
110110
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
111111
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
112-
@@ -738,7 +_,7 @@
112+
@@ -1006,7 +_,7 @@
113113
pointOfInterestType -> pointOfInterestType.is(PoiTypes.LIGHTNING_ROD),
114114
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
115115
pos,
@@ -118,7 +118,7 @@
118118
PoiManager.Occupancy.ANY
119119
);
120120
return optional.map(blockPos -> blockPos.above(1));
121-
@@ -787,8 +_,26 @@
121+
@@ -1055,8 +_,26 @@
122122
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
123123
Component component;
124124
if (this.sleepStatus.areEnoughSleeping(_int)) {
@@ -145,23 +145,23 @@
145145
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int));
146146
}
147147

148-
@@ -921,6 +_,7 @@
148+
@@ -1189,6 +_,7 @@
149149
@VisibleForTesting
150150
public void resetWeatherCycle() {
151151
// CraftBukkit start
152152
+ if (this.purpurConfig.rainStopsAfterSleep) // Purpur - Option for if rain and thunder should stop on sleep
153153
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
154154
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
155155
// Not that everyone ever manages to get the whole server to sleep at the same time....
156-
@@ -928,6 +_,7 @@
156+
@@ -1196,6 +_,7 @@
157157
this.serverLevelData.setRainTime(0);
158158
}
159159
// CraftBukkit end
160160
+ if (this.purpurConfig.thunderStopsAfterSleep) // Purpur - Option for if rain and thunder should stop on sleep
161161
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
162162
// CraftBukkit start
163163
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
164-
@@ -2331,7 +_,7 @@
164+
@@ -2644,7 +_,7 @@
165165
// Spigot start
166166
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
167167
// Paper start - Fix merchant inventory not closing on entity removal

0 commit comments

Comments
 (0)