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

Backport some fixes from Paper 1.21.6

This commit is contained in:
Dreeam
2025-06-27 19:11:50 +08:00
parent a54018c585
commit cd090909dc
76 changed files with 124 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ subprojects {
}
repositories {
mavenCentral()
maven("https://maven.aliyun.com/repository/public")
maven(paperMavenPublicUrl)
maven(leafMavenPublicUrl)
maven("https://repo.bsdevelopment.org/releases/") // Leaf - Leaf config - ConfigurationMaster-API

View File

@@ -184,7 +184,7 @@
}
+// Leaf start - Bump Dependencies
+repositories {
+ mavenCentral()
+ maven("https://maven.aliyun.com/repository/public")
+}
+// Leaf end - Bump Dependencies
tasks.check {

View File

@@ -396,7 +396,7 @@ index 54910c2e1d6e6bb556e536fda060bd09402e04e8..72e871b8c7fee9b5cbd567e03baee80e
// Gale start - Pufferfish - SIMD support
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
index 6d5a15122079f2d1568ceb7086db21ad454f58e6..9dd6205e1cdd2124ab9d91f0a1e344eb6aa1fb2e 100644
index ecab2befa1f2f993ea4b4d088529745c2a37b73d..fc86e900e41305287a6cc6d766184c6e28d6189b 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
@@ -175,7 +175,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -694,7 +694,7 @@ index d507544efafe74ecaffd6a063eff152d349ec76a..bc955da0dff79262dace84d255f27b32
// Paper end - Inventory close reason
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 411ccee65f5658347839ca7d0fffeedc1f2814ce..f581fe86fea41bb5ff8f93e3422548ae7693a868 100644
index 75393b9cdd564e55ba173828c2f7b40498e8ecd7..96202ffdb73cb9d8c63351b4538c64645b91d21c 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -252,6 +252,8 @@ public abstract class PlayerList {

View File

@@ -27,7 +27,7 @@ index 3a78e7512772fd3f7cf8f221e3a72474def14bea..ba52af914e9e231caa0ac50562e9a692
public static final int GENERATED_TICKET_LEVEL = ChunkHolderManager.FULL_LOADED_TICKET_LEVEL;
public static final int LOADED_TICKET_LEVEL = ChunkTaskScheduler.getTicketLevel(ChunkStatus.EMPTY);
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index a1249d66c3693374b0f57c83302d05a7cbc2a306..2ea112ed64d5dc7c5eb365e7a518cf0e8dd4927f 100644
index 96202ffdb73cb9d8c63351b4538c64645b91d21c..65857e4799186b7166fb0023694dc2749a492546 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -434,6 +434,13 @@ public abstract class PlayerList {

View File

@@ -59,7 +59,7 @@ index 18f0d486c478087f404d8bb6cd840079e2c8d239..1a6f1c5f4cf13ee50bc8445845cbb973
final byte[] data = discardedPayload.data();
try {
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 08d956368ced372d5a5e03b74a7fff4c9dc43283..978f9c5c54278d3d2bbb51461ab4ae6fcdd14d26 100644
index 65857e4799186b7166fb0023694dc2749a492546..1c1f24902575233109ea4122d68e1bb0bc0ace40 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -687,6 +687,7 @@ public abstract class PlayerList {

View File

@@ -100,7 +100,7 @@ index 4535858701b2bb232b9d2feb2af6551526232ddc..e65c62dbe4c1560ae153e4c4344e9194
- // Paper end - detailed watchdog information
}
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
index 9286312e11b98e4873f1ca13cf210feadcd6a2d7..014fb76ad0e57048d036659bd89e628fd81a0190 100644
index 3f3450e79f768f9c9fa4f2c0fe485b7179419680..f16760c8817d0220f0a44ed620859ba910bf63a9 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
@@ -622,8 +622,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon

View File

@@ -0,0 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 20 Jun 2025 16:02:24 -0400
Subject: [PATCH] Paper: Improve Fix MC-44654
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
https://github.com/PaperMC/Paper/commit/4b3f967e49f069ca94535f1ef5c2695cc8eadc4a
This more properly implement spigot's fix for teleportation area effect clouds,
now however supporting many other entity types specified in this bug report.
Currently, this is not an issue for (all) hanging blocks since they have a fix identical to this inside of setPos.
Note however the client does not nicely support moving these entities anyways.
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 5fda5eadd37ec52ca6470d4aeb18a20c192811be..8ef27db6cefdf63ee87b0fb3cc019803ed056b0f 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4957,6 +4957,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
this.levelCallback.onMove();
+
+ // Paper start - Fix MC-44654Add commentMore actions
+ if (this.getType().updateInterval() == Integer.MAX_VALUE) {
+ this.hasImpulse = true;
+ }
+ // Paper end - Fix MC-44654
}
// Paper start - Block invalid positions and bounding box; don't allow desync of pos and AABB
// hanging has its own special logic
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
index d92045528d1a63799322418d86fab0bc580b7a99..8e8cf73082478b991f929beef678dcf9be70ac8a 100644
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
@@ -216,7 +216,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
.fireImmune()
.sized(6.0F, 0.5F)
.clientTrackingRange(10)
- .updateInterval(10) // CraftBukkit - SPIGOT-3729: track area effect clouds
+ .updateInterval(Integer.MAX_VALUE)
);
public static final EntityType<Armadillo> ARMADILLO = register(
"armadillo", EntityType.Builder.of(Armadillo::new, MobCategory.CREATURE).sized(0.7F, 0.65F).eyeHeight(0.26F).clientTrackingRange(10)

View File

@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 20 Jun 2025 18:22:37 -0400
Subject: [PATCH] Paper: Cleanup Primed TNT Fix
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
https://github.com/PaperMC/Paper/commit/6a51c44ec28830094de58528fd8107c4be5cefe0
This option should probably be removed as its a descendant of an option that allows "old tnt cannon" behavior before ~1.9
But this improves the fix so properly update the velocity/position rather than the questionable way it was doing it before.
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
index 8aedc3ca463745fe32cac977208b23dc0b8e73b6..2b12316a7e8f26a7d09e3de1da57166b02a08a8a 100644
--- a/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
@@ -135,25 +135,8 @@ public class PrimedTnt extends Entity implements TraceableEntity {
}
// Paper start - Option to prevent TNT from moving in water
if (!this.isRemoved() && this.wasTouchingWater && this.level().paperConfig().fixes.preventTntFromMovingInWater) {
- /*
- * Author: Jedediah Smith <jedediah@silencegreys.com>
- */
- // Send position and velocity updates to nearby players on every tick while the TNT is in water.
- // This does pretty well at keeping their clients in sync with the server.
- net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel) this.level()).getChunkSource().chunkMap.entityMap.get(this.getId());
- if (ete != null) {
- net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this);
- net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket.teleport(this.getId(), net.minecraft.world.entity.PositionMoveRotation.of(this), java.util.Set.of(), this.onGround);
-
- // Leaf start - Multithreaded tracker
- for (var viewer : ete.seenBy()) {
- if ((viewer.getPlayer().getX() - this.getX()) * (viewer.getPlayer().getY() - this.getY()) * (viewer.getPlayer().getZ() - this.getZ()) < 16 * 16) {
- viewer.send(velocityPacket);
- viewer.send(positionPacket);
- }
- }
- // Leaf end - Multithreaded tracker
- }
+ this.hurtMarked = true; // Paper - Cleanup Primed TNT Fix
+ this.hasImpulse = true; // Paper - Cleanup Primed TNT Fix
}
// Paper end - Option to prevent TNT from moving in water
}

View File

@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 20 Jun 2025 19:22:27 -0400
Subject: [PATCH] Paper: Fix Raids - illager ominus banner pickup mechanic
broken
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
https://github.com/PaperMC/Paper/commit/839c6a184586c00a97c9a1892aa7384e33d8984f
This technically fixes the improperly updated patch, and also no longer checks canPickUpLoot.
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
index 76ebbab40f5bac6d5f588410d3c5e6716cbe0679..70460f52910f0a123225699f1ede3f96c910d920 100644
--- a/net/minecraft/world/entity/raid/Raider.java
+++ b/net/minecraft/world/entity/raid/Raider.java
@@ -400,7 +400,7 @@ public abstract class Raider extends PatrollingMonster {
}
private boolean cannotPickUpBanner() {
- if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING, this.mob.level().purpurConfig.pillagerMobGriefingOverride) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing override to everything affected
+ if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING, this.mob.level().purpurConfig.pillagerMobGriefingOverride)) return true; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing override to everything affected // Paper - Fix Raids - illager ominus banner pickup mechanic broken
if (!this.mob.hasActiveRaid()) {
return true;
} else if (this.mob.getCurrentRaid().isOver()) {