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 Oct 23, 2023
1 parent ba2a4c3 commit 08f91ff
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2
packageVersion=1_20_R2
org.gradle.jvmargs=-Xmx2G
paperRef=e57af7d01e509c747520cc1037169029256289bf
paperRef=90fe0d58a5945c31f2c1b138799f64f2fe3475d8
preVersion=false
4 changes: 2 additions & 2 deletions patches/api/0009-Force-peaceful-mode-switch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch


diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 8d861f5522a33669f67b3e41dfbc5234637114b4..54fb966467cf2aa13bbc39b6360517ff6541980d 100644
index 91eb95b04094394e8dc1e3a3343efc63690c87e4..1240a16b45e037f137e14200e2edab780705576d 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4018,6 +4018,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4080,6 +4080,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Set<FeatureFlag> getFeatureFlags();

Expand Down
20 changes: 10 additions & 10 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ index 81e3d3dbc74e238c76ead4a0b6efaa2ada3cc49d..6e42c5b72598aaff4a4d3c4ebb9c7bd2
// 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 0c2617574e21037d94ac56ad08b490f9bca5c5af..8bb72e567633dff5d5748b221771d16d25bf8e39 100644
index 28c6ec04750daca3d77a0cee2b9f17f2508662cc..8486ed5cfb6268cfb9f0b7ce544aef10e459bbc7 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 @@ -1620,7 +1620,7 @@ index 17610196db7a1c6feb2cf74a02479a8691aa323f..47bf04c95163149063d1828a02d0d86d

} 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 8bd243a8d5a4be54f907af2b02e96ea833cee62f..6c704b32091b2d7db742e1a68404ba6db1f9154f 100644
index 34fcdeb0f4039f1fc6c4c8c593cc615560af1ba2..d52aae55bde8f3c831481580d43c73aa781a22b9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2388,7 +2388,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -1709,7 +1709,7 @@ index 73871f456a85bda1e51f54986d0e61fb629822e8..7dbb55953ce9fb489c8a6706bc8a64fd
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 77a1c7dfbaccc2e74da5c78ce4dfcd1717a7ac65..7b395528b8e0853c6b3e040526edad07e54c02ba 100644
index b95f88d5e5b4785ee063695fd81935636a0588d1..d54b91c8227c2e89e56d56ea3260d27ff93ff3e7 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
Expand Down Expand Up @@ -1953,34 +1953,34 @@ index 370a25d2deb54f10a35ee24d9e7e92fbfde60edf..ca8a5ae1df1761588233068f9c8288d0
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 4abec88caab4116cfa318f7b66c6b1a8346a7401..8bb33965605ee1fdd5d37662f147dcc4a3fc4877 100644
index 3e9758fa40bf93fe3d315cc66389193bd57bc393..61db2201e88a0db06a9d4c332178a55953c5a851 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -790,7 +790,6 @@ public class LevelChunk extends ChunkAccess {
@@ -786,7 +786,6 @@ public class LevelChunk extends ChunkAccess {
this.chunkHolder.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());
@@ -810,7 +809,6 @@ public class LevelChunk extends ChunkAccess {
@@ -806,7 +805,6 @@ public class LevelChunk extends ChunkAccess {
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
- } // Paper
}
}
}
@@ -1168,7 +1166,6 @@ public class LevelChunk extends ChunkAccess {
@@ -1164,7 +1162,6 @@ public class LevelChunk extends ChunkAccess {
ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler();

gameprofilerfiller.push(this::getType);
- this.blockEntity.tickTimer.startTiming(); // Spigot
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);

if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1189,9 +1186,6 @@ public class LevelChunk extends ChunkAccess {
@@ -1185,9 +1182,6 @@ public class LevelChunk extends ChunkAccess {
LevelChunk.this.removeBlockEntity(this.getPos());
// Paper end
// Spigot start
Expand Down Expand Up @@ -2149,10 +2149,10 @@ index 7a2f46579352870cfbb32c343d7c68919758ffe3..c583ad62d70ab073a1dd95b11b5bd2bf
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 96f6e0554baf5915dd1f5b93f3bcfe7a13393c29..ed2783e633e28e891778213a1b8248c7f3252ea6 100644
index 6b31f88803041c75023a2c99bdc1efd902f0205c..3ec205299955d088c05f5f9f7625ba8a8ebdad90 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -209,7 +209,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -214,7 +214,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
// Paper start
@Override
public void reportTimings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ index 950b9d4ef4a9cb0e3f2ff083d84f1ebb2c642ebd..45cac95d44509ec8fcc46177a47c3073
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 244cf1e0b1f767a41f0a863e77b58c66ee3ff71f..897d7f9abacfea2aae2f6e067065c55333a0b391 100644
index aac170cb0b3b83acc425875b14301a37811a6d1d..7e201e056d3d3d7370776f7e1f3f8146998945e0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -948,6 +948,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
Expand All @@ -49,7 +49,7 @@ index 244cf1e0b1f767a41f0a863e77b58c66ee3ff71f..897d7f9abacfea2aae2f6e067065c553

if (this.isRainingAt(blockposition)) {
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 8bb33965605ee1fdd5d37662f147dcc4a3fc4877..7d9d09b0f84acb3a4692c58e5b6876a2e1875ba7 100644
index 61db2201e88a0db06a9d4c332178a55953c5a851..17696dfdb3ad1d8c63ff1d1fa0c5eb6bf2e2ae42 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -86,6 +86,18 @@ public class LevelChunk extends ChunkAccess {
Expand All @@ -71,7 +71,7 @@ index 8bb33965605ee1fdd5d37662f147dcc4a3fc4877..7d9d09b0f84acb3a4692c58e5b6876a2
public LevelChunk(Level world, ChunkPos pos) {
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
}
@@ -113,6 +125,12 @@ public class LevelChunk extends ChunkAccess {
@@ -109,6 +121,12 @@ public class LevelChunk extends ChunkAccess {
this.postLoad = entityLoader;
this.blockTicks = blockTickScheduler;
this.fluidTicks = fluidTickScheduler;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0042-BBOR-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ index 59b2124ea6d9b489488ace4fcd4529420a8eca99..7f835ccc97daa0d5ebfebc0a5781233a

public boolean isAllowCheatsForAllPlayers() {
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 7d9d09b0f84acb3a4692c58e5b6876a2e1875ba7..6f005cc4b90d2610c8a2ce246f29156132e68267 100644
index 17696dfdb3ad1d8c63ff1d1fa0c5eb6bf2e2ae42..bb47170917ed8918a9781b71ae60fd74e2d1c586 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -936,6 +936,11 @@ public class LevelChunk extends ChunkAccess {
@@ -932,6 +932,11 @@ public class LevelChunk extends ChunkAccess {

public void setLoaded(boolean loadedToWorld) {
this.loaded = loadedToWorld;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0077-No-block-update-command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ index 4697df75fdee2023c41260bed211e3e3d90d2b9b..8c9bc54a7007b0c5ae1c8576aeca5d05

world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
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 6f005cc4b90d2610c8a2ce246f29156132e68267..00989bd8ba9953353a213d57c5ff81f7d2f07773 100644
index bb47170917ed8918a9781b71ae60fd74e2d1c586..7add47837626b7cbc170b1e0b1d0e445e7b51fa5 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -485,7 +485,7 @@ public class LevelChunk extends ChunkAccess {
@@ -481,7 +481,7 @@ public class LevelChunk extends ChunkAccess {
} else {
// CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled.
if (!this.level.isClientSide && doPlace && (!this.level.captureBlockStates || block instanceof net.minecraft.world.level.block.BaseEntityBlock)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize world generation chunk and block access
This patch is Powered by Gale(https://github.com/GaleMC/Gale)

diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 877498729c66de9aa6a27c9148f7494d7895615c..28386146cada17442d3b3f1517512b95ddcc6a9f 100644
index 50ed7cfe1ecef6d075ba484804827cec83ba2bf2..933569818700d19ed1e18b6550584aa3f432dd31 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -83,6 +83,10 @@ public class WorldGenRegion implements WorldGenLevel {
Expand All @@ -31,8 +31,8 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..28386146cada17442d3b3f1517512b95
+ // Leaves end - optimize world generation chunk and block access
}

public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) {
@@ -122,8 +131,29 @@ public class WorldGenRegion implements WorldGenLevel {
// Paper start - starlight
@@ -143,8 +152,29 @@ public class WorldGenRegion implements WorldGenLevel {

@Override
public ChunkAccess getChunk(int chunkX, int chunkZ) {
Expand Down Expand Up @@ -63,7 +63,7 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..28386146cada17442d3b3f1517512b95

@Nullable
@Override
@@ -182,7 +212,21 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -203,7 +233,21 @@ public class WorldGenRegion implements WorldGenLevel {

@Override
public BlockState getBlockState(BlockPos pos) {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0109-Force-peaceful-mode-switch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ index 7eec9dc8237ff04c53b573c3cc87e6cdbfdda7ed..2aafb872578d266f2826e5bddebc9b4a
boolean spawnThisTick = true;
int limit = enumcreaturetype.getMaxInstancesPerChunk();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0e670de77a7f9926e295e1dd63d909bed1a959ca..ad07b41b8b2a595464e8dfe65de8dadca15cc6db 100644
index 4879b585df9a6488922511a8e6603964bd13abcf..9dcb7677b995f4a11e674a46958a43a7abe6559f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2299,6 +2299,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2308,6 +2308,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return CraftFeatureFlag.getFromNMS(this.getHandle().enabledFeatures()).stream().map(FeatureFlag.class::cast).collect(Collectors.toUnmodifiableSet());
}

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0121-Servux-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Servux Protocol


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 00989bd8ba9953353a213d57c5ff81f7d2f07773..914fb5deb5dbdab1cd8899810e08205270d78df2 100644
index 7add47837626b7cbc170b1e0b1d0e445e7b51fa5..6ecd3feb095385afcd69f80392e6282530b3931d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -939,6 +939,7 @@ public class LevelChunk extends ChunkAccess {
@@ -935,6 +935,7 @@ public class LevelChunk extends ChunkAccess {
// Leaves start - bbor
if (loaded) {
top.leavesmc.leaves.protocol.BBORProtocol.onChunkLoaded(this);
Expand Down

0 comments on commit 08f91ff

Please sign in to comment.