Commit Graph

147 Commits

Author SHA1 Message Date
Nassim Jahnke
972266605e Remove dead code, param renames in added methods 2024-12-17 22:04:50 +01:00
Nassim Jahnke
d94e258d01 Clean up add/removePluginChunkTicket
No need to be that invasive to Vanilla code for simple, non-hot and small collection checks
2024-12-17 21:40:20 +01:00
Bjarne Koll
88b2981e09 Readd final mod to ChunkHolder#getTickingChunk 2024-12-17 20:32:08 +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
Nassim Jahnke
f8cb014d20 Move Aikar's EAR 1 into EAR 2 patch 2024-12-16 14:08:25 +01:00
Nassim Jahnke
a15bb2bbd0 Fix and clean up MapItemSavedData Spigot patch
It's been dysfunctional for a good while, though I don't think it's even needed. That can be investigated later
2024-12-16 09:56:45 +01:00
Owen1212055
360006bc7f Fix bouncy items
This reverts EAR diff to be how it is paper proper-- seems like alot of this got dropped.
2024-12-15 22:27:32 -05: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
4912737b8d fix issue in ServerPlayerGameMode 2024-12-15 15:20:33 -08:00
Jake Potrebic
b40c4e2179 fix initial runtime errors 2024-12-15 15:07:32 -08:00
Jake Potrebic
acd43900f5 remove more imports and cleanup 2024-12-15 12:51:34 -08:00
Jake Potrebic
de10a277e2 fix a mis-applied hunk in Projectile 2024-12-15 12:09:18 -08:00
Jake Potrebic
8cca65b8ac remove all the rest of the import hunks 2024-12-15 11:42:42 -08:00
Nassim Jahnke
e99a9b5e4a Remove cb null check 2024-12-15 13:05:35 +01:00
Jake Potrebic
172a80cb66 Somehow a bunch of items were missed 2024-12-14 22:35:35 -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
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
Gero
7acf73ce66 Call CraftPlayer#onEntityRemove for all online players 2024-11-09 22:27:58 +01:00
Aikar
0d8c3dc008 Block Enderpearl Travel Exploit
Players are able to use alt accounts and enderpearls to travel
long distances utilizing the pearls in unloaded chunks and loading
the chunk later when convenient.

This disables that by not saving the thrower when the chunk is unloaded.

This is mainly useful for survival servers that do not allow freeform teleporting.

Note: Currently removed as enderpearls are ticked as long as their owner is online in 1.21.2.
Might be worth to re-add once an option to disable the above vanilla mechanic is added, to
fully prevent enderpearl travel exploits.

== AT ==
public net.minecraft.world.entity.projectile.Projectile ownerUUID
2018-04-30 17:15:26 -04: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
Spottedleaf
29e03d0439 Add startup flag to disable gamerule limits
-DPaper.DisableGameRuleLimits=true will disable gamerule limits

== AT ==
public net.minecraft.server.level.ChunkLevel ENTITY_TICKING_LEVEL
2024-10-25 14:20:40 -07:00
Tamion
2742ad6a9a Fix InventoryOpenEvent cancellation 2024-08-19 18:05:26 +02:00
Shane Freeder
6863c9e6db disable forced empty world ticks 2023-03-21 23:51:46 +00: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
Pierpaolo Coletta
368ca9c145 Fix creation of invalid block entity during world generation 2024-03-30 21:06:10 +01:00
Gero
f42abdfad3 Configurable max block/fluid ticks 2024-02-19 17:39:59 +01:00
Badbird5907
66ebf93c21 Add BlockBreakProgressUpdateEvent 2024-03-04 22:18:28 -05:00
Spottedleaf
46c2fbfb74 Reduce allocation of Vec3D by entity tracker 2020-04-27 00:04:16 -07:00
Owen1212055
893616e851 Dont resend blocks on interactions
In general, the client now has an acknowledgment system which will prevent block changes made by the client to be reverted correctly.

It should be noted that this system does not yet support block entities, so those still need to resynced when needed.
2023-06-27 21:09:11 -04: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
fff5d44a12 Don't fire sync events during worldgen
Fixes EntityPotionEffectEvent
Fixes EntityPoseChangeEvent

Asynchronous chunk generation provides an opportunity for things
to happen async that previously fired synchronous-only events. This
patch is for mitigating those issues by various methods.

Also fixes correctly marking/clearing the entity generation flag.
This patch sets the generation flag anytime an entity is created
via StructureTemplate before loading from NBT to catch uses of
the flag during the loading logic. This patch clears the generation
flag from an entity when added to a ServerLevel for the situation
where generation happened directly to a ServerLevel and the
entity still has the flag set.
2023-11-23 10:33:25 -08:00
Brokkonaut
a6ef388655 Don't check if we can see non-visible entities 2023-10-21 20:52:57 +01:00
Warrior
9f09c7a54d Fix missing map initialize event call
== AT ==
public net.minecraft.world.level.storage.DimensionDataStorage readSavedData(Ljava/util/function/Function;Lnet/minecraft/util/datafix/DataFixTypes;Ljava/lang/String;)Lnet/minecraft/world/level/saveddata/SavedData;
2023-09-24 18:35:28 +02: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
aerulion
edb4225d90 Add BlockFace to BlockDamageEvent 2023-08-21 04:36:07 +02:00
ruViolence
8e05d19854 Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category.
2023-06-27 15:38:18 +08:00
Jake Potrebic
597cb633e8 Properly handle BlockBreakEvent#isDropItems
Setting whether a block break dropped items controlled
far more than just whether blocks dropped, like stat increases
food consumption, turtle egg count decreases, ice to water
conversions and beehive releases
2023-03-04 10:52:52 -08:00
Warrior
4c98f21716 Cache map ids on item frames 2023-08-07 12:58:28 +02:00
Jake Potrebic
36ae0bcfea Only capture actual tree growth 2021-08-21 18:53:03 -07:00
Redned
4bb84c46ac Only tick item frames if players can see it
In the event that an item frame cannot be seen by any players, ticking the item frame every tick is unnecessary. This can be a very hot section of the entity tracker when lots of item frames are present on a server, so this reduces the logic which speeds it up.
2023-06-19 15:45:53 -05:00
Shane Freeder
c060f3fae0 Prevent GameEvents being fired from unloaded chunks 2023-04-05 20:15:47 +01:00
Jake Potrebic
18a23db6f2 Improve PortalEvents 2022-12-15 10:33:39 -08:00
Yannick Lamprecht
df65fbea3e Player Entity Tracking Events 2022-03-30 18:16:52 +02: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
Jake Potrebic
0e9f28fe68 Fix async entity add due to fungus trees 2022-03-18 21:30:00 -07:00
Jake Potrebic
012c32fac7 check global player list where appropriate
Makes certain entities check all players when searching for a player
instead of just checking players in their world.
2022-11-22 13:16:01 -08:00