Commit graph

5773 commits

Author SHA1 Message Date
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
Jake Potrebic
cea3e6b65b Improve entity effect API 2024-09-27 17:13:16 -07:00
masmc05
da18fc4d93 Add enchantWithLevels with enchantment registry set 2024-09-25 16:26:04 +03:00
Nassim Jahnke
c056e2319d Fix PlayerCommandPreprocessEvent on signed commands 2024-09-21 22:01:52 +02:00
Newwind
f5e9df0862 Disable pretty printing for advancement saving
Reduces json size by about 25%
Not sure why advancements even had pretty printing enabled.
My best guess was by accident on mojang's part, especially since stats json files don't have pretty printing.
2024-09-20 14:17:37 +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
strnq
883f50eb19 Validate slot in PlayerInventory#setSlot
The CraftPlayerInventory implementation sends a container_set_slot
packet to the client which will error if an invalid slot is passed to
the setSlot method, making a validation necessary over simply silently
ignoring invalid slot values.
2024-09-14 12:53:13 +03:00
masmc05
1cd7fd4eec Item serialization as json 2024-08-11 03:01:52 +03:00
Jake Potrebic
90bc5f1e0b Add FeatureFlag API 2024-05-29 19:50:21 -07: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
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
okx-code
ad8ae89c95 Add enchantment seed update API 2024-08-17 13:02:45 +01:00
Newwind
34c99b8c67 Remove set damage lootable item function from compasses
In VanillaChestLoot, compasses accidentally have a setdamage loot
function on them, but compasses don't take durability, resulting in a warning.
This patch simply removes attempting to add damage to the compass item.
2024-08-22 22:55:37 +02: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
Lulu13022002
52acc18e4f Leashable API 2024-06-22 21:17:54 +02:00
Jake Potrebic
d72defffba Add even more Enchantment API
In a separate patch because RegistryKeySet is used
and the previous "more enchant api" patch is before that.
2024-07-19 08:42:45 -07: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
Jake Potrebic
f6f6664716 Add API for CanPlaceOn and CanDestroy NBT values 2018-09-12 18:53:55 +03: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
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
Jason Penilla
91b690c240 Add plugin info at startup 2024-07-18 18:44:28 -07:00
Jake Potrebic
4ef8b976c9 Add ItemType#getItemRarity 2024-07-09 18:37:37 -07: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
471be1b4da fix horse inventories
Horse inventories now combine 2 inventories (like
result inventories).

== AT ==
public net/minecraft/world/inventory/HorseInventoryMenu SLOT_BODY_ARMOR
2024-07-06 13:57:10 -07: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
Jason Penilla
164078cd2a Prioritize Minecraft commands in function parsing and command blocks 2024-07-01 11:58:49 -07:00
Jake Potrebic
9f2cf09ec5 Make a PDC view accessible directly from ItemStack 2024-06-12 10:29:40 -07:00
Jake Potrebic
c441981c54 Proxy ItemStack to CraftItemStack 2024-05-14 11:57:43 -07:00
Owen1212055
c3d1a03428 Configurable Sand Duping 2024-06-15 22:01:39 -04:00
Shane Freeder
6863c9e6db disable forced empty world ticks 2023-03-21 23:51:46 +00:00
Jake Potrebic
9d89ebb121 Properly remove the experimental smithing inventory type 2023-06-08 14:45:18 -07:00
Bjarne Koll
c05db66ee6 Configurable damage tick when blocking with shield 2024-06-13 17:16:01 +02:00
Jake
d7b5168a81 Fix removing recipes from RecipeIterator
== AT ==
public net.minecraft.world.item.crafting.RecipeMap byKey
2024-06-15 18:50:18 +01:00
granny
826f299f4c check if itemstack is stackable first 2024-02-24 19:33:01 -08:00
Owen1212055
84d07ca942 Suspicious Effect Entry API
Exposes a new suspicious effect entry type that properly represents
storable effects in the context of suspicious effects as they only
define the potion effect type and duration.

This differentiates them from the existing PotionEffect API found in
bukkit and hence clarifies that storable values in the parts of the API
in which it replaces PotionEffect.

Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
2024-03-03 19:43:40 +01:00
Bjarne Koll
99cd3b6813 Adopt MaterialRerouting
Adopts the paper-api to the material rerouting infrastructure introduced
by upstream.
2024-06-13 11:02:36 +02:00
Shane Freeder
165e93c7c6 Fix sending disconnect packet in phases where it doesn't exist 2024-05-30 18:46:15 +01:00
Jake Potrebic
960d0c8179 Deprecate InvAction#HOTBAR_MOVE_AND_READD 2024-05-25 09:51:13 -07:00
SoSeDiK
64cbea9119 Add missing fishing event state 2024-05-01 07:44:50 +03:00
Tamion
276e09c3b0 Fix cancelling BlockPlaceEvent calling onRemove 2024-05-23 11:02:20 +02:00
Jake Potrebic
acdfeeea3d Prevent NPE if hooked entity was cleared 2024-05-12 21:57:23 -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
Jason Penilla
ce6fd58a5e Allow Bukkit plugin to use Paper PluginLoader API 2024-05-21 13:18:15 -07:00