70 Commits

Author SHA1 Message Date
Nassim Jahnke
358e72ec0d
Remove simplify remote item matching stuff for now
Twas broken for some time and I haven't had time to address it, this may be revisited later in a different way
2025-05-09 14:47:24 +02:00
Jakub Zacek
ab0253fecd
Expand PlayerDeathEvent API (#12221) 2025-05-06 20:14:58 -04:00
Lulu13022002
567f63ae34
Parity for respawn events (#11792) 2025-04-30 20:04:24 +02:00
David
6b4ad08259
Add PlayerRespawnEvent#isMissingRespawnBlock (#12422) 2025-04-14 19:43:19 +02:00
Emily
723b511fe1
Clone exit location passed to teleport event (#12354)
The exit location passed to PlayerTeleportEvent/PlayerTeleportEndGatewayEvent in ServerPlayer#teleport(TeleportTransition) needs to be cloned, as it is later compared in case it was changed. Not cloning it results in the ability for plugins to mutate it but such changes will be ignored, as the instance of the Location being the same results in a successful equality check.

It is not necessary to clone the location in other instantiations of the event (or subclasses) as those are not compared afterwards to change the outcome.
2025-04-14 17:28:29 +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
310f52293b
Add unsupported config option and internal API to simplify remote item matching
This is important for 1.21.5 servers/clients and non-Vanilla clients that may not be able to match 1.21.5 data hashes anymore
2025-03-13 12:32:50 +01:00
caramel
7e21cb8181
fix PlayerChangedMainHandEvent javadoc (#12020)
* fix PlayerChangedMainHandEvent javadoc

* Obsolete

---------

Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2025-01-26 14:00:32 -08:00
Strokkur24
93a3df085c
Extend HumanEntity#dropItem API (#11810) 2024-12-28 23:47:21 +01:00
Lulu13022002
9e2d39cd26
Fix double chest identification (#11812) 2024-12-24 22:57:24 +01:00
Nassim Jahnke
82216a59fe
Apply some feature patches to files instead
They're small and/or really shouldn't be left unapplied
2024-12-21 13:21:47 +01:00
Nassim Jahnke
e0593e9286
More diff/changed variable name cleanup 2024-12-21 12:15:25 +01:00
Bjarne Koll
68bbd2e202
Improve diff in ServerPlayer#openHorseInventory 2024-12-20 03:07:58 +01:00
Lulu13022002
5922e6334b
fix allowPermanentBlockBreakExploits config 2024-12-18 23:35:47 +01:00
Lulu13022002
6126012369
readd beacon effect cause 2024-12-18 19:29:39 +01:00
Nassim Jahnke
972266605e
Remove dead code, param renames in added methods 2024-12-17 22:04:50 +01:00
Lulu13022002
9e8a2de45b
readd bukkit extra data to entity tags 2024-12-16 18:07:41 +01:00
Lulu13022002
783b3b70e6
readd dropped event in InteractWithDoor 2024-12-16 17:29:46 +01:00
Owen1212055
59a1f78750
Fix sleeping 2024-12-15 20:52:03 -05:00
Owen1212055
2e14d98ebe
Fix item dropping 2024-12-15 20:33:21 -05:00
Jake Potrebic
acd43900f5
remove more imports and cleanup 2024-12-15 12:51:34 -08:00
Bjarne Koll
35afd218f5
net/minecraft/server/level 2024-12-15 06:22:17 +01:00
Nassim Jahnke
45ddf764d9
Move patches to unapplied 2024-12-12 12:30:31 +01:00
Jason Penilla
cf7a1191a9 Allow using old ender pearl behavior
When enabled, ender pearls will not load chunks and will save to the world instead of the player.

== AT ==
public net.minecraft.world.entity.projectile.Projectile cachedOwner
2024-10-27 12:36:53 -07:00
Tamion
2742ad6a9a Fix InventoryOpenEvent cancellation 2024-08-19 18:05:26 +02:00
Jake Potrebic
ddbfcd4403 Restore vanilla entity drops behavior
Instead of just tracking the itemstacks, this tracks with it, the
action to take with that itemstack to apply the correct logic
on dropping the item instead of generalizing it for all dropped
items like CB does.
2022-03-22 09:34:41 -07:00
Jake Potrebic
d300049246 Add titleOverride to InventoryOpenEvent 2022-03-04 12:45:03 -08: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
Jake Potrebic
18a23db6f2 Improve PortalEvents 2022-12-15 10:33:39 -08:00
Jake Potrebic
4d008bb329 Sync offhand slot in menus
Menus don't add slots for the offhand, so on sendAllDataToRemote calls the
offhand slot isn't sent. This is not correct because you *can* put stuff into the offhand
by pressing the offhand swap item
2022-01-14 10:20:40 -08:00
Jakub Zacek
4f1619700a Add PlayerInventorySlotChangeEvent 2022-04-24 22:56:59 +02:00
Jake Potrebic
f2dcecf4d9 Add option for strict advancement dimension checks
Craftbukkit attempts to translate worlds that use the
same generation as the Overworld, The Nether, or The End
to use those dimensions when checking the `changed_dimension`
criteria trigger, or whether to trigger the `NETHER_TRAVEL`
distance trigger. This adds a config option to ignore that
and use the exact dimension key of the worlds involved.
2022-06-12 11:47:24 -07:00
Jake Potrebic
7b3898ad66 fix player loottables running when mob loot gamerule is false 2022-03-22 09:50:40 -07:00
Nassim Jahnke
457b4033ab Ensure valid vehicle status 2021-09-28 09:47:47 +02:00
Spottedleaf
7b293aba08 Do not run close logic for inventories on chunk unload
Still call the event and change the active container though. We
want to avoid close logic because it's possible to load the
chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways.
2021-03-11 03:03:32 -08:00
Jake Potrebic
0e4e270396 Add PlayerSetSpawnEvent 2021-05-19 18:59:10 -07:00
Phoenix616
e7de2be721 Don't apply cramming damage to players
It does not make a lot of sense to damage players if they get crammed,
 especially as the usecase of teleporting lots of players to the same
 location isn't too uncommon and killing all those players isn't
 really what one would expect to happen.

For those who really want it a config option is provided.
2021-06-20 16:35:42 +01:00
Jake Potrebic
818a84cfbe Fix kick event leave message not being sent 2021-07-07 16:19:41 -07:00
Spottedleaf
ac687d7ecb Fix PlayerDropItemEvent using wrong item 2021-06-20 21:55:59 -07:00
Jake Potrebic
d6b69e74a9 Expand PlayerGameModeChangeEvent 2021-05-15 10:04:43 -07:00
HexedHero
73239b4aa7 Expand PlayerRespawnEvent, fix passed parameter issues
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-04-23 22:42:42 +01:00
Yive
e3b367dcae Reset shield blocking on dimension change 2021-01-24 08:55:19 -08:00
Mariell Hoversholm
4b0e4655fd Add API for quit reason 2020-11-14 16:19:52 +01:00
DigitalRegent
0ef48f1dd1 Brand support 2020-04-11 13:10:58 +02:00
Aikar
d7f24e6729 Fire PlayerJoinEvent when Player is actually ready
For years, plugin developers have had to delay many things they do
inside of the PlayerJoinEvent by 1 tick to make it actually work.

This all boiled down to 1 reason why: The event fired before the
player was fully ready and joined to the world!

Additionally, if that player logged out on a vehicle, the event
fired before the vehicle was even loaded, so that plugins had no
access to the vehicle during this event either.

This change finally fixes this issue, fully preparing the player
into the world as a fully ready entity, vehicle included.

There should be no plugins that break because of this change, but might
improve consistency with other plugins instead.

For example, if 2 plugins listens to this event, and the first one
teleported the player in the event, then the 2nd plugin actually
would be getting a valid player!

This was very non deterministic. This change will ensure every plugin
receives a deterministic result, and should no longer require 1 tick
delays anymore.

== AT ==
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
2020-04-19 00:05:46 -04:00
MiniDigger | Martin
57802a490d Implement Player Client Options API
== AT ==
public net.minecraft.world.entity.player.Player DATA_PLAYER_MODE_CUSTOMISATION
public net.minecraft.server.level.ServerPlayer particleStatus
2020-01-20 21:38:15 +01:00
Shane Freeder
6b7013458d Prevent opening inventories when frozen 2020-04-13 07:31:44 +01:00
Aikar
7659c20386 Don't move existing players to world spawn
This can cause a nasty server lag the spawn chunks are not kept loaded
or they aren't finished loading yet, or if the world spawn radius is
larger than the keep loaded range.

By skipping this, we avoid potential for a large spike on server start.

== AT ==
public net.minecraft.server.level.ServerPlayer fudgeSpawnLocation(Lnet/minecraft/server/level/ServerLevel;)V
2020-04-09 21:20:33 -04:00
Aikar
e7044bdebb Don't tick dead players
Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
2020-04-02 17:16:48 -04:00
Phoenix616
1273cf0f21 Pillager patrol spawn settings and per player options
This adds config options for defining the spawn chance, spawn delay and
spawn start day as well as toggles for handling the spawn delay and
start day per player. (Based on the time played statistic)
When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
2020-02-01 16:50:39 +01:00