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 Dec 28, 2023
1 parent 434ea12 commit cb31cda
Show file tree
Hide file tree
Showing 38 changed files with 96 additions and 101 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=1e7dd72f15a1d13b43792367193547c656a16ab6
paperRef=8221b085f91a6ce65701b02fbb6a29e54bcc6023
preVersion=true
updatingMinecraft=true
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Hide irrelevant compilation warnings


diff --git a/build.gradle.kts b/build.gradle.kts
index 3e3ea0e4e4ceb3283ad2b99957e3795d66a9a716..757dd80342ace11a019a70c91201c5b43f35acb3 100644
index bf01892c248b988531d21d9fb0f74d0adf2205ac..e2e11d760f497713f100f9b564f2fc898993c57d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -109,6 +109,15 @@ val generateApiVersioningFile by tasks.registering {
Expand Down
2 changes: 1 addition & 1 deletion patches/api/0006-SIMD-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] SIMD support


diff --git a/build.gradle.kts b/build.gradle.kts
index 757dd80342ace11a019a70c91201c5b43f35acb3..30c391a6c884efce9d10a60f896be6f264cc8eef 100644
index e2e11d760f497713f100f9b564f2fc898993c57d..fa4c21e6b0f7f87d153db8211c1fd10f2bc22011 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -115,6 +115,7 @@ tasks.withType<JavaCompile> {
Expand Down
2 changes: 1 addition & 1 deletion patches/api/0007-Leaves-API-publish.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Leaves API publish


diff --git a/build.gradle.kts b/build.gradle.kts
index 30c391a6c884efce9d10a60f896be6f264cc8eef..837dfdc3a069cc2c5ba7bf8ef40d7c7699571138 100644
index fa4c21e6b0f7f87d153db8211c1fd10f2bc22011..11c29efa3798341ace33ad35fac95065d72e8f21 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -212,3 +212,14 @@ tasks.check {
Expand Down
8 changes: 4 additions & 4 deletions patches/api/0009-Force-peaceful-mode-switch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ 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 567a36a4887da8994c9170e2885aa8cc357efa0c..420ff2b7edd6c9596b661bece882a26a42373a77 100644
index d3081d4445af73c2c7b23c5fc60861f184ac808e..10c1bbd104bd0be9dc705971c67cf71cedd42f26 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4243,6 +4243,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Set<FeatureFlag> getFeatureFlags();
@@ -4238,6 +4238,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
void setSendViewDistance(int viewDistance);
// Paper end - view distance api

+ // Leaves start - unsupported settings
+ public void setPeacefulModeSwitchTick(int tick);
Expand Down
18 changes: 8 additions & 10 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,25 @@ Subject: [PATCH] Build changes


diff --git a/build.gradle.kts b/build.gradle.kts
index b12b5a1e82a5ebf47135a3863a390a45a9d8d8ec..257520120913ab39d57ac0e79ae6381fbda0011b 100644
index 58da26ad2f128ba0b66f86820f60853f4be352f0..914c6520398045ad30537d7493a79a55ad4ddee2 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -26,9 +26,13 @@ repositories {
}
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
val alsoShade: Configuration by configurations.creating

dependencies {
- extraRuntime(platform("net.kyori:adventure-bom:4.15.0-SNAPSHOT"))
- implementation(project(":paper-api"))
- implementation(project(":paper-mojangapi"))
+ extraRuntime(platform("net.kyori:adventure-bom:4.15.0-SNAPSHOT"))
+ implementation(project(":leaves-api")) // Leaves
+ // Leaves start
+ // Leaves start
+ implementation(project(":leaves-api"))
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
+ exclude("io.papermc.paper", "paper-api")
+ }
+ // Leaves end
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -72,19 +76,29 @@ dependencies {
@@ -58,19 +62,29 @@ dependencies {
}

val craftbukkitPackageVersion = "1_20_R3" // Paper
Expand Down Expand Up @@ -57,7 +55,7 @@ index b12b5a1e82a5ebf47135a3863a390a45a9d8d8ec..257520120913ab39d57ac0e79ae6381f
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -168,7 +182,7 @@ fun TaskContainer.registerRunTask(
@@ -154,7 +168,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
Expand Down Expand Up @@ -186,7 +184,7 @@ index 58536aabf607015939a1326f80207c0a06eed8ff..5a07dad83602425b35f480cf8a31ed32
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index e011cfcdda2e0a609d4158b0454bdf046b04c9d9..a8b92ff8975730fb8ac752aa21aa28f9cae26dd9 100644
index 142d2c48239d4ebe3896218536656d116cd24d7c..9e4002e82dba3a09a3a8346aebba34f30f902dff 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -264,7 +264,7 @@ import javax.annotation.Nullable; // Paper
Expand Down
31 changes: 14 additions & 17 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
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 caa73632aee15583c6b6ed12a668c8f49b794708..d9a33968fa0f1aa5def297f34ba1dbf229ee7c32 100644
index d9cd497bc1b654030ff1a597f038b6a881df9f6b..931d77112ad02e712225efe7e0218fadde24400d 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 @@ -1184,7 +1184,7 @@ index caa73632aee15583c6b6ed12a668c8f49b794708..d9a33968fa0f1aa5def297f34ba1dbf2
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LightChunkGetter;
import net.minecraft.world.level.chunk.ProtoChunk;
@@ -95,15 +82,13 @@ import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
@@ -95,12 +82,11 @@ import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
import net.minecraft.world.level.levelgen.RandomState;
import net.minecraft.world.level.levelgen.blending.BlendingData;
Expand All @@ -1196,12 +1196,9 @@ index caa73632aee15583c6b6ed12a668c8f49b794708..d9a33968fa0f1aa5def297f34ba1dbf2
-import org.apache.commons.lang3.mutable.MutableBoolean;
+import org.apache.commons.lang3.mutable.MutableObject;
import org.slf4j.Logger;
import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
-import org.bukkit.entity.Player;
// CraftBukkit end

public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
@@ -548,15 +533,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit start
@@ -547,15 +533,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void tick(BooleanSupplier shouldKeepTicking) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();

Expand All @@ -1217,7 +1214,7 @@ index caa73632aee15583c6b6ed12a668c8f49b794708..d9a33968fa0f1aa5def297f34ba1dbf2
}

gameprofilerfiller.pop();
@@ -1156,24 +1137,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1155,24 +1137,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

// Paper start - optimised tracker
private final void processTrackQueue() {
Expand Down Expand Up @@ -1247,15 +1244,15 @@ index caa73632aee15583c6b6ed12a668c8f49b794708..d9a33968fa0f1aa5def297f34ba1dbf2
}
}
// Paper end - optimised tracker
@@ -1188,7 +1159,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1187,7 +1159,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
- level.timings.tracker1.startTiming(); // Paper

ChunkMap.TrackedEntity playerchunkmap_entitytracker;

@@ -1213,17 +1183,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1212,17 +1183,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
Expand Down Expand Up @@ -1383,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 b78a9628a88f2a495ef6de74446a02a14d41a1f6..bfd670484fc58f8b6edd8d6d1065fe808bc777e4 100644
index 6041f1f5151f26d389f946d70f16e1de76db496b..6a07d6bd04dd3f4070a6db83c8a31890a5ab2197 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 @@ -1615,7 +1612,7 @@ index 30ccbab1586a656e0ae41d7406525fb02d9e025b..0046043408e5ec5737857d833f0a43f9
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a35638a92479b90afa89cf201fc45b49c9e767f3..cd4e8facc10796fbb68141994b7fed5ca379f1a4 100644
index e98a455b6bca9d094d0da323bddd7b3f2c07bb23..192eeaffd6d51baca149c7b9eaccf53246cb3af5 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,6 +1,5 @@
Expand All @@ -1625,15 +1622,15 @@ index a35638a92479b90afa89cf201fc45b49c9e767f3..cd4e8facc10796fbb68141994b7fed5c
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -1230,7 +1229,6 @@ public abstract class PlayerList {
@@ -1236,7 +1235,6 @@ public abstract class PlayerList {

public void saveAll(int interval) {
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
- MinecraftTimings.savePlayers.startTiming(); // Paper
int numSaved = 0;
long now = MinecraftServer.currentTick;
for (int i = 0; i < this.players.size(); ++i) {
@@ -1241,7 +1239,6 @@ public abstract class PlayerList {
@@ -1247,7 +1245,6 @@ public abstract class PlayerList {
}
// Paper end
}
Expand Down Expand Up @@ -1670,7 +1667,7 @@ index 940b8d0b89d7e55c938aefbe80ee71b0db3dacb8..068a22bd9ee64ed153b7eedbfad9252a
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 45b1a182acf6b2aef40b714d31ca125d8f74619a..ae1ffb1bc4535f393f40be60571446f66c7ebe16 100644
index bc908b75cb99536df658281ae7f8b4eeedbbedc9..9e2d9c4b3d15f03e7babc3468b60fe9075a65a3a 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 @@ -1757,7 +1754,7 @@ index fcdb9bde8e1605e30dde3e580491522d4b62cdc0..b68c69a7ab71926ecf478d8daa5ec5ac

}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0b56e5f7f18fc4286992af22d402205b771165a3..d1f19c87d6112e7ab9afa5c2e6d6ec529b351d24 100644
index 8848eeda7a89d445e370626182f9bb4710e5edd4..c495dc410c17593bf8785c69eb23a41fc9d3084a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,10 +1,7 @@
Expand Down Expand Up @@ -1846,7 +1843,7 @@ index 0b56e5f7f18fc4286992af22d402205b771165a3..d1f19c87d6112e7ab9afa5c2e6d6ec52
// Spigot start
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
boolean flag = this.tickRateManager().runsNormally();
@@ -1308,9 +1293,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1302,9 +1287,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
this.blockEntityTickers.removeAll(toRemove);

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0005-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ index 8c942c21dc3aebcd2fc89b5bde92c73a95bdc3e3..c3d1d7b525a6f2b708144ebe9bc28dfa

private GossipType(String key, int multiplier, int maxReputation, int decay, int shareDecrement) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index d1f19c87d6112e7ab9afa5c2e6d6ec529b351d24..1c4a75b556be384807cbc26e7ee8b580412eebf3 100644
index c495dc410c17593bf8785c69eb23a41fc9d3084a..c51d22285a253d4220ee967504ab9eef1403edbe 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -169,6 +169,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
Expand All @@ -68,7 +68,7 @@ index d1f19c87d6112e7ab9afa5c2e6d6ec529b351d24..1c4a75b556be384807cbc26e7ee8b580
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a8b92ff8975730fb8ac752aa21aa28f9cae26dd9..89f4f6d1a9822569b267a90ee091b8d219b73abe 100644
index 9e4002e82dba3a09a3a8346aebba34f30f902dff..f18225bff50f87e4dab89951a9f09947639b6a27 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1037,6 +1037,7 @@ public final class CraftServer implements Server {
Expand Down
10 changes: 5 additions & 5 deletions patches/server/0006-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ index fe547d04abece42bdc0d0897e2d3f2e6c190c455..eb376bf0cb055fb3ddb05e5a0ff8602a
((Runnable) this.tickables.get(i)).run();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 4a712f5fc4f0b4a4434ae808c989113bee8d8634..cfecb021de2f32fbe7d49332c5df763cd7cf0529 100644
index d28d0ef6105ddeb562ddf31ae9088739856941fc..9b73df7fbd869ce51bd01a8d8b46d00fe7896126 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -115,6 +115,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -116,6 +116,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
+ top.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(player, packet.payload()); // Leaves - protocol
// Paper start - handle brand payload packet
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload brandPayload) {
this.player.clientBrandName = brandPayload.brand();
@@ -132,6 +133,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -133,6 +134,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
String channels = payload.toString(com.google.common.base.Charsets.UTF_8);
for (String channel : channels.split("\0")) {
this.getCraftPlayer().addChannel(channel);
Expand All @@ -56,7 +56,7 @@ index 4a712f5fc4f0b4a4434ae808c989113bee8d8634..cfecb021de2f32fbe7d49332c5df763c
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index cd4e8facc10796fbb68141994b7fed5ca379f1a4..937c4aefc5f24cbfe3f9c9fce3cfb2f40db5675b 100644
index 192eeaffd6d51baca149c7b9eaccf53246cb3af5..00f4ee320f8a8d019cb311cee78bb38445835952 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -346,6 +346,8 @@ public abstract class PlayerList {
Expand All @@ -77,7 +77,7 @@ index cd4e8facc10796fbb68141994b7fed5ca379f1a4..937c4aefc5f24cbfe3f9c9fce3cfb2f4
ServerLevel worldserver = entityplayer.serverLevel();

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 89f4f6d1a9822569b267a90ee091b8d219b73abe..72e8f8cc4db8b75e3c93470911a0509eef2d9a1f 100644
index f18225bff50f87e4dab89951a9f09947639b6a27..dc4ce7bbde058560c077fe2004da64e3113ccace 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -463,6 +463,7 @@ public final class CraftServer implements Server {
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0008-Fix-trading-with-the-void.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 bfd670484fc58f8b6edd8d6d1065fe808bc777e4..5a864a2ac7549a01663b221624bee919947d2696 100644
index 6a07d6bd04dd3f4070a6db83c8a31890a5ab2197..c062786cff8a17eadcebf03443b012f8ac4f0632 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 {
Expand Down
Loading

0 comments on commit cb31cda

Please sign in to comment.