mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-24 01:19:25 +00:00
Updated Upstream (Paper/Gale/Purpur)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@8fd3a67 [ci skip] Clean up book limits patch (#11297) PaperMC/Paper@dae906b Add getWorld method that uses adventure Key (#11199) PaperMC/Paper@ba1b016 Allow server administrators to disable book size checks (#10457) PaperMC/Paper@a8cb8e6 [ci skip] Fix JavaDocs for HeightMap#MOTION_BLOCKING_NO_LEAVES (#11291) PaperMC/Paper@e4b38b4 Fixup config parsing PaperMC/Paper@3271119 Fix SculkBloomEvent firing for block entity loading (#11306) Gale Changes: Dreeam-qwq/Gale@38ba923 Updated Upstream (Paper) Dreeam-qwq/Gale@7ebf026 Fix code style & Adjust sequence of `organizationDisplayName` and `projectDisplayName` in version fetcher Purpur Changes: PurpurMC/Purpur@3510a9e Updated Upstream (Paper) PurpurMC/Purpur@1d3cef7 Updated Upstream (Paper) PurpurMC/Purpur@c4a6f63 Updated Upstream (Paper) PurpurMC/Purpur@568a028 Updated Upstream (Paper)
This commit is contained in:
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur Server Changes
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: f5303959cdb3274a2672962faaa3889592ed5b31
|
||||
Commit: 568a028f8c33ad919f01c85a7fac5a9aced3d614
|
||||
|
||||
Patches below are removed in this patch:
|
||||
Pufferfish-Server-Changes.patch
|
||||
@@ -164,7 +164,7 @@ index f7241c5292f1c012404eea11256813fbc2c2df1a..fad407d0cec0605e303e93a79752435f
|
||||
ignored.add("goal_selector_1");
|
||||
ignored.add("goal_selector_2");
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
index 023016de1732f0b299428ec0544128cc17407333..9d003c2ae45a057c0274a34fe5012cf17d1a2681 100644
|
||||
index 00470a690b4b0fc8996a03ecd21af8163094184d..23609a71a993fc91271578ee0a541a9c6ec7354f 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
@@ -32,6 +32,7 @@ public record ServerBuildInfoImpl(
|
||||
@@ -1498,7 +1498,7 @@ index a720a05c47b2137a07515461960603cc5c939d16..b66fdb789fcb460d63fd81540112d655
|
||||
try {
|
||||
String channels = payload.toString(com.google.common.base.Charsets.UTF_8);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11732b011f 100644
|
||||
index 58893266a4ee8b4cc8cfc0e99872840ad2869eb6..7e719807c031ab5bf128e3f5523285c1ca5dfe11 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -337,6 +337,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1552,18 +1552,18 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1174,6 +1197,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
|
||||
double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
||||
@@ -1175,6 +1198,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
final int maxBookPageSize = pageMax.intValue();
|
||||
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
||||
long byteAllowed = maxBookPageSize;
|
||||
+ // Purpur start
|
||||
+ int slot = packet.slot();
|
||||
+ ItemStack itemstack = Inventory.isHotbarSlot(slot) || slot == Inventory.SLOT_OFFHAND ? this.player.getInventory().getItem(slot) : ItemStack.EMPTY;
|
||||
+ // Purpur end
|
||||
for (String testString : pageList) {
|
||||
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
for (final String page : pageList) {
|
||||
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
byteTotal += byteLength;
|
||||
@@ -1195,7 +1222,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1199,7 +1226,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
if (byteTotal > byteAllowed) {
|
||||
@@ -1573,7 +1573,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1220,10 +1248,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1224,10 +1252,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
stream.forEach(list::add);
|
||||
@@ -1590,7 +1590,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
};
|
||||
|
||||
this.filterTextPacket((List) list).thenAcceptAsync(consumer, this.server);
|
||||
@@ -1231,13 +1263,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1235,13 +1267,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
private void updateBookContents(List<FilteredText> pages, int slotId) {
|
||||
@@ -1610,7 +1610,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
|
||||
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));
|
||||
this.player.getInventory().setItem(slotId, CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
|
||||
@@ -1245,6 +1282,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1249,6 +1286,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
private void signBook(FilteredText title, List<FilteredText> pages, int slotId) {
|
||||
@@ -1622,7 +1622,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
ItemStack itemstack = this.player.getInventory().getItem(slotId);
|
||||
|
||||
if (itemstack.is(Items.WRITABLE_BOOK)) {
|
||||
@@ -1252,10 +1294,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1256,10 +1298,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
itemstack1.remove(DataComponents.WRITABLE_BOOK_CONTENT);
|
||||
List<Filterable<Component>> list1 = (List<Filterable<Component>>) (List) pages.stream().map((filteredtext1) -> { // CraftBukkit - decompile error
|
||||
@@ -1635,7 +1635,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
CraftEventFactory.handleEditBookEvent(this.player, slotId, itemstack, itemstack1); // CraftBukkit
|
||||
this.player.getInventory().setItem(slotId, itemstack); // CraftBukkit - event factory updates the hand book
|
||||
}
|
||||
@@ -1265,6 +1307,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1269,6 +1311,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(message.filteredOrEmpty()) : Filterable.from(message);
|
||||
}
|
||||
|
||||
@@ -1652,7 +1652,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
@Override
|
||||
public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@@ -1314,7 +1366,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1318,7 +1370,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@@ -1669,7 +1669,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||
} else {
|
||||
ServerLevel worldserver = this.player.serverLevel();
|
||||
@@ -1494,7 +1554,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1498,7 +1558,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
movedWrongly = true;
|
||||
if (event.getLogWarning())
|
||||
// Paper end
|
||||
@@ -1678,7 +1678,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
} // Paper
|
||||
}
|
||||
|
||||
@@ -1562,6 +1622,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1566,6 +1626,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -1687,7 +1687,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -1606,6 +1668,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1610,6 +1672,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.player.tryResetCurrentImpulseContext();
|
||||
}
|
||||
|
||||
@@ -1701,7 +1701,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
this.player.checkMovementStatistics(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5);
|
||||
this.lastGoodX = this.player.getX();
|
||||
this.lastGoodY = this.player.getY();
|
||||
@@ -1633,6 +1702,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1637,6 +1706,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1716,7 +1716,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
// Paper start - optimise out extra getCubes
|
||||
private boolean hasNewCollision(final ServerLevel world, final Entity entity, final AABB oldBox, final AABB newBox) {
|
||||
final List<AABB> collisionsBB = new java.util.ArrayList<>();
|
||||
@@ -2012,6 +2089,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2016,6 +2093,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
boolean cancelled;
|
||||
if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) {
|
||||
@@ -1724,7 +1724,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand);
|
||||
cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||
} else {
|
||||
@@ -2781,6 +2859,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2785,6 +2863,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
AABB axisalignedbb = entity.getBoundingBox();
|
||||
|
||||
if (this.player.canInteractWithEntity(axisalignedbb, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(1.0D))) { // Paper - configurable lenience value for interact range
|
||||
@@ -1732,7 +1732,7 @@ index 73fb88a1c52aef0bc151b7857d1225884e81e9ae..46242ef7c5607780f84046fe039efc11
|
||||
packet.dispatch(new ServerboundInteractPacket.Handler() {
|
||||
private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand);
|
||||
@@ -2794,6 +2873,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2798,6 +2877,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
@@ -16854,7 +16854,7 @@ index 9d93130f23addb18b97d7f5ec013faef17a74529..29d2fb87a65778926aea2cfc7a5b486c
|
||||
+ // Purpur end - OfflinePlayer API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 22c76d7301037617ff56da3aedd07a0b36aab290..d4fe9164831bb1e066926e3bdecf2c15ec44fa10 100644
|
||||
index ee08ee23bea25a2dd19518f84ec38fbbcda10f41..5d7280ad82c03b35ea6636d633ef411c220f9bb6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -415,6 +415,20 @@ public final class CraftServer implements Server {
|
||||
|
||||
Reference in New Issue
Block a user