9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Updated Upstream (Paper/Gale)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@76753219 Allow Server#getDefaultGameMode before worlds are initialized (#12491)
PaperMC/Paper@c2bb144f Properly save level data async (#12530)
PaperMC/Paper@e2ca4773 Remove simplify remote item matching option for now
PaperMC/Paper@af71568b Update mache

Gale Changes:
Dreeam-qwq/Gale@00ce862b Updated Upstream (Paper)
This commit is contained in:
Dreeam
2025-05-13 20:47:03 -04:00
parent 8f09a8cc43
commit c823590b66
10 changed files with 40 additions and 61 deletions

View File

@@ -2,7 +2,7 @@ group=cn.dreeam.leaf
mcVersion=1.21.4
version=1.21.4-R0.1-SNAPSHOT
galeCommit=e6d2efb8f8dc092ac55647c745440ea3d60f8797
galeCommit=00ce862b14008ecbe816606c0843b95d6b227b0d
org.gradle.configuration-cache=true
org.gradle.caching=true

View File

@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Thu, 8 May 2025 00:05:01 +0200
Subject: [PATCH] Save world async properly
Removed since Paper 1.21.4/5, added on Paper side
P.S from Tai: I've been using this fix for weeks in my own server but didn't had balls to push it as thought it may cause issues but, it's merged in paper 1.21.5 now.
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index ba1dd51e7187a80e8438e46383257c22f5382130..6cb0c14cb7aa243bbee6ca9ba57da4cc6eafdfd8 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -1439,7 +1439,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
if (doFull) {
- this.saveLevelData(true);
+ this.saveLevelData(false);
}
// chunk autosave is already called by the ChunkSystem during unload processing (ChunkMap#processUnloads)
// Copied from save()

View File

@@ -7,7 +7,7 @@
+val leafMavenPublicUrl = "https://maven.nostal.ink/repository/maven-snapshots/" // Leaf - project setup - Add publish repo
dependencies {
mache("io.papermc:mache:1.21.4+build.7")
mache("io.papermc:mache:1.21.4+build.8")
- paperclip("io.papermc:paperclip:3.0.3")
+ paperclip("cn.dreeam:quantumleaper:1.0.0-SNAPSHOT") // Leaf - project setup - Use own paperclip fork
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

View File

@@ -1139,10 +1139,10 @@ index 351f42842b780d053cd2e5bad9ae299449141b10..054d2c2b93c43faeeaf56f482eb7b943
+ // Purpur end - Llama API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cc4b2061ae9cbd5a30b297be477cde703203b3f5..3ba69aa0ac247ecb3406664af606126b30c56ff9 100644
index 9f195c498a12de07e1581ab13ffe60e77f22a22c..941a92e3b55018d256102ac900f76fae37f8db07 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -589,10 +589,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -588,10 +588,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setPlayerListName(String name) {
@@ -1159,7 +1159,7 @@ index cc4b2061ae9cbd5a30b297be477cde703203b3f5..3ba69aa0ac247ecb3406664af606126b
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) {
@@ -1431,6 +1436,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1430,6 +1435,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start - Teleport passenger API
// Don't allow teleporting between worlds while keeping passengers
if (ignorePassengers && entity.isVehicle() && location.getWorld() != this.getWorld()) {
@@ -1167,7 +1167,7 @@ index cc4b2061ae9cbd5a30b297be477cde703203b3f5..3ba69aa0ac247ecb3406664af606126b
return false;
}
@@ -1452,6 +1458,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1451,6 +1457,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API
@@ -1175,7 +1175,7 @@ index cc4b2061ae9cbd5a30b297be477cde703203b3f5..3ba69aa0ac247ecb3406664af606126b
return false;
}
@@ -2750,6 +2757,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2749,6 +2756,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().getAbilities().walkingSpeed * 2f;
}
@@ -1204,9 +1204,9 @@ index cc4b2061ae9cbd5a30b297be477cde703203b3f5..3ba69aa0ac247ecb3406664af606126b
private void validateSpeed(float value) {
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
}
@@ -3619,4 +3648,75 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setSimplifyContainerDesyncCheck(final boolean simplifyContainerDesyncCheck) {
this.simplifyContainerDesyncCheck = simplifyContainerDesyncCheck;
@@ -3602,4 +3631,75 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setDeathScreenScore(final int score) {
getHandle().setScore(score);
}
+
+ // Purpur start - Purpur client support

View File

@@ -7,10 +7,10 @@ Original license: MIT
Original project: https://github.com/KeYiMC/KeYi
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3ba69aa0ac247ecb3406664af606126b30c56ff9..e0ab197ef364b7a95e1f5beade5f55c2744b8edc 100644
index 941a92e3b55018d256102ac900f76fae37f8db07..bb37bd20ec32943932c1a1068a536e17c728e365 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3719,4 +3719,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3702,4 +3702,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message)));
}
// Purpur end - Death screen API

View File

@@ -9,10 +9,10 @@ Original project: https://github.com/Cryptite/Slice
Co-authored-by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e0ab197ef364b7a95e1f5beade5f55c2744b8edc..2f027c504859f7ef41ef243bbc16535c6595ec28 100644
index bb37bd20ec32943932c1a1068a536e17c728e365..9d733dd366d54b0780746a6235d81dc17607cad2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1381,6 +1381,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1380,6 +1380,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end - Teleportation API
}

View File

@@ -74,10 +74,10 @@ index 8635cd772c5c2ae0ba326812ff2a1a179285a86f..cc024874fbde9678bdddfdca7c250808
if (entity instanceof EnderDragonPart complexPart) {
if (complexPart.parentMob instanceof EnderDragon) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2f027c504859f7ef41ef243bbc16535c6595ec28..abc762829bc0447936ab9e06eabcb42419578585 100644
index 9d733dd366d54b0780746a6235d81dc17607cad2..7bd58d683ca2534d36510590e0895dce7c46551a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2281,7 +2281,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2280,7 +2280,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public boolean canSee(Player player) {

View File

@@ -16,7 +16,7 @@ This seems stupid, but it does seem that it improves the performance a bit, and
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index abc762829bc0447936ab9e06eabcb42419578585..8ea9b654eb6098477d51ac24ff5be1a33e3055ae 100644
index 7bd58d683ca2534d36510590e0895dce7c46551a..8e8630db9f74e5952142dba14ec58917c5745287 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -210,7 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -28,7 +28,7 @@ index abc762829bc0447936ab9e06eabcb42419578585..8ea9b654eb6098477d51ac24ff5be1a3
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
@@ -2286,9 +2286,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2285,9 +2285,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public boolean canSee(org.bukkit.entity.Entity entity) {

View File

@@ -1,11 +0,0 @@
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -185,6 +_,8 @@
public CompressionFormat compressionFormat = CompressionFormat.ZLIB;
@Comment("This setting controls if equipment should be updated when handling certain player actions.")
public boolean updateEquipmentOnPlayerActions = true;
+ @Comment("Only checks an item's amount and type instead of its full data during inventory desync checks.")
+ public boolean simplifyRemoteItemMatching = false;
public enum CompressionFormat {
GZIP,

View File

@@ -1,32 +0,0 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -221,6 +_,7 @@
private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
+ private boolean simplifyContainerDesyncCheck = GlobalConfiguration.get().unsupportedSettings.simplifyRemoteItemMatching;
private long lastSaveTime; // Paper - getLastPlayed replacement API
public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -3601,5 +_,21 @@
@Override
public void setDeathScreenScore(final int score) {
getHandle().setScore(score);
+ }
+
+ /**
+ * Returns whether container desync checks should skip the full item comparison of remote carried and changed slots
+ * and should instead only check their type and amount.
+ * <p>
+ * This is useful if the client is not able to produce the same item stack (or as of 1.21.5, its data hashes) as the server.
+ *
+ * @return whether to simplify container desync checks
+ */
+ public boolean simplifyContainerDesyncCheck() {
+ return simplifyContainerDesyncCheck;
+ }
+
+ public void setSimplifyContainerDesyncCheck(final boolean simplifyContainerDesyncCheck) {
+ this.simplifyContainerDesyncCheck = simplifyContainerDesyncCheck;
}
}