|
134 | 134 | return; |
135 | 135 | } |
136 | 136 |
|
137 | | -@@ -817,7 +_,7 @@ |
| 137 | +@@ -824,7 +_,7 @@ |
138 | 138 | } |
139 | 139 |
|
140 | 140 | // This needs to be on main |
|
143 | 143 | } else if (!completions.isEmpty()) { |
144 | 144 | final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packet.getCommand(), stringReader.getTotalLength()); |
145 | 145 | final com.mojang.brigadier.suggestion.SuggestionsBuilder builder = builder0.createOffset(builder0.getInput().lastIndexOf(' ') + 1); |
146 | | -@@ -1200,11 +_,11 @@ |
| 146 | +@@ -1207,11 +_,11 @@ |
147 | 147 | } |
148 | 148 | // Paper end - Book size limits |
149 | 149 | // CraftBukkit start |
|
157 | 157 | // CraftBukkit end |
158 | 158 | int slot = packet.slot(); |
159 | 159 | if (Inventory.isHotbarSlot(slot) || slot == 40) { |
160 | | -@@ -1215,7 +_,22 @@ |
| 160 | +@@ -1222,7 +_,22 @@ |
161 | 161 | Consumer<List<FilteredText>> consumer = optional.isPresent() |
162 | 162 | ? texts -> this.signBook(texts.get(0), texts.subList(1, texts.size()), slot) |
163 | 163 | : texts -> this.updateBookContents(texts, slot); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 |
|
184 | | -@@ -1341,9 +_,10 @@ |
| 184 | +@@ -1348,9 +_,10 @@ |
185 | 185 | int i = this.receivedMovePacketCount - this.knownMovePacketCount; |
186 | 186 |
|
187 | 187 | // CraftBukkit start - handle custom speeds and skipped ticks |
|
194 | 194 |
|
195 | 195 | if (i > Math.max(this.allowedPlayerTicks, 5)) { |
196 | 196 | LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getName().getString(), i); |
197 | | -@@ -1532,7 +_,7 @@ |
| 197 | +@@ -1539,7 +_,7 @@ |
198 | 198 |
|
199 | 199 | // If the event is cancelled we move the player back to their old location. |
200 | 200 | if (event.isCancelled()) { |
|
203 | 203 | return; |
204 | 204 | } |
205 | 205 |
|
206 | | -@@ -1540,7 +_,7 @@ |
| 206 | +@@ -1547,7 +_,7 @@ |
207 | 207 | // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors. |
208 | 208 | // We only do this if the Event was not cancelled. |
209 | 209 | if (!oldTo.equals(event.getTo()) && !event.isCancelled()) { |
|
212 | 212 | return; |
213 | 213 | } |
214 | 214 |
|
215 | | -@@ -1799,9 +_,9 @@ |
| 215 | +@@ -1806,9 +_,9 @@ |
216 | 216 | if (!this.player.isSpectator()) { |
217 | 217 | // limit how quickly items can be dropped |
218 | 218 | // If the ticks aren't the same then the count starts from 0 and we update the lastDropTick. |
|
224 | 224 | } else { |
225 | 225 | // Else we increment the drop count and check the amount. |
226 | 226 | this.dropCount++; |
227 | | -@@ -1829,7 +_,7 @@ |
| 227 | +@@ -1836,7 +_,7 @@ |
228 | 228 | case ABORT_DESTROY_BLOCK: |
229 | 229 | case STOP_DESTROY_BLOCK: |
230 | 230 | // Paper start - Don't allow digging into unloaded chunks |
|
233 | 233 | this.player.connection.ackBlockChangesUpTo(packet.getSequence()); |
234 | 234 | return; |
235 | 235 | } |
236 | | -@@ -1911,7 +_,7 @@ |
| 236 | +@@ -1918,7 +_,7 @@ |
237 | 237 | } |
238 | 238 | // Paper end - improve distance check |
239 | 239 | BlockPos blockPos = hitResult.getBlockPos(); |
|
242 | 242 | Vec3 vec3 = location.subtract(Vec3.atCenterOf(blockPos)); |
243 | 243 | double d = 1.0000001; |
244 | 244 | if (Math.abs(vec3.x()) < 1.0000001 && Math.abs(vec3.y()) < 1.0000001 && Math.abs(vec3.z()) < 1.0000001) { |
245 | | -@@ -2032,7 +_,7 @@ |
| 245 | +@@ -2039,7 +_,7 @@ |
246 | 246 | for (ServerLevel serverLevel : this.server.getAllLevels()) { |
247 | 247 | Entity entity = packet.getEntity(serverLevel); |
248 | 248 | if (entity != null) { |
|
251 | 251 | return; |
252 | 252 | } |
253 | 253 | } |
254 | | -@@ -2064,7 +_,7 @@ |
| 254 | +@@ -2071,7 +_,7 @@ |
255 | 255 | } |
256 | 256 | // CraftBukkit end |
257 | 257 | LOGGER.info("{} lost connection: {}", this.player.getName().getString(), details.reason().getString()); |
|
260 | 260 | super.onDisconnect(details, quitMessage); // Paper - Fix kick event leave message not being sent |
261 | 261 | } |
262 | 262 |
|
263 | | -@@ -2073,6 +_,8 @@ |
| 263 | +@@ -2080,6 +_,8 @@ |
264 | 264 | this.removePlayerFromWorld(null); |
265 | 265 | } |
266 | 266 |
|
|
269 | 269 | private void removePlayerFromWorld(@Nullable net.kyori.adventure.text.Component quitMessage) { |
270 | 270 | // Paper end - Fix kick event leave message not being sent |
271 | 271 | this.chatMessageChain.close(); |
272 | | -@@ -2086,6 +_,8 @@ |
| 272 | +@@ -2093,6 +_,8 @@ |
273 | 273 | this.player.disconnect(); |
274 | 274 | // Paper start - Adventure |
275 | 275 | quitMessage = quitMessage == null ? this.server.getPlayerList().remove(this.player) : this.server.getPlayerList().remove(this.player, quitMessage); // Paper - pass in quitMessage to fix kick message not being used |
|
278 | 278 | if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) { |
279 | 279 | this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); |
280 | 280 | // Paper end - Adventure |
281 | | -@@ -2324,7 +_,7 @@ |
| 281 | +@@ -2331,7 +_,7 @@ |
282 | 282 | this.player.resetLastActionTime(); |
283 | 283 | // CraftBukkit start |
284 | 284 | if (sync) { |
|
287 | 287 | } else { |
288 | 288 | handler.run(); |
289 | 289 | } |
290 | | -@@ -2379,7 +_,7 @@ |
| 290 | +@@ -2386,7 +_,7 @@ |
291 | 291 | String originalFormat = event.getFormat(), originalMessage = event.getMessage(); |
292 | 292 | this.cserver.getPluginManager().callEvent(event); |
293 | 293 |
|
|
296 | 296 | // Evil plugins still listening to deprecated event |
297 | 297 | final PlayerChatEvent queueEvent = new PlayerChatEvent(player, event.getMessage(), event.getFormat(), event.getRecipients()); |
298 | 298 | queueEvent.setCancelled(event.isCancelled()); |
299 | | -@@ -2476,6 +_,7 @@ |
| 299 | +@@ -2483,6 +_,7 @@ |
300 | 300 | if (rawMessage.isEmpty()) { |
301 | 301 | LOGGER.warn("{} tried to send an empty message", this.player.getScoreboardName()); |
302 | 302 | } else if (this.getCraftPlayer().isConversing()) { |
303 | 303 | + if (true) throw new UnsupportedOperationException(); // Folia - region threading |
304 | 304 | final String conversationInput = rawMessage; |
305 | 305 | this.server.processQueue.add(() -> ServerGamePacketListenerImpl.this.getCraftPlayer().acceptConversationInput(conversationInput)); |
306 | 306 | } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check |
307 | | -@@ -2701,8 +_,25 @@ |
| 307 | +@@ -2708,8 +_,25 @@ |
308 | 308 | // Spigot end |
309 | 309 |
|
310 | 310 | public void switchToConfig() { |
|
331 | 331 | this.send(ClientboundStartConfigurationPacket.INSTANCE); |
332 | 332 | this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND); |
333 | 333 | } |
334 | | -@@ -2727,7 +_,7 @@ |
| 334 | +@@ -2734,7 +_,7 @@ |
335 | 335 | // Spigot end |
336 | 336 | this.player.resetLastActionTime(); |
337 | 337 | this.player.setShiftKeyDown(packet.isUsingSecondaryAction()); |
|
340 | 340 | if (!serverLevel.getWorldBorder().isWithinBounds(target.blockPosition())) { |
341 | 341 | return; |
342 | 342 | } |
343 | | -@@ -2859,6 +_,12 @@ |
| 343 | +@@ -2866,6 +_,12 @@ |
344 | 344 | switch (action) { |
345 | 345 | case PERFORM_RESPAWN: |
346 | 346 | if (this.player.wonGame) { |
|
353 | 353 | this.player.wonGame = false; |
354 | 354 | this.player = this.server.getPlayerList().respawn(this.player, true, Entity.RemovalReason.CHANGED_DIMENSION, RespawnReason.END_PORTAL); // CraftBukkit |
355 | 355 | this.resetPosition(); |
356 | | -@@ -2868,6 +_,17 @@ |
| 356 | +@@ -2875,6 +_,17 @@ |
357 | 357 | return; |
358 | 358 | } |
359 | 359 |
|
|
371 | 371 | this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit |
372 | 372 | this.resetPosition(); |
373 | 373 | if (this.server.isHardcore()) { |
374 | | -@@ -3441,7 +_,21 @@ |
| 374 | +@@ -3448,7 +_,21 @@ |
375 | 375 | } |
376 | 376 | List<String> list = Stream.of(lines).map(ChatFormatting::stripFormatting).collect(Collectors.toList()); |
377 | 377 | // Paper end - Limit client sign length |
|
0 commit comments