You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1214,13 +1218,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
28
+
@@ -1209,13 +1213,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
29
29
}
30
30
31
31
private void updateBookContents(List<FilteredText> pages, int slotId) {
@@ -45,7 +45,7 @@ index 07d8b2536c2c95b91467edd2ece8674eeaa6ad2f..68c4e3d9a3f928a52357e25820ac73ad
45
45
46
46
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));
47
47
this.player.getInventory().setItem(slotId, CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
48
-
@@ -1228,6 +1237,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
48
+
@@ -1223,6 +1232,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
49
49
}
50
50
51
51
private void signBook(FilteredText title, List<FilteredText> pages, int slotId) {
@@ -57,7 +57,7 @@ index 07d8b2536c2c95b91467edd2ece8674eeaa6ad2f..68c4e3d9a3f928a52357e25820ac73ad
@@ -2752,6 +2752,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
11
+
@@ -2747,6 +2747,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
12
12
AABB axisalignedbb = entity.getBoundingBox();
13
13
14
14
if (this.player.canInteractWithEntity(axisalignedbb, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(1.0D))) { // Paper - configurable lenience value for interact range
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
21
-
if (byteLength > 256 * 4) {
22
-
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
23
-
+ org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent event = new org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), itemstack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
24
-
this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
25
-
return;
26
-
}
27
-
@@ -1179,6 +1184,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
21
+
byteTotal += byteLength;
22
+
@@ -1173,7 +1177,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
23
+
}
28
24
29
25
if (byteTotal > byteAllowed) {
30
-
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
26
+
- ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
27
+
+ ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send too large of a book. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
31
28
+ org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent event = new org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), itemstack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
32
29
this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
@@ -721,6 +721,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -16,7 +16,7 @@ index c0c854296bc920cf79d710ad4896a895ff45c058..ed8825f1bcd8e182078f16dd717cf232
16
16
this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
17
17
return;
18
18
}
19
-
@@ -1327,7 +1328,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
19
+
@@ -1321,7 +1322,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
20
20
@Override
21
21
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
0 commit comments