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 12, 2024
1 parent 6c5cc79 commit b33c46c
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group=org.leavesmc.leaves
version=1.21.1-R0.1-SNAPSHOT
mcVersion=1.21.1
paperRef=6d7a438faddfbea99d6af7f99f99a480883cef8a
paperRef=57c75a4b67a8b3b3c607126130b7503658b5e98a
preVersion=false
updatingMinecraft=false
org.gradle.jvmargs=-Xmx2G
Expand Down
6 changes: 3 additions & 3 deletions patches/api/0005-Hide-irrelevant-compilation-warnings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Hide irrelevant compilation warnings


diff --git a/build.gradle.kts b/build.gradle.kts
index 540fe7e2c110e79c3742f229b3ed8c54b101d260..c070e3d308b14cc020475c2644955e7546ef6cef 100644
index ab84a1405acc1f0d5f267892243b82b8dab03e21..beee863333fa8ebb31cd83d6a1451b51c770bf2d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -130,6 +130,15 @@ val generateApiVersioningFile by tasks.registering {
@@ -131,6 +131,15 @@ val generateApiVersioningFile by tasks.registering {
}
}

Expand All @@ -24,7 +24,7 @@ index 540fe7e2c110e79c3742f229b3ed8c54b101d260..c070e3d308b14cc020475c2644955e75
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
@@ -188,6 +197,8 @@ tasks.withType<Javadoc> {
@@ -190,6 +199,8 @@ tasks.withType<Javadoc> {
into("build/docs/javadoc")
}
}
Expand Down
6 changes: 3 additions & 3 deletions patches/api/0006-SIMD-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] SIMD support


diff --git a/build.gradle.kts b/build.gradle.kts
index c070e3d308b14cc020475c2644955e7546ef6cef..286349a28b06eddebbf103def9bd33bcc224f090 100644
index beee863333fa8ebb31cd83d6a1451b51c770bf2d..1491188671ce741afbbc4006c03510a328e92dbd 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -136,6 +136,7 @@ tasks.withType<JavaCompile> {
@@ -137,6 +137,7 @@ tasks.withType<JavaCompile> {
compilerArgs.add("-Xlint:-module")
compilerArgs.add("-Xlint:-removal")
compilerArgs.add("-Xlint:-dep-ann")
+ compilerArgs.add("--add-modules=jdk.incubator.vector") // Leaves - SIMD support
}
// Leaves end - hide irrelevant compilation warnings

@@ -199,6 +200,7 @@ tasks.withType<Javadoc> {
@@ -201,6 +202,7 @@ tasks.withType<Javadoc> {
}

options.addStringOption("Xdoclint:none", "-quiet") // Leaves - hide irrelevant compilation warnings
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0008-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 adcd8161846b06fd1a7895750f98b629204a8406..30285b70f3fb6b63b41c052e86ff9a61594ea1ec 100644
index ef32a937e6faf1e8a5d6b1207986715bae5a246c..29343b0f5c5b91e66e13c2d8d5e1952762af8526 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4229,6 +4229,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4277,6 +4277,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
void setSendViewDistance(int viewDistance);
// Paper end - view distance api

Expand Down
14 changes: 7 additions & 7 deletions patches/server/0003-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ index dcb5651d1d9b10b40430fb2f713beedf68336704..68e445c21e0acbdf6bb74d50ddd32e0e
gameprofilerfiller.pop();
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 c96f3dcd365bc140b1f4680ef6bd770c80f8eda1..2c509f2c5e6e6824392f1f90dde524ad2c0fc2cc 100644
index f9abf63e12ea930275121b470e4e4906cff0fc12..14e9140c9a18906c249e8cef39988ed7f81738f7 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 @@ -1331,7 +1331,7 @@ index c96f3dcd365bc140b1f4680ef6bd770c80f8eda1..2c509f2c5e6e6824392f1f90dde524ad
// Paper start - add close param
if (close) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c13922d2fb1c15f895b14d4cb6d5379b59ea1ef8..9bb0dde8c3e6b3d17b3798a408658a8ffefd831f 100644
index 5e2c4969e77c669acbb4a13c07033cb267c3d586..79237a490d7572eae95384f32e0ebc1a0a005c00 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 @@ -1341,15 +1341,15 @@ index c13922d2fb1c15f895b14d4cb6d5379b59ea1ef8..9bb0dde8c3e6b3d17b3798a408658a8f
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -1199,7 +1198,6 @@ public abstract class PlayerList {
@@ -1200,7 +1199,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) {
@@ -1210,7 +1208,6 @@ public abstract class PlayerList {
@@ -1211,7 +1209,6 @@ public abstract class PlayerList {
}
// Paper end - Incremental chunk and player saving
}
Expand Down Expand Up @@ -1386,7 +1386,7 @@ index cb61462d4691a055a4b25f7b953609d8a154fdfe..b2b97c4c61ea5b6f7ec199fabbd1bd1c
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 30f4f1254fc295442d72d50479e8af635f2fe983..a0f6d383b430c8e320f041fe2221943830b021eb 100644
index 2aa6374cd4a96efd85899be8cd3172a8257bfe6b..03e424afddbdcdcb6ea88ab9ee4e0bbcc05f983d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -157,7 +157,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
Expand Down Expand Up @@ -1473,7 +1473,7 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..1f3e0392f88a7cb3fb5c0767cdd1b4bc
}

diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e2a0487089eb5a7bdc1433e4c75f69d8e9f9d5f9..33a5137b1057fe6203e10f9e7e0cb7c4251466e9 100644
index 507671476c3d2d92a2fdb05be24443af27d26dcf..73b1b5b8b3723f068e45874eb251f08ef0a93017 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -173,7 +173,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
Expand Down Expand Up @@ -1740,7 +1740,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..e9798517b9211c50a20ea5c69603aab3
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index f78744b6d6075f584d9a88612661854f3f04aed1..6cfecd797d3cd7f9ff84755eea6dea5888ecd4f9 100644
index cdeb340cad6d650300bfb5e62a121449094e3ec1..1d2a8521ff45e212cd545953df730f278a05412c 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -200,7 +200,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0004-Leaves-Server-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Server Utils


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index bc45c74987974b4828201e06fc8b1f3fbc0af8b4..7ea72dcc310a363246eb7d77c49ed25a7f14d2fa 100644
index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..b5283b7a59c76e75ba9a822f315ba0d813df8cfb 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -429,6 +429,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Expand All @@ -16,15 +16,15 @@ index bc45c74987974b4828201e06fc8b1f3fbc0af8b4..7ea72dcc310a363246eb7d77c49ed25a

public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
@@ -2556,6 +2557,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -2558,6 +2559,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
nbttagcompound.putBoolean("Paper.FreezeLock", true);
}
// Paper end
+ nbttagcompound.put("Leaves.Data", leavesData); // Leaves - leaves ex data
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2703,6 +2705,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -2705,6 +2707,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
}
// Paper end
Expand All @@ -36,7 +36,7 @@ index bc45c74987974b4828201e06fc8b1f3fbc0af8b4..7ea72dcc310a363246eb7d77c49ed25a

} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
@@ -4990,4 +4997,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4992,4 +4999,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
}
// Paper end - Expose entity id counter
Expand Down
22 changes: 11 additions & 11 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ index c396580a9cfd86ff261bed439bb4662ae88010b5..c2263ef7fb67db7c01bac7aecf218ee8
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e6a1942d44c589d6815824646b5517a5938385c3..e53e5011af49da4222f4c38e31f1500158c5a5a7 100644
index d0190f633e99e2a5b5dc130def10c562ffc4e52e..31a55145bf2ed0e5a23fd07d1c14e93572d5ef5a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -123,6 +123,8 @@ import org.bukkit.event.player.PlayerRespawnEvent.RespawnReason;
Expand Down Expand Up @@ -333,7 +333,7 @@ index e6a1942d44c589d6815824646b5517a5938385c3..e53e5011af49da4222f4c38e31f15001

return astring;
}
@@ -1168,7 +1194,13 @@ public abstract class PlayerList {
@@ -1169,7 +1195,13 @@ public abstract class PlayerList {

@Nullable
public ServerPlayer getPlayerByName(String name) {
Expand All @@ -348,7 +348,7 @@ index e6a1942d44c589d6815824646b5517a5938385c3..e53e5011af49da4222f4c38e31f15001
}

public void broadcast(@Nullable net.minecraft.world.entity.player.Player player, double x, double y, double z, double distance, ResourceKey<Level> worldKey, Packet<?> packet) {
@@ -1508,7 +1540,13 @@ public abstract class PlayerList {
@@ -1509,7 +1541,13 @@ public abstract class PlayerList {

@Nullable
public ServerPlayer getPlayer(UUID uuid) {
Expand All @@ -364,10 +364,10 @@ index e6a1942d44c589d6815824646b5517a5938385c3..e53e5011af49da4222f4c38e31f15001

public boolean canBypassPlayerLimit(GameProfile profile) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7ea72dcc310a363246eb7d77c49ed25a7f14d2fa..03fdcd134179d41c84ad38fbdf108acb36fee01e 100644
index b5283b7a59c76e75ba9a822f315ba0d813df8cfb..35eafbfa719c9ac3e235df0728650e1ed1c23fcd 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1455,7 +1455,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1457,7 +1457,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return offsetFactor;
}

Expand Down Expand Up @@ -544,10 +544,10 @@ index 275704db5b984584504749437e8ecdc60d4aa871..51365bf3a487725c79a8a3adae0821ce
+ // Leaves end - Bot API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 38b046da5acac8633db8618a2957187d291f5e73..ea49d32a728fafe1dbd8b6c4f60b552550e78cd2 100644
index 33e4818ba5a90d78d69baad9f6b1be1b1382e9f3..db2c1139f8471d12d6b80aab630b1426a084e47c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -210,7 +210,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -245,7 +245,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public int getPlayerCount() {
Expand All @@ -556,7 +556,7 @@ index 38b046da5acac8633db8618a2957187d291f5e73..ea49d32a728fafe1dbd8b6c4f60b5525
}

@Override
@@ -1254,9 +1254,9 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1295,9 +1295,9 @@ public class CraftWorld extends CraftRegionAccessor implements World {

@Override
public List<Player> getPlayers() {
Expand All @@ -568,7 +568,7 @@ index 38b046da5acac8633db8618a2957187d291f5e73..ea49d32a728fafe1dbd8b6c4f60b5525
HumanEntity bukkitEntity = human.getBukkitEntity();

if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) {
@@ -1941,7 +1941,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1982,7 +1982,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public void playSound(final net.kyori.adventure.sound.Sound sound) {
org.spigotmc.AsyncCatcher.catchOp("play sound"); // Paper
final long seed = sound.seed().orElseGet(this.world.getRandom()::nextLong);
Expand All @@ -577,7 +577,7 @@ index 38b046da5acac8633db8618a2957187d291f5e73..ea49d32a728fafe1dbd8b6c4f60b5525
player.connection.send(io.papermc.paper.adventure.PaperAdventure.asSoundPacket(sound, player.getX(), player.getY(), player.getZ(), seed, null));
}
}
@@ -1957,7 +1957,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1998,7 +1998,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
org.spigotmc.AsyncCatcher.catchOp("play sound"); // Paper
final long seed = sound.seed().orElseGet(this.getHandle().getRandom()::nextLong);
if (emitter == net.kyori.adventure.sound.Sound.Emitter.self()) {
Expand All @@ -586,7 +586,7 @@ index 38b046da5acac8633db8618a2957187d291f5e73..ea49d32a728fafe1dbd8b6c4f60b5525
player.connection.send(io.papermc.paper.adventure.PaperAdventure.asSoundPacket(sound, player, seed, null));
}
} else if (emitter instanceof CraftEntity craftEntity) {
@@ -2178,7 +2178,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2219,7 +2219,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType());
}
this.getHandle().sendParticles(
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0018-No-chat-sign.patch
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ index 7bcadf3b793fd4c5d58e0e3e01a373b2e1a7a628..427dede2feca3350c45c4e70fe8efcbb
if (packet == null || this.processedDisconnect) { // Spigot
return;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e53e5011af49da4222f4c38e31f1500158c5a5a7..b690a584c156c5d1a7b8818e73a8e616fb373ce5 100644
index 31a55145bf2ed0e5a23fd07d1c14e93572d5ef5a..5221ab490fcbc11434c1209f654e5731fa15487e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1455,7 +1455,7 @@ public abstract class PlayerList {
@@ -1456,7 +1456,7 @@ public abstract class PlayerList {
}

public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0034-BBOR-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] BBOR Protocol


diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b690a584c156c5d1a7b8818e73a8e616fb373ce5..2fc4d42619611a2724aff9bc114c9118212ad974 100644
index 5221ab490fcbc11434c1209f654e5731fa15487e..7ba6579cfe925ef40940cce29ebc0abb6458f13d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1595,6 +1595,7 @@ public abstract class PlayerList {
@@ -1596,6 +1596,7 @@ public abstract class PlayerList {
entityplayer.getRecipeBook().sendInitialRecipeBook(entityplayer);
}

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


diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 8bcb3ceab7089224d93b73ab5dbafb0b77c4c317..0ba56ea6ca96cd7adb47dad756c8ed2972a2d587 100644
index 69323d0889a0c9cd243441c42c8f454457421cfe..e62a27431bb2872bdf7dcc34366249dbfe8add17 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1288,6 +1288,7 @@ public abstract class PlayerList {
@@ -1289,6 +1289,7 @@ public abstract class PlayerList {
player.connection.send(new ClientboundInitializeBorderPacket(worldborder));
player.connection.send(new ClientboundSetTimePacket(world.getGameTime(), world.getDayTime(), world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)));
player.connection.send(new ClientboundSetDefaultSpawnPositionPacket(world.getSharedSpawnPos(), world.getSharedSpawnAngle()));
Expand Down
Loading

0 comments on commit b33c46c

Please sign in to comment.