Commit Graph

155 Commits

Author SHA1 Message Date
Nassim Jahnke
cb47e01823 Remove more dead code, fix pre-existing desync when cancelling and closing container 2025-07-11 22:24:20 +02:00
Nassim Jahnke
a939945148 Fixup sendAllDataToRemote calls
Reduces unnecessary item copies by a lot
2025-07-11 17:43:05 +02:00
Jake Potrebic
b4466ec981 Dialog API (#12671) 2025-07-06 20:49:43 +02:00
Owen
0cadaefc09 Fix quitmessage nullability issues (#12783) 2025-07-01 18:44:17 -04:00
Nassim Jahnke
3fec37a9c1 Move the double call into the dispatch method
At some point later,
2025-07-01 21:44:24 +02:00
Nassim Jahnke
c3be00f0ec Always call plugin message dispatch on PlayerConnection 2025-07-01 21:09:44 +02:00
Owen
6ea679eb07 Allow listening to plugin messages during configuration phase (#12775) 2025-07-01 15:40:50 +02:00
Owen
7f60924390 Configuration API (#12301)
This implements a solution that preemptively exits the tick loop if we have already marked the connection as disconnecting. This avoids changing the result of Connection#isConnected in order to avoid other possibly unintentional changes. Fundamentally it should be investigated if closing the connection async is really still needed.

This also additionally removes the login disconnecting logic for server stopping, as this was also a possible issue in the config stage but also shouldn't be an issue as connections are closed on server stop very early.

Additionally, do not check for isConnecting() on VERIFYING, as that seemed to be an old diff originally trying to resolve this code, however isConnected is not updated at this point so it pretty much was useless.
2025-06-30 11:49:15 +02:00
Pedro
aa6cd74c03 Remove unnecesary item check for ServerboundPlayerActionPacket RELEASE_USE_ITEM (#12668) 2025-06-25 22:09:11 +02:00
Kezz
bee287927c Adventure 4.23.0 (#12690) 2025-06-25 21:16:18 +02:00
Spottedleaf
46b4b0b8d5 Improve keepalive ping system
Send more keepalives, record all transactions within the last minute.
We send more keepalives so that the latency calculation is more
accurate. Since we send more keepalives, we track all pending
keepalives in case multiple end up in flight.

Additionally, replace the latency calculation with a true
average over the last 5 seconds of keepalive transactions.
2025-06-24 04:23:08 -07:00
Spottedleaf
d0e808f44c Move player to correct position in vehicle move packet handler
We add the change to guarantee that the player position moves
in-sync with the vehicle's. As a result, it should be teleporting
the player using the new position of the vehicle rather than the
old.
2025-06-24 02:09:39 -07:00
Bjarne Koll
a24f9b204c 1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2025-06-17 15:45:25 +02:00
Md5Lukas
3efaf477c4 Add API for client-side signs (#11903) 2025-05-24 21:16:23 +02:00
David
825685f82f Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425)
Extensions of the existing PlayerPickItemEvent that allow more fine grained access to relevant context, like the picked block or the entity.
2025-05-02 22:14:27 +02:00
Warrior
1e930763d2 Fix ipv6 loopback addresses being able to get connection throttled (#12155) 2025-04-30 11:50:18 -04:00
Gero
3e3b42cdf5 Update player chat session sync (#12382) 2025-04-26 23:26:20 +02:00
SpigotRCE
a211ac2ec5 Remove unused warning (#12478) 2025-04-25 10:46:06 +02:00
Pedro Aguiar
df429932ca Fix floating warning log when the kick event is canceled (#12374) 2025-04-22 11:44:55 +02:00
Nassim Jahnke
f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00
Nassim Jahnke
9b1798d643 Simplify custom payload handling (#12347) 2025-03-27 14:22:38 +01:00
Tamion
515e12ca2d Check if BUNDLE_CONTENTS is present in InventoryClickEvent (#12321) 2025-03-24 00:38:25 +01:00
Shane Freeder
2aad131e74 Add config option for command spam whitelist 2025-03-23 18:31:39 +00:00
Tamion
102c8bbc54 Add config for updating equipment on player actions (#12275) 2025-03-12 11:09:27 +01:00
Spottedleaf
1a7288aa05 Adjust unloaded chunk check for block digging 2025-03-09 11:11:02 -07:00
0x22
743346a5da Force update attributes
See https://github.com/PaperMC/Paper/pull/12241/
2025-03-09 11:11:02 -07:00
Warrior
7afae7f465 Add client tick end event (#12199) 2025-03-09 13:14:44 -04:00
Lulu13022002
7bee99714a Cleanup damage source a bit (#12106) 2025-02-16 20:14:00 +01:00
EnZaXD
fb5b173c6a Add PlayerClientLoadedWorldEvent (#11940) 2025-01-25 21:47:08 +01:00
Tamion
19ddbeff9e Fix InventoryAction wrong for Bundles (#11902) 2025-01-11 19:50:24 +01:00
Shane Freeder
c9a904ed17 Fix keepalive logic resetting counter
This would of actually arised in the client being kicked due to sending
bad keepalive packets due to the erronious extra sending of keepalives too
2024-12-26 15:19:56 +00:00
Lulu13022002
3bfdf6a07a fix flying too long check 2024-12-21 19:27:59 +01:00
Nassim Jahnke
e0593e9286 More diff/changed variable name cleanup 2024-12-21 12:15:25 +01:00
Nassim Jahnke
1dc6ad1df0 Fix vehicle movement check 2024-12-21 00:16:55 +01:00
Lulu13022002
051ab9117a fix more diff 2024-12-20 23:39:43 +01:00
Lulu13022002
2213ce5bbc fix enderpearl across portals 2024-12-20 21:22:58 +01:00
Bjarne Koll
fd1b6b1ae9 Readd configurable auth server down kick message 2024-12-20 03:07:59 +01:00
Nassim Jahnke
a438cc45f6 Small diff cleanup 2024-12-19 15:55:01 +01:00
Lulu13022002
6126012369 readd beacon effect cause 2024-12-18 19:29:39 +01:00
Jake Potrebic
acd43900f5 remove more imports and cleanup 2024-12-15 12:51:34 -08:00
Lulu13022002
cb84eaf87a some fixes 2024-12-14 18:22:52 +01:00
Lulu13022002
bfcb0e71c9 server/network 2024-12-14 17:05:42 +01:00
Nassim Jahnke
45ddf764d9 Move patches to unapplied 2024-12-12 12:30:31 +01:00
Owen1212055
d300c94ec2 Properly resend entities
This resolves some issues which caused entities to not be resent correctly.
Entities that are interacted with need to be resent to the client, so we resend all the entity
data to the player whilst making sure not to clear dirty entries from the tracker. This makes
sure that values will be correctly updated to other players.

This also adds utilities to aid in further preventing entity desyncs.

This also also fixes the bug causing cancelling PlayerInteractEvent to cause items to continue
to be used despite being cancelled on the server.

For example, items being consumed but never finishing, shields being put up, etc.
The underlying issue of this is that the client modifies their synced data values,
and so we have to (forcibly) resend them in order for the client to reset their using item state.

See: https://github.com/PaperMC/Paper/pull/1896

== AT ==
public net.minecraft.server.level.ChunkMap$TrackedEntity serverEntity
2022-12-07 17:25:19 -05:00
Bjarne Koll
66e1ce8504 Correct update cursor
Spigot uses a no longer valid ClientboundContainerSetSlotPacket with the
slot -1, which would update the carried stack in versions <=1.21.1 but
now leads to an IOOB.
1.21.2 instead introduced the ClientboundSetCursorItemPacket, which this
patch uses instead.
2024-11-01 14:58:57 +01:00
Spottedleaf
7ec2cf09a3 Add proper async player disconnections
Blocking can cause performance problems
2024-10-16 06:41:32 -07:00
Nassim Jahnke
c056e2319d Fix PlayerCommandPreprocessEvent on signed commands 2024-09-21 22:01:52 +02:00
Gegy
be5187c2da Fix: synchronise sending chat to client with updating message signature cache
In the case where multiple messages from different players are being processed in parallel, there was a potential race condition where the messages would be sent to the client in a different order than the message signature cache was updated. However, the cache relies on the fact that the client and server get the exact same updates in the same order. This race condition would cause the caches to become corrupted, and any future message received by the client would fail to validate.

This also applies to the last seen state of the server, which becomes inconsistent in the same way as the message signature cache and would cause any messages sent to be rejected by the server too.
2024-08-26 19:45:07 +02:00
Tamion
b724ae078d Fix CraftBukkit drag system
== AT ==
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftSlots
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftStatus
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftType
public net.minecraft.world.inventory.AbstractContainerMenu resetQuickCraft()V
2024-05-26 22:20:21 +02:00
Newwind
15c4f72cf0 Make interaction leniency distance configurable
The server validates incoming interaction packets by ensuring the player
sending them is inside their interaction range. For this, the server adds
a magic value, by default 1.0, to the original interaction range to
account for latency issues.

This value however may be too low in high latency environments.
The patch exposes a new configuration option to configure said value.
2024-07-25 13:00:37 +02:00