Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jan 4, 2024
1 parent 783ea26 commit f27621f
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
packageVersion=1_20_R3
org.gradle.jvmargs=-Xmx2G
paperRef=0ae58c09a15ee1ad307a2b8ef7e8ad735d336651
paperRef=ae001ae6ee11e09f5c6ae9d7dfbde7aac6da737b
preVersion=false
updatingMinecraft=false
42 changes: 21 additions & 21 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,10 @@ index 22687667ec69a954261e55e59261286ac1b8b8cd..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
index abd0217cf0bff183c8e262edc173a53403797c1a..8e52ebe8d12f5da3d877b0e4ff3723229fb47db1 100644
index 6bc7c6f16a1649fc9e24e7cf90fca401e5bd4875..5b446e6ac151f99f64f0c442d0b40b5e251bc4c4 100644
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
@@ -1315,9 +1315,7 @@ public final class ChunkHolderManager {
@@ -1316,9 +1316,7 @@ public final class ChunkHolderManager {
}

public boolean processTicketUpdates() {
Expand Down Expand Up @@ -1111,7 +1111,7 @@ index 5a07dad83602425b35f480cf8a31ed328cdfe640..11d26f4a84792019ce9ad6886bd96214
// Paper start
if (waitableArray[0] != null) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index d9cd497bc1b654030ff1a597f038b6a881df9f6b..931d77112ad02e712225efe7e0218fadde24400d 100644
index ecb09c74153349e78bb81d1188c282e4be4000bf..bfc7ba2238e1abc7f0a0ead102c00f8daf4081a2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,13 +1,10 @@
Expand Down Expand Up @@ -1380,7 +1380,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..d6089c0d0b076d232834619bc93bc64f
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 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890a5ab2197 100644
index 676087c3addd712939c865b39ddb5d9f0bc7ce25..554c400802e0eda9eed41dcb478d8a4401614f1d 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 All @@ -1391,15 +1391,15 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.util.Pair;
@@ -846,7 +845,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -851,7 +850,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}

gameprofilerfiller.popPush("tickPending");
- this.timings.scheduledBlocks.startTiming(); // Paper
if (!this.isDebug() && flag) {
j = this.getGameTime();
gameprofilerfiller.push("blockTicks");
@@ -855,24 +853,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -860,24 +858,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.fluidTicks.tick(j, 65536, this::tickFluid);
gameprofilerfiller.pop();
}
Expand All @@ -1424,23 +1424,23 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
}

this.handlingTick = false;
@@ -885,7 +876,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -890,7 +881,6 @@ public class ServerLevel extends Level implements WorldGenLevel {

if (flag1 || this.emptyTime++ < 300) {
gameprofilerfiller.push("entities");
- this.timings.tickEntities.startTiming(); // Spigot
if (this.dragonFight != null && flag) {
gameprofilerfiller.push("dragonFight");
this.dragonFight.tick();
@@ -893,7 +883,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -898,7 +888,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}

org.spigotmc.ActivationRange.activateEntities(this); // Spigot
- this.timings.entityTick.startTiming(); // Spigot
this.entityTickList.forEach((entity) -> {
if (!entity.isRemoved()) {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
@@ -920,8 +909,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -925,8 +914,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
});
Expand All @@ -1449,23 +1449,23 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
gameprofilerfiller.pop();
this.tickBlockEntities();
}
@@ -1034,7 +1021,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1039,7 +1026,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
} // Paper

gameprofilerfiller.popPush("tickBlocks");
- timings.chunkTicksBlocks.startTiming(); // Paper
if (randomTickSpeed > 0) {
// Paper start - optimize random block ticking
LevelChunkSection[] sections = chunk.getSections();
@@ -1068,7 +1054,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1073,7 +1059,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// Paper end - optimise random block ticking

- timings.chunkTicksBlocks.stopTiming(); // Paper
gameprofilerfiller.pop();
}

@@ -1381,9 +1366,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1386,9 +1371,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
currentlyTickingEntity.lazySet(entity);
}
// Paper end - log detailed entity tick information
Expand All @@ -1475,7 +1475,7 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
/*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below
entity.tickCount++;
timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings
@@ -1392,11 +1375,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1397,11 +1380,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
return;
}*/ // Paper - comment out EAR 2
// Spigot end
Expand All @@ -1487,7 +1487,7 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler();

@@ -1406,12 +1385,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1411,12 +1390,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
gameprofilerfiller.incrementCounter("tickNonPassenger");
if (isActive) { // Paper - EAR 2
Expand All @@ -1500,7 +1500,7 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
Iterator iterator = entity.getPassengers().iterator();

while (iterator.hasNext()) {
@@ -1434,8 +1411,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1439,8 +1416,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
// Paper - EAR 2
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
Expand All @@ -1509,7 +1509,7 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -1464,8 +1439,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1469,8 +1444,6 @@ public class ServerLevel extends Level implements WorldGenLevel {

this.tickPassenger(passenger, entity2);
}
Expand All @@ -1518,7 +1518,7 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
}
} else {
passenger.stopRiding();
@@ -1485,26 +1458,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1490,26 +1463,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
}

Expand Down Expand Up @@ -1557,15 +1557,15 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890
}
// Paper end

@@ -1518,7 +1487,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1523,7 +1492,6 @@ public class ServerLevel extends Level implements WorldGenLevel {

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"));
}
@@ -1528,11 +1496,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1533,11 +1501,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}

Expand All @@ -1578,7 +1578,7 @@ index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890

} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 64255f7db85886421d5029766e8a6d1eadb94cff..abf864b0f4c20ee9c2b52456f931b58495f97fa2 100644
index 8b630fc4da8a7fda08c416e70c22463f04c3b6b5..a2eed9b45b2690d1af3b8f8dfb17c7b8ad3dd0cc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2398,7 +2398,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -2119,7 +2119,7 @@ index ec2396f0e5d62b10450eaa7239a8c5479638b3c3..995ae8f2f76bf0255d7eac4190c5b961
// Paper end

diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 59103744ac6beeb12719fdefcda54eeff498229e..7ff5a150802124f57bf605062cdf0a751a51270b 100644
index 2d31752478636bd21bbff5b430e5acb76b5d91c2..3fc29e9f261f5f8e2b87ef2e20f430e9918cddbe 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -34,7 +34,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0003-Leaves-Server-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ index 46954db7ecd35ac4018fdf476df7c8020d7ce6c8..044c51ebb058fc36074fd178929e3279
public PlayerAreaMap() {
super();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0c46a4aeafd03fbbfd590b0362d41bf2b1d5ca74..3c9b90b8d997790f3e4302eee41919780e561aff 100644
index b82f968a9e02c75c99c524a6f51a953dd9c88486..2599148de3f2ab8ebb974612c6c19da3ea6b48af 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -422,6 +422,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
Expand Down Expand Up @@ -62,7 +62,7 @@ index 0c46a4aeafd03fbbfd590b0362d41bf2b1d5ca74..3c9b90b8d997790f3e4302eee4191978

} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
@@ -4911,4 +4918,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4918,4 +4925,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
}
// Paper end
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0008-Fix-trading-with-the-void.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Fix trading with the void


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 6a07d6bd04dd3f4070a6db83c8a31890a5ab2197..c062786cff8a17eadcebf03443b012f8ac4f0632 100644
index 554c400802e0eda9eed41dcb478d8a4401614f1d..62867bc387f49398ebb5d608c4f1e4e562079bd7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2804,11 +2804,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2809,11 +2809,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
Expand Down
10 changes: 5 additions & 5 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ index f655e0ae4a287886d0291cd0089bad2000249d0f..2694f899241ad8ce06d3bcba78550af5
AdvancementProgress advancementprogress = this.getOrStartProgress(advancement);
boolean flag1 = advancementprogress.isDone();
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 931d77112ad02e712225efe7e0218fadde24400d..3e7bdcfd3d0ba845fef79c02d110d4a5df182216 100644
index bfc7ba2238e1abc7f0a0ead102c00f8daf4081a2..4be0ae32912cd2250647c4540cedc3e39568f265 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1422,6 +1422,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1417,6 +1417,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
// Paper end
} else if (this.seenBy.remove(player.connection)) {
this.serverEntity.removePairing(player);
+ // Leaves start - render bot
+ if (entity instanceof top.leavesmc.leaves.bot.ServerBot bot) {
Expand Down Expand Up @@ -171,7 +171,7 @@ index be05a52be037042c6158100e2ce880b8ed415d53..d9038d85f8a04381a92567acf1c8922d
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index abf864b0f4c20ee9c2b52456f931b58495f97fa2..ae7cf2b0a90044e93360fc914573c6a549cb6731 100644
index a2eed9b45b2690d1af3b8f8dfb17c7b8ad3dd0cc..0fe509e4e47cfb9d2a96704a35f7532865684db8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -298,7 +298,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -274,7 +274,7 @@ index 00f4ee320f8a8d019cb311cee78bb38445835952..52f6ef8702a1902df079b1ec34282b46
+ // Leaves end - fakeplayer support
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2134c810da69a8c4a2bddcb29c0534d7ad65e8aa..2bd6e02291b6ac6ff31e85f6721bb89b2efc704b 100644
index b3275fcd829223a671381705bbfa188f8a99d914..c1da1cb9d3a8aedec05a89a256934c2229e9bc09 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1420,7 +1420,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Move ThreadUnsafeRandom Initialization
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c062786cff8a17eadcebf03443b012f8ac4f0632..a7ea81fe330bf314ed3faf8951d4746b093171e5 100644
index 62867bc387f49398ebb5d608c4f1e4e562079bd7..ddbe5ece289235cf5b9a0e9d532ab9b8f1ff200c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -966,7 +966,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -971,7 +971,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// Paper start - optimise random block ticking
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ index d6089c0d0b076d232834619bc93bc64f0be57340..c4577d7dc27bb48c95794212de4abf2e
// Paper - optimise chunk tick iteration

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a7ea81fe330bf314ed3faf8951d4746b093171e5..9ef41e7c3c7f65bdd10018fc3bf6702fb7e03767 100644
index ddbe5ece289235cf5b9a0e9d532ab9b8f1ff200c..1ed4e8b5feb4cad478ac6472b386ccb9b610a7de 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -969,6 +969,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -974,6 +974,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// private final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); // Leaves - moved to super
// Paper end

Expand All @@ -39,7 +39,7 @@ index a7ea81fe330bf314ed3faf8951d4746b093171e5..9ef41e7c3c7f65bdd10018fc3bf6702f
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining();
@@ -979,7 +986,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -984,7 +991,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("thunder");
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0033-Remove-lambda-from-ticking-guard.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Remove lambda from ticking guard
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9ef41e7c3c7f65bdd10018fc3bf6702fb7e03767..90cb0953c2a0ce119a20180d095bc9c4bdf2f229 100644
index 1ed4e8b5feb4cad478ac6472b386ccb9b610a7de..fc2f0e767e079b9c7aba131e71f11eb8a8920be2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -903,7 +903,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -908,7 +908,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
}

gameprofilerfiller.push("tick");
Expand Down
Loading

0 comments on commit f27621f

Please sign in to comment.