Commit Graph

132 Commits

Author SHA1 Message Date
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
Jake Potrebic 960d0c8179 Deprecate InvAction#HOTBAR_MOVE_AND_READD 2024-05-25 09:51:13 -07:00
Nassim Jahnke c6f962ba54 Prevent sending oversized item data in equipment and metadata
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-12-01 12:36:25 +01:00
Owen1212055 977543c545 Brigadier based command API
== AT ==
public net.minecraft.commands.arguments.blocks.BlockInput tag
public net.minecraft.commands.arguments.DimensionArgument ERROR_INVALID_VALUE
public net.minecraft.server.ReloadableServerResources registryLookup
public net.minecraft.server.ReloadableServerResources

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Marc Baloup <marc.baloup@laposte.net>
2022-08-01 22:50:34 -04:00
nostalfinals 445e9a65fb Added API to get player ha proxy address 2024-04-08 23:24:38 +08:00
Nassim Jahnke 3758965f88 Improve tag parser handling 2024-02-05 11:54:04 +01:00
Janet Blackquill e57ad97c91 Add CartographyItemEvent 2024-04-07 16:52:42 -04:00
Owen1212055 d12a537299 Add missing logs for log-ips config option 2023-09-23 01:49:39 -04:00
Nassim Jahnke 5688b5cf50 Add slot sanity checks in container clicks 2023-09-11 12:01:57 +10:00
Jake Potrebic 7dcff24771 Fix slot desync
General patch fixing slot desyncs between the server and client that
result from cancelled events/paper introduced logic.

Co-authored-by: Minecrell <minecrell@minecrell.net>
Co-authored-by: Newwind <support@newwindserver.com>
2023-08-23 13:22:09 -07:00
RodneyMKay 9b0d705d63 Add PlayerPickItemEvent 2021-09-08 21:34:01 +02:00
EpicPlayerA10 0f4ee39a8e Don't tab-complete namespaced commands if send-namespaced is false
Tab-complete packet is supposed to tab-complete args for commands, but
it also can suggest commands like in version 1.12.2 or lower.

This patch prevents server from sending namespaced commands when player
requests tab-complete only commands.
2023-06-18 12:38:24 +02:00
Moulberry 31871f6b40 Implement PlayerFailMoveEvent 2023-07-26 20:13:31 +08:00
Shane Freeder 16b8d46c1c Prevent causing expired keys from impacting new joins 2023-04-03 08:55:52 +01:00
Shane Freeder d0107cc0c0 Treat sequence violations like they should be 2023-03-30 03:13:58 +01:00
Jake Potrebic 3af4592f2a Use single player info update packet on join 2023-01-08 17:38:28 -08:00
NonSwag bc837647f1 Add missing SpigotConfig logCommands check
Co-authored-by: david <mrminecraft00@gmail.com>
2022-12-08 20:25:05 +01:00
Jake Potrebic b141cd3d99 Improve logging and errors
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2022-12-14 15:52:11 -08:00
Jake Potrebic 0b9ef3701e Fix a bunch of vanilla bugs
https://bugs.mojang.com/browse/MC-253721
  wrong msg for opping multiple players

https://bugs.mojang.com/browse/MC-248588
  respect mob griefing gamerule for draining water cauldrons

https://bugs.mojang.com/browse/MC-244739
  play goat eating sound for last item in stack

https://bugs.mojang.com/browse/MC-243057
  ignore furnace fuel slot in recipe book click

https://bugs.mojang.com/browse/MC-147659
  Some witch huts spawn the incorrect cat
  Note: Marked as Won't Fix, makes 0 sense

https://bugs.mojang.com/browse/MC-179072
  Creepers do not defuse when switching from Survival to Creative/Spectator

https://bugs.mojang.com/browse/MC-259571
  Fix changeGameModeForPlayer to use gameModeForPlayer

https://bugs.mojang.com/browse/MC-262422
  Fix lightning being able to hit spectators

https://bugs.mojang.com/browse/MC-263999
  Fix mobs breaking doors not spawning block break particles

https://bugs.mojang.com/browse/MC-210802
  Fixes sheep eating blocks outside of ticking range

https://bugs.mojang.com/browse/MC-123848
  Fixes item frames dropping items above when pointing down

https://bugs.mojang.com/browse/MC-174630
  Fix secondary beacon effect remaining after switching effect

https://bugs.mojang.com/browse/MC-153086
  Fix the beacon deactivation sound always playing when broken

https://bugs.mojang.com/browse/MC-200092
  Fix yaw being ignored for a player's first spawn pos

https://bugs.mojang.com/browse/MC-158900
  Fix error when joining after tempban expired

https://bugs.mojang.com/browse/MC-99075
  Fix inventory desync within spawn protected area

https://bugs.mojang.com/browse/MC-273635
  Fix TrialSpawner forgets assigned mob when placed by player

== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
public net/minecraft/server/level/ChunkMap anyPlayerCloseEnoughForSpawning(Lnet/minecraft/world/level/ChunkPos;)Z

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2022-07-11 11:56:41 -07:00
Andrew Steinborn a1051ff388 Add Velocity IP Forwarding Support
While Velocity supports BungeeCord-style IP forwarding, it is not secure. Users
have a lot of problems setting up firewalls or setting up plugins like IPWhitelist.
Further, the BungeeCord IP forwarding protocol still retains essentially its original
form, when there is brand new support for custom login plugin messages in 1.13.

Velocity's modern IP forwarding uses an HMAC-SHA256 code to ensure authenticity
of messages, is packed into a binary format that is smaller than BungeeCord's
forwarding, and is integrated into the Minecraft login process by using the 1.13
login plugin message packet.
2018-10-08 14:36:14 -04:00
Owen1212055 8a49cbc3a7 Send block entities after destroy prediction
Minecraft's prediction system does not handle block entities, so if we are manually sending block entities during
block breaking we need to set it after the prediction is finished. This fixes block entities not showing when cancelling the BlockBreakEvent.
2022-06-25 19:45:20 -04:00
Owen1212055 8cc67f527e More Teleport API 2021-09-05 12:15:59 -04:00
PanSzelescik 01cb81413b Add support for Proxy Protocol 2022-04-07 16:13:39 +02:00
Spottedleaf 0d199767d2 Don't allow vehicle movement from players while teleporting
Bring the vehicle move packet behavior in line with the
regular player move packet.
2022-03-14 12:35:37 -07:00