Commit Graph

753 Commits

Author SHA1 Message Date
Jake Potrebic f0e7d7e5f7 net.minecraft.world.level.block.state 2024-12-13 15:50:44 -08:00
Lulu13022002 c6a426beda warden AI 2024-12-13 21:36:11 +01:00
Nassim Jahnke f73e864f18 Commands 2024-12-13 21:21:57 +01:00
Lulu13022002 2509faa08e mob spawn settings 2024-12-13 21:07:56 +01:00
Nassim Jahnke c3d5f253fe Moar 2024-12-13 20:30:07 +01:00
Bjarne Koll 4091c6ac4d Follow up on block entities 2024-12-13 20:17:16 +01:00
Bjarne Koll e0fae5ef02 Part of block entities 2024-12-13 20:11:23 +01:00
Nassim Jahnke 0135513d3d More mobs 2024-12-13 20:01:24 +01:00
Nassim Jahnke 3ef3394311 More mobs 2024-12-13 19:25:16 +01:00
Noah van der Aa 7d42b87010 net/minecraft/world + Tadpole? 2024-12-13 19:17:03 +01:00
Noah van der Aa 18a25937bc pathfinding, packet utils 2024-12-13 18:57:25 +01:00
Nassim Jahnke e20952c643 Make Tadpole apply 2024-12-13 18:55:47 +01:00
Nassim Jahnke aa998246f7 More work 2024-12-13 18:40:56 +01:00
Jake Potrebic e9b739bc48 some more directories 2024-12-13 09:40:09 -08:00
Noah van der Aa 1ed5242f38 Ender dragon 2024-12-13 18:36:33 +01:00
Bjarne Koll ee51737be6 More work 2024-12-13 17:24:35 +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
Intybyte 24f63384b2 Expand scoreboard tag count validation to API set 2024-10-21 01:41:04 +02:00
Bjarne Koll 45d04f9749 Add registry entry and builders 2024-06-13 23:45:32 +02:00
Kevin Raneri b2d8133382 Configurable Entity Despawn Time 2024-09-30 09:50:55 -07:00
Lulu13022002 7b83e91bb7 Fix NPE when EntityResurrectEvent is uncancelled 2024-11-18 20:27:58 +01:00
Bjarne Koll c7c3d8a9cb Fix incorrect invulnerability damage reduction
Fixes incorrect spigot handling of the invulnerability damage
reduction applied when an already invulnerable entity is damaged with a
larger damage amount than the initial damage.
Vanilla still damages entities even if invulnerable if the damage to be
applied is larger than the previous damage taken. In that case, vanilla
applies the difference between the previous damage taken and the
proposed damage.

Spigot's damage modifier API takes over the computation of damage
reducing effects, however spigot invokes this handling with the initial
damage before computing the difference to the previous damage amount.
This leads to the reduction values to generally be larger than expected,
as they are computed on the not-yet-reduced value.
Spigot applies these reductions after calling the EntityDamageEvent and
*then* subtracts the previous damage point, leading to the final damage
amount being smaller than expected.

This patch cannot simply call the EntityDamageEvent with the reduced
damage, as that would lead to EntityDamageEvent#getDamage() returning
the already reduced damage, which breaks its method contract.
Instead, this patch makes use of the DamageModifier API, implementing
the last-damage-reduction as a DamageModifier.
2024-11-11 21:35:27 +01:00
Jake Potrebic 9467a08b36 Improve performance of RecipeMap#removeRecipe 2024-10-31 20:36:41 -07: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
Shane Freeder 8f7365707a Always send Banner patterns to the client
The mojang client will not remove patterns from a Banner when none
are sent inside of an update packet, given that this is not an expected
flow for them, this is not all too surprising. So, we shall resort to always
sending the patterns over the network for update packets.
2024-10-20 18:23:59 +01:00
Nassim Jahnke 3d14e7af19 Separate dimensiondata executor 2024-11-28 10:35:58 +01:00
Doc e95dccb515 Add AnvilView#bypassEnchantmentLevelRestriction
Anvils, by default, limit applied enchantment levels to their respective
maximum level. The added API enables plugins to disable this behaviour,
allowing enchantments that are overleveled to be applied via the anvil.
2024-10-06 16:46:36 -03:00
Axionize 66e26ebe48 Void damage configuration API 2024-09-29 14:20:42 -07:00
Mariell Hoversholm 411498e394 Add PlayerInsertLecternBookEvent 2024-09-29 16:21:26 +02:00
Jake Potrebic 5b0133e675 Call bucket events for cauldrons 2022-01-16 10:13:33 -08:00
Tamion 8b8acbb898 Add recipeBrewTime
== AT ==
public net.minecraft.world.inventory.BrewingStandMenu brewingStandData
2024-09-15 19:17:12 +02:00
Bjarne Koll c8efaa46cb Remove wall-time / unused skip tick protection
Spigot still maintains some partial implementation of "tick skipping", a
practice in which the MinecraftServer.currentTick field is updated not
by an increment of one per actual tick, but instead set to
System.currentTimeMillis() / 50. This behaviour means that the tracked
tick may "skip" a tick value in case a previous tick took more than the
expected 50ms.

To compensate for this in important paths, spigot/craftbukkit
implements "wall-time". Instead of incrementing/decrementing ticks on
block entities/entities by one for each call to their tick() method,
they instead increment/decrement important values, like
an ItemEntity's age or pickupDelay, by the difference of
`currentTick - lastTick`, where `lastTick` is the value of
`currentTick` during the last tick() call.

These "fixes" however do not play nicely with minecraft's simulation
distance as entities/block entities implementing the above behaviour
would "catch up" their values when moving from a non-ticking chunk to a
ticking one as their `lastTick` value remains stuck on the last tick in
a ticking chunk and hence lead to a large "catch up" once ticked again.

Paper completely removes the "tick skipping" behaviour (See patch
"Further-improve-server-tick-loop"), making the above precautions
completely unnecessary, which also rids paper of the previous described
incompatibility with non-ticking chunks.
2024-09-16 23:07:29 +02:00
masmc05 1cd7fd4eec Item serialization as json 2024-08-11 03:01:52 +03:00
Newwind e29ea45639 Check dead flag in isAlive()
If a plugin sets the health of a living entity above 0 after it has already died, the entity will be "revived".
It will behave the exact same as before, except with the internal "dead" flag set, resulting in 2 behavior changes,
A: it's completely invulnerable to all damage
B: it's unable to pickup items

isValid() for these bugged entities will return true, isDead() will return false, despite the dead flag.
This patch checks that the mob isn't dead before saying its alive.

Also, even if the plugin is responsibly checking !isDead() before modifying health, on very rare circumstances
I am currently unable to replicate, these "revived" entities can still appear
2024-08-26 14:01:37 +02:00
Nathan 7b8f630280 Fire BlockExpEvent on grindstone use 2024-08-31 18:09:55 -06:00
Tamion 2742ad6a9a Fix InventoryOpenEvent cancellation 2024-08-19 18:05:26 +02:00
okx-code ad8ae89c95 Add enchantment seed update API 2024-08-17 13:02:45 +01:00
Jake Potrebic 8a940ca0ba Fix SculkBloomEvent firing for block entity loading 2024-08-19 13:43:06 -07: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
mja00 15c3f06938 Add skipping world symlink scan
In worlds that are extremely large (greater than 1TB), it can take an insanely long time to walk the entire world for symlinks.
This patch adds a system property to disable the symlink scan, which can be used to speed up world loading.
2024-08-12 06:27:15 -04:00
Newwind 4b761f97a3 Configuration for horizontal-only item merging
Most of the visual artifacts that result from having item merge radius above vanilla levels is from items merging vertically,
which realistically, only happens when a player is dropping items, or items are dropping from breaking a block.

Most of the scenarios where item merging makes sense involves the two item entities being on the same Y level. i.e on the ground next to each other.
This is even more apparent since paper fixed items being able to merge through blocks.

This patch allows us to configure items to only merge horizontally, which is what vanilla does.
This allows us to have both the reduced number of item entities a high item-merge radius provides,
without most of the visual artifacts caused by items merging vertically.
2024-08-07 13:25:55 +02:00
Nassim Jahnke 334058fa69 Check for block type in SculkSensorBlock#canActivate 2024-08-07 14:33:25 +02:00
Tamion 92fa922afd Fix PickupStatus getting reset 2024-07-21 19:11:22 +02:00
Bjarne Koll 7b21e8c8d9 Only call EntityDamageEvents before actuallyHurt
The recent upstream update moved around the event logic for
EntiyDamageEvent and its derivatives.
However, the event was called on every call to #hurt as it was moved out
of actuallyHurt.

This patch moves the invocation directly before the #actuallyHurt calls,
respective invulnerable timings.
2024-07-08 22:01:08 +02:00
Jake Potrebic d9e3bee3b5 Fix NPE for Jukebox#setRecord
Fallback to the global registry if no level exists
2024-06-17 17:41:09 -07:00
Owen1212055 c3d1a03428 Configurable Sand Duping 2024-06-15 22:01:39 -04:00
Bjarne Koll c05db66ee6 Configurable damage tick when blocking with shield 2024-06-13 17:16:01 +02:00