Commit graph

3215 commits

Author SHA1 Message Date
Nassim Jahnke
2773dc4847
Add light block to indestructible block list 2024-07-12 09:24:50 +02:00
Shane Freeder
c6e9579688
Fix explosions calculation getting stuck (#11061)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2024-07-12 09:16:03 +02:00
Spottedleaf
0e02aa5b8e Port watchdog detail patch 2024-07-11 12:28:27 -07:00
Spottedleaf
1d0fcb5aaf Port lag compensation patch 2024-07-11 12:22:59 -07:00
Spottedleaf
821081d646 Drop unapplied patches
1012-Use-distance-map-to-optimise-entity-tracker.patch:
1025-Collision-optimisations.patch:
1034-Actually-optimise-explosions.patch:
1039-Send-full-pos-packets-for-hard-colliding-entities.patch:
Implemented in Moonrise patch

1037-Distance-manager-tick-timings.patch:
Not needed

0668-Implement-regenerateChunk.patch:
API does not appear to be used, and it is a real pain to
implement this properly. The old patch did not handle
populators correctly, for example.
2024-07-11 12:13:41 -07:00
Spottedleaf
90ae1dc573 Port collision optimisation patch from Moonrise
Drop random ticking optimisation for now
2024-07-11 12:09:15 -07:00
Spottedleaf
7bd22b1835 Optimise entity tracker
Patch is ported from Folia
2024-07-11 09:23:56 -07:00
Spottedleaf
f250ec0a2e Increment ChunkHolderManager current tick
This is an oversight from copying from Folia. The current tick
should be incremented so that incremental autosave can properly
occur.
2024-07-11 08:57:31 -07:00
Spottedleaf
a594d182e4 Fix entities not being visible to clients when teleporting
When teleporting, the spawn position packet will contain the
old position. Then the following tracking update will send a
teleport packet, but the client will lerp the position change
over 3 ticks. However, the client does not tick entities in
unloaded chunks - resulting in the lerp never occuring.

We fix this by sending the current position in the spawn packet.
2024-07-11 08:34:10 -07:00
Spottedleaf
8b558d9e0b Apply entity tracker desync patch 2024-07-11 08:15:36 -07:00
Spottedleaf
f7124df56b Fix recursive chunk loading in chunk unload event
Since the chunk may not even be at a loaded ticket level, the
getChunk call may invoke a sync load. To prevent this, we can
retrieve the full loaded chunk first which is guaranteed to be
non-null when unloading.
2024-07-11 07:16:42 -07:00
Nassim Jahnke
20889d04d8
Fix method reflection remapping with null parameter types passed
Fixes #11052
2024-07-10 18:22:02 +02:00
Bjarne Koll
b0ef3ca25a
Only call EntityDamageEvents before actuallyHurt (#11045)
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-09 17:13:51 +02:00
Bjarne Koll
70b0e84476
Properly apply damage tick after absorption (#11043)
The logic in place to prevent players from processing a damage
tick/knockback/etc when hit with 0 damage incorrectly used the damage
events final damage value, which is reduced by absorption.

Instead, use the event's "raw damage", e.g. the amount passed to hurt,
in order to determine if the damage tick should be skipped.
This still allows plugins to change the damage to a non-zero value and
properly damage ticks the player in such a case, but correctly processes
the damage tick in cases where the original damage is non zero but the
actual damage is.
2024-07-08 21:20:18 +02:00
Nassim Jahnke
62ed302bf4
Fix entity distance check when applying knockback
Fixes #11036
2024-07-07 19:27:45 +02:00
Jake Potrebic
2fa5e0e0df
Fix horse inventories (#11028) 2024-07-06 14:25:23 -07:00
Bjarne Koll
4d20922b79
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11024)
* Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e86f4dc4 PR-1041: Improve getPlayer(String) docs to clarify it matches the name
9738f005 Fix spawner API documentation
69ebd9fd PR-1034: Add TrialSpawnerSpawnEvent
23cffd9c PR-973: Improve spawner API and add API for Trial Spawners
8bf19163 PR-1038: Clarify HumanEntity#openInventory(InventoryView) JavaDoc
1ff76351 SPIGOT-7732, SPIGOT-7786: Add freezing damage modifier
02161cb4 PR-1034: Add CreatureSpawnEvent.SpawnReason#TRIAL_SPAWNER
f9cb6f34 SPIGOT-7777: All entity potion effects are removed on death
25d548eb PR-1031: Expose Creeper igniter
ccbf0915 SPIGOT-7770: Reserve spaces in shaped recipes for blank ingredients
17f7097c Clarify ambiguity around what is API
71714f0c Remove note from InventoryView JavaDoc
aaf49731 PR-1030: Deprecate more unused methods in UnsafeValues
3a9dc689 SPIGOT-7771: Material.getDefaultAttributes always returns an empty map

CraftBukkit Changes:
c3ceeb6f7 SPIGOT-7814: Call PlayerShearEntityEvent for Bogged
97b1e4f58 Fix wolf armor not dropping from use of shears
fd2ef563a SPIGOT-7812: Revert "SPIGOT-7809: Restore shield/banner conversion for base colours"
f672c351b SPIGOT-7811: Enchantments are applied on sweeping attack even if damage event is cancelled
cfe29350b SPIGOT-7808: Fix implementation of Enchantment#getName() for bad name return
19335f69e SPIGOT-7809: Restore shield/banner conversion for base colours
ae4f5a0be SPIGOT-7805: Fix jukebox deserialization
62e3b73a4 SPIGOT-7804: Fix written book serialization
aac911d26 SPIGOT-7800, SPIGOT-7801: Keep vanilla behaviour for items dropped on player death
13ece474f PR-1429: Implement TrialSpawnerSpawnEvent
bf13e9113 PR-1354: Improve spawner API and add API for Trial Spawners
515fe49e1 Increase outdated build delay
9cd5a19a0 SPIGOT-7794: Cancelling InventoryItemMoveEvent destroys items
ce40c7b14 SPIGOT-7796: Kickplayer newlines not working
5167256ff SPIGOT-7795: Fix damage/stats ignore the invulnerable damage time
f993563ee Improve cross-world teleportation handling
ab29122cf PR-1433: HumanEntity#openInventory(InventoryView) should only support views belonging to the player
764a541c5 SPIGOT-7732: Issue with the "hurt()" method of EntityLiving and invulnerable time
820084b5f SPIGOT-7791: Skull BlockState with null profile causes NullPointerException
5e46f1c82 SPIGOT-7785: Teleporting a player at the right moment can mess up vanilla teleportation
cbd95a6b3 SPIGOT-7772: Include hidden / non-sampled players in player count
3153debc5 SPIGOT-7790: Server crashes after bee nest is forced to update
e77bb26bb SPIGOT-7788: The healing power of friendship advancement is never granted
ee3d7258a SPIGOT-7789: Fix NPE in CraftMetaFirework applyToItem
2889b3a11 PR-1429: Add CreatureSpawnEvent.SpawnReason#TRIAL_SPAWNER
cdd05bc7f SPIGOT-7777: Speed attribute stays after death; missing EntityPotionEffectEvent call
d0e6af2d4 PR-1428: Expose Creeper igniter
d01c70e93 PR-1425: Fix bytecode transformation taking care of class-to-interface compatibility.
b2b08f68c SPIGOT-7770: Fix certain shaped recipes not registering
3f8e4161f PR-1426: Deprecate more unused methods in UnsafeValues
2c9dd879e SPIGOT-7771: Material.getDefaultAttributes always returns an empty map

Spigot Changes:
491f3675 Rebuild patches
0a642bd7 Rebuild patches
8897571b Rebuild patches
cb8cf80c Fix newlines in custom restart message
1aabe506 Rebuild patches
2024-07-06 21:19:14 +02:00
Jason Penilla
8d91b859cb
Prioritize vanilla commands in function parsing (#11011)
* Prioritize vanilla commands in function parsing

* Handle command blocks as well
2024-07-04 11:49:00 -07:00
Nassim Jahnke
be8ac7acc3
Fix respawn error due to null location
Closes #11017
2024-07-04 16:20:03 +02:00
Nassim Jahnke
b89e6a0195
Readd more patches 2024-07-04 12:46:15 +02:00
Spottedleaf
8c8b227547 Execute chunk tasks mid-tick
If the server tick length is high, then the amount of time
available to process chunk tasks inbetween ticks is low. As a
result, chunk loading and generation may appear to slow down.

To ensure that chunk tasks are always processed, we add logic to
execute chunk tasks during tile entity tick, entity tick, chunk
random ticking, and scheduled block/fluid ticking. The mid-tick task
execution is timed so that it is not prioritised over the server
tick.
2024-07-03 19:22:43 -07:00
powercas_gamer
7eec21e80d
[ci skip] add adventure-key javadoc (#11014) 2024-07-02 21:52:04 +01:00
granny
b45d9b6c97
Fix summon_entity effect attempting to add incorrect entity (#11004) 2024-07-01 10:16:07 +02:00
Nassim Jahnke
aa8d38d3db
Add forRemoval to material data deprecations (#10996)
2018 is calling
2024-06-29 10:58:37 +02:00
Nassim Jahnke
1f5db50424
Change item/xp merge and entity tracking range defaults (#10986) 2024-06-27 22:08:34 +02:00
Spottedleaf
dd49fba8c5 Fix NPE when retrieving an entity with a null UUID
While the null UUID is almost certainly an error, the old
implementation did not NPE as it used a plain HashMap for lookup
by UUID, whereas we use a ConcurrentHashMap which will NPE on
null keys.
2024-06-23 18:59:56 -07:00
Jake Potrebic
dd31654684
bump reflection-rewriter to 0.0.3 (#10969) 2024-06-23 16:39:45 -07:00
Lulu13022002
b99d071a36
Swap some nullable annotations (#10960) 2024-06-24 00:42:44 +02:00
Jake Potrebic
1d3fc0ee68
Bump reflection-rewriter to 0.0.2 (#10927) 2024-06-24 00:29:50 +02:00
Jake Potrebic
897ece48d5
Call EntityPortalEnterEvent on endgateways and make cancellable (#10892) 2024-06-23 15:01:12 -07:00
Lulu13022002
5ae4758c8b
Fix speed for launched trident using api (#10936) 2024-06-23 14:37:20 -07:00
Lulu13022002
97afc9a00c
Fix StackOverflowError for new dispenser interaction (#10949) 2024-06-23 22:24:17 +02:00
SoSeDiK
b2e5587a2e
Expose LivingEntity#canUseSlot (#10930) 2024-06-23 22:11:39 +02:00
Lulu13022002
95aa440473
Add missing effect cause and deprecate PATROL_CAPTAIN cause (#10958) 2024-06-23 22:08:13 +02:00
scarfacered
19eefe9321
Fix SoundEffects only to players diff (#10966)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2024-06-23 22:03:32 +02:00
Shane Freeder
812701d901
Do not crash when an exp orb attempts to mend an unrepairable item 2024-06-23 14:04:58 +01:00
Lulu13022002
76c2f16f57
Fix wrong diff applying delta twice (#10959) 2024-06-22 20:11:34 +02:00
Pedro
77c763b5ef
Fix PlayerShearBlockEvent drops ignored for Pumpkin (#10956) 2024-06-22 14:50:47 +01:00
Spottedleaf
19105a9019 Fix unload queue storing chunks in wrong sections
The unload queue stored the chunks in the same section as
the chunk coordinate, when it needed to apply the unload shift.

Additionally, change the default region shift to the ticket
propagator shift as there is no benefit to using a low region
shift since no regionizing is occuring. This makes the unload
queue shift 6, which should reduce the number of sections to deal
with while processing unloads.
2024-06-21 11:57:03 -07:00
Lulu13022002
9cd0201535
Preserve velocity for fireball (#10934) 2024-06-21 11:06:31 -07:00
Lulu13022002
0409a68f50
deprecate and update some entity tags (#10932) 2024-06-21 18:51:00 +02:00
Lulu13022002
081146c56e
Validate using_converts_to for food component (#10931) 2024-06-21 18:48:48 +02:00
Lulu13022002
d64be7e10a
Fix NPE of AbstractArrow#getWeapon (#10933) 2024-06-21 18:48:29 +02:00
Lulu13022002
a0fad76fb6
Fix base damage for trident (#10948) 2024-06-21 18:48:18 +02:00
Shane Freeder
0a1b133c28
Revert "Fixes exception log messages getting dropped during bootstrap (#10935)" (Closes #10945)
This reverts commit 2118196dd5.
2024-06-21 10:06:03 +01:00
Shane Freeder
8b1d26df0b
Fix diff in sprint interruption option (Closes #10939) 2024-06-21 01:21:23 +01:00
Jake Potrebic
2118196dd5
Fixes exception log messages getting dropped during bootstrap (#10935) 2024-06-20 11:26:07 -07:00
Lulu13022002
bab07e0ff9
Validate speed for tool component rule (#10923) 2024-06-20 09:32:32 -07:00
Lulu13022002
666bc4dbb2
Experimental annotation changes (#10914)
* Experimental annotation changes

* wind charge damage type is not experimental anymore
2024-06-20 09:03:09 -07:00
Lulu13022002
cf60574a2f
Fix jukebox playable component not being applied on item meta (#10922) 2024-06-20 08:57:56 -07:00
Spottedleaf
2df432f6af Re-add chunk system debug commands
Re-adds the 'chunkinfo', 'holderinfo' and 'debug chunks' commands.

Additionally, this re-adds chunk debug dumping during watchdog
long timeouts.
2024-06-19 12:11:21 -07:00
Spottedleaf
e0d9d6028c Add debug for chunk system unload crash
Somehow, a chunkholder is present in the unload queue after
it has been unloaded. It is likely that this is a result of
adding the chunk holder to the unload queue while it is
unloading. However, that should not be possible.

To find out where it is being added to the unload queue, track
the last stacktrace which adds to the unload queue and check
on chunk holder remove if the holder is present in the unload queue
and log the stacktrace.
2024-06-19 10:55:04 -07:00
Spottedleaf
f4ddd4ac24 Fix ChunkHolder#getFullChunkNow returning non-null when it should not
In the new chunk system, the chunk is only at FULL when either
the FULL callbacks have been invoked or during the FULL callbacks.
2024-06-19 10:42:48 -07:00
Spottedleaf
38428c0d6c Cleanup MCUtils patch for chunk system
Remove utilities that are unused, as well as replacing
the full chunk map with a concurrentutil implementation.

Additionally, fix the addition/removal of chunks to/from the
full chunk map so that getChunkIfLoaded correctly returns a
non-null chunk when calling the load or unload events.
2024-06-19 10:29:03 -07:00
Spottedleaf
c0268ca86e Copy missing diff from old chunk system patch
Fixes:
- EntitiesLoadEvent/EntitiesUnloadEvent not firing
- Chunks not saving properly in a lot of cases
2024-06-19 09:27:15 -07:00
Spottedleaf
250e78c42a Re-add fixlight command 2024-06-19 08:41:24 -07:00
Jason Penilla
4ea696ffe4
Add ticket for chunk load in isChunkGenerated 2024-06-18 21:15:20 -07:00
Jason Penilla
3b1c85b3a2
Execute chunk tasks while waiting for chunk load in isChunkGenerated
this shouldn't be needed as we are requesting EMPTY status, however there is a deeper issue that we will just work around for now

fixes #10916
2024-06-18 21:04:35 -07:00
Jason Penilla
d23825aa56
Add missing null check to getFullChunkIfLoaded
fixes #10915
2024-06-18 18:27:50 -07:00
Jason Penilla
126f6d7dc1
Remove getUnloadingChunkHolder check
It always returns null now. So it could NPE and is not useful.
2024-06-18 12:51:40 -07:00
Jason Penilla
7bbe6820c2
Fix CraftWorld#isChunkGenerated
The upstream implementation is returning true for non-full chunks.

This fix is not ideal since the new chunk system doesn't have a region file/chunk status patch. May want to be revisited before a non-experimental release.
2024-06-18 12:44:07 -07:00
Nassim Jahnke
090775eff4
Use ItemStack.empty() when air is passed into constructor 2024-06-18 15:31:30 +02:00
Bjarne Koll
4514f41ffa
Correct duplicate attribute check (#10901)
Brackets got lost during the update, leading to an incorrect
precondition call.
2024-06-18 11:11:14 +02:00
Jake Potrebic
b4b820851f
Fix NPE for Jukebox#setRecord
Fallback to the global registry if no level exists
Fixes #10899
2024-06-17 17:44:04 -07:00
Emilia Kond
b9f7098723
[ci skip] Fix javadoc mistake in EnchantmentRegistryEntry.Builder (#10898)
The javadoc for EnchantmentRegistryEntry.Builder accidentally refers to
GameEventRegistryEntry, which is a different buildable registry entry.
2024-06-17 22:54:49 +01:00
Nassim Jahnke
21c9a7c79d
Rebuild patches 2024-06-17 21:21:06 +02:00
willkroboth
b3e072a625
Fix hasFiredAsync parameter when AsyncPlayerSendCommandsEvent is called (#10896) 2024-06-17 21:17:51 +02:00
Jake Potrebic
bf8552f0f0
Delegate ItemStack (#10852) 2024-06-17 21:12:42 +02:00
Nassim Jahnke
13992b17c7
Make chunk system loggers calm down a bit 2024-06-17 13:43:21 +02:00
Nassim Jahnke
152f4feff3
Add back improved watchdog support patch 2024-06-17 13:36:43 +02:00
Jake Potrebic
a7f6633362
make EntityPortalReadyEvent#setTargetWorld work again 2024-06-16 15:48:38 -07:00
Jake Potrebic
fb762cf368
remove remaining reference to 'pgive' 2024-06-16 15:38:59 -07:00
Jake Potrebic
8dfb85c173
Enchantment and GameEvent Registry builders (#10889)
Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2024-06-17 00:00:12 +02:00
Nassim Jahnke
61b85e4cbf
Fix legacy cb version in remapper 2024-06-16 23:23:50 +02:00
Spottedleaf
f8ee0a06c5 Fix implementations of ChunkHolder#getChunkIfPresent
Implementations for ChunkStatuses below FULL are supposed to always
return ProtoChunk instances. However, since we used the last completed
status, it could return LevelChunk.

To resolve this, follow Vanilla behavior of tracking chunk
completions by status and replace old ProtoChunk statuses with
ImposterProtoChunk when the chunk generates to FULL.

Additionally, implement an optimisation for retrieving full chunks
by storing a map of pos -> LevelChunk. This requires only a simple
map lookup to occur for full chunks which are loaded.
2024-06-16 14:09:44 -07:00
Jake Potrebic
d9111ccec2
Registry Modification API (#10893)
* Registry Modification API

* some fixes

* even more fixes
2024-06-16 12:39:59 -07:00
Nassim Jahnke
106dbae220
Fix getAddress connection check 2024-06-16 21:31:39 +02:00
Jake Potrebic
167961e744
call EntityDamageItemEvent for thorns 2024-06-16 09:47:53 -07:00
Bjarne Koll
fbc2a55cde
Update Wither#canTravelThroughPortals 2024-06-16 18:04:11 +02:00
Bjarne Koll
e1c0033552
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2b4b6d14 PR-1023: Convert InventoryView to interface

CraftBukkit Changes:
68603b1c1 Use expanded interaction ranges for traced interact events
eae9f760c PR-1414: Convert InventoryView to interface
ee9eafe67 Fix Implementation for DamageSource#isIndirect for internal custom causing entity
2024-06-16 17:23:42 +02:00
Jake Potrebic
ec4c712efa
update 'improve mass craft perf' patch 2024-06-16 08:08:06 -07:00
Jakub Zacek
d8c298007f
Add Adventure API to ServerLinks (#10891) 2024-06-16 13:54:38 +02:00
Nassim Jahnke
c84a3b541c
Remove fully dropped patches 2024-06-16 13:14:53 +02:00
Nassim Jahnke
dc684c60d1
Remove bad server.scheduleOnMain disconnect calls from old patches
The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
2024-06-16 12:56:00 +02:00
Nassim Jahnke
752f957e12
Add back more patches 2024-06-16 12:47:57 +02:00
Bjarne Koll
60f3bd8d0c
De-deprecate BlockData#getDestroySpeed 2024-06-16 12:44:22 +02:00
Yannick Lamprecht
1f8e7a7b09
address compile and test issue (#10890) 2024-06-16 11:47:44 +02:00
Spottedleaf
f873bcee24 Fix NPE in V3808
The armor items may not exist, so we need to null check it.
2024-06-15 22:59:15 -07:00
Owen1212055
7240d9d81c
Restore functionality to sand dupe setting 2024-06-15 22:04:02 -04:00
Owen1212055
5a5412ca70
Owen fixing stuff!!! 2024-06-15 21:43:06 -04:00
Spottedleaf
b090c65fe0 Remove unnecessary changes from chunk status fix 2024-06-15 15:31:04 -07:00
Bjarne Koll
e339ec27b4
Deprecate BlockData#getDestroySpeed for removal
The method sadly is not usable in 1.21 without a player as all of an
enchantments attribtue modifiers rely on a base value supplied by a
player. The method could only offer a rough estimate based on some
default values, however a better method for this should be added down
the line rather than trying to force such logic into the existing one.
2024-06-16 00:19:10 +02:00
Bjarne Koll
3555a7776e
Properly forward DispenseEvent #getItem to saddle
Correctly use the DispenseEvent's #getItem ItemStack when placing the
saddle on entities during a dispense behaviour instead of the original
stack.
2024-06-16 00:01:55 +02:00
Bjarne Koll
7df472527f
Configurable damage tick when blocking with shield (#10877)
A long standing bug in spigot and its derivatives was the fact that
players taking damage while blocking with a shield would not receive
invulnerability, while they do in vanilla.

This enabled the pvp technique of disabling a shield and immediately
attacking again to knock a player into the air.
While upstream fixed this and properly aligned itself with vanilla
damage logic (in this specific case) changing such long standing
behaviour has some downsides.

To allow players used to this specific bug to still use it, this patch
introduces a configuration option to re-introduce said bug.
As there is no easy way to *only* re-add this bug, the option is found
in the unsupported section as it may introduce other damage related
disparity from vanilla.
2024-06-15 23:17:51 +02:00
Aya
d41636f445
Add back RecipeIterator fixes patch (#10887) 2024-06-15 21:53:46 +02:00
Jake Potrebic
c1aefeecc6
correctly change enchantment registry to a 'delayed' version 2024-06-15 12:04:06 -07:00
Nassim Jahnke
56b5b7d452
Fix max chunk status checks 2024-06-15 19:57:59 +02:00
Nassim Jahnke
0008fa17e9
Add back more optimization patches 2024-06-15 19:24:11 +02:00
Bjarne Koll
04dad71064
Improve enchantWithLevels logic
Previously would stream and optionally filter out all entries in the
enchantment registry.
Moves it to using the empty optional if treasure is allowed, leaving the
logic to EnchantmentHelper.
2024-06-15 19:08:11 +02:00
Nassim Jahnke
a835ad1076
Merge remote-tracking branch 'origin/dev/1.21' into dev/1.21 2024-06-15 18:52:19 +02:00
Ghast
b420038799
Fix ItemMeta#removeEnchantments (#10886) 2024-06-15 18:52:01 +02:00
Jake Potrebic
fb511c698e
Fix Player#sendBlockState (#10855) 2024-06-15 18:52:00 +02:00
Jake Potrebic
5bd7f4e8ae
Update AbstractArrow item method implementations for 1.20.6 (#10885) 2024-06-15 18:48:27 +02:00
Bjarne Koll
0b6701da5a
Revert DamageSource#getCausingEntity to vanilla 2024-06-15 18:39:55 +02:00
Nassim Jahnke
4bc15f13aa
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e2160a18 Make MapCursor#type not depends on deprecated values

CraftBukkit Changes:
6ce172642 SPIGOT-7761: Ender pearl does not damage or spawn endermites
f5a63f734 SPIGOT-7759: Chunk not there when requested in ChunkUnloadEvent
28287259c Remove unused import
eb9a7dde0 SPIGOT-7757: Cannot set item in Stonecutter Inventory
f8be9d752 Move deserialized removed unhandled tags to dedicated removedTags
a7e576186 Fix potential mutability issue with CraftMetaItem copy constructor
995885452 SPIGOT-7741: Vanilla ItemComponent in commands can't remove components
9ef69aa0b PR-1284: Move ItemType <-> ItemMeta linking to a centralized place
3e82eafbe PR-1420: Fix DirectEntity and CausingEntity Damager for Creepers ignited by Player
c23daa71f SPIGOT-7751: Fix crash caused by arrows from trial spawners
Make MapCursor#type not depends on deprecated values
SPIGOT-7761: Ender pearl does not damage or spawn endermites
2024-06-15 18:31:58 +02:00
Jake Potrebic
5d834b1b71
rebuild patches 2024-06-15 06:22:06 -07:00
Nassim Jahnke
ee9b820fbe
Update more optimization patches 2024-06-15 14:12:22 +02:00
Spottedleaf
730882fca9 Chunk System and Starlight WIP
Chunk system patch was refactored to take advantage of
newer ConcurrentUtil's concurrent long hash table (which
fixes hash collisions caused by chaining fastutil's long hash
and CHM's hash) plus some other minor improvements.

The chunk system was also merged with Starlight, which mostly
provides a small improvement to ThreadedLevelLightEngine#checkBlock
as the scheduling was rewritten.
2024-06-14 17:39:15 -07:00
Jake Potrebic
ffe310a8e1
remove api that was scheduled for removal 2024-06-14 14:07:44 -07:00
Spottedleaf
f5693896c5 Update ConcurrentUtil
Mostly for the primitive long to reference hashtable impl
2024-06-14 10:47:33 -07:00
Spottedleaf
df633e5ffa DataConverter 1.21 2024-06-14 10:34:45 -07:00
Spottedleaf
38b3182a90 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
befcf86d SPIGOT-7740: Fix using new map cursor types
09229095 Add EntityDamageEvent.DamageCause#CAMPFIRE

CraftBukkit Changes:
a1d2cd152 SPIGOT-7747: Mob head is not dropped when mob was blown up by a charged creeper
8078294bc SPIGOT-7746: Server Crashing when Players Getting into End Portals
8d842e250 SPIGOT-7744: Fix exception for shooting projectiles with flame enchantment
64e0ad129 SPIGOT-7744: Fix crash when shooting arrows in creative mode
819f7a10a Fix player items not dropping on death
0a0229bb5 Implement DamageCause#CAMPFIRE and minor improvement in exception for Unhandled block damage
2024-06-14 10:15:52 -07:00
Nassim Jahnke
66f7b672ed
Fix body equipmentslot and effect enum 2024-06-14 18:53:32 +02:00
Nassim Jahnke
038f8d915e
Fixup and deprecate player profiles in ping event
The player sample uses game profile internally, but discards everything but the name and uuid and does not follow player profile restrictions, so it doesn't make sense to use that in the event.
2024-06-14 18:17:26 +02:00
Nassim Jahnke
5442bffab5
Make it compile 2024-06-14 18:02:15 +02:00
Bjarne Koll
184a943ad4
Adopt previous commit changes in API 2024-06-14 16:04:56 +02:00
Bjarne Koll
547f09dfa0
Some work on the ItemMend events 2024-06-14 16:01:00 +02:00
Bjarne Koll
69d1d0a4f4
Pretend to fix compile errors 2024-06-14 15:16:29 +02:00
Nassim Jahnke
a308c7c8d7
Fix more compile issues 2024-06-14 14:28:06 +02:00
Nassim Jahnke
0d3ce2d704
Fix more compile issues 2024-06-14 14:11:52 +02:00
Nassim Jahnke
3c04f9f668
Fix a few compile errors 2024-06-14 13:07:50 +02:00
Bjarne Koll
6a34750160
Move unapplied patches to the back 2024-06-14 12:05:15 +02:00
Bjarne Koll
6d4e235784
988 2024-06-14 11:59:44 +02:00
Bjarne Koll
4140de28eb
960 2024-06-14 11:07:50 +02:00
Bjarne Koll
a399f23903
956 2024-06-14 10:56:28 +02:00
Bjarne Koll
14c03366ed
922 2024-06-14 10:17:11 +02:00
Jason Penilla
33b36cde31
update some patches 2024-06-13 20:41:44 -07:00
Jake Potrebic
52b49fbcc8
788/1053 2024-06-13 18:30:23 -07:00
Jake Potrebic
8731266275
650/1053 2024-06-13 17:08:12 -07:00
Jake Potrebic
ba163e10bb
585/1053 2024-06-13 16:32:45 -07:00
Bjarne Koll
ed2ea4538e
538 2024-06-14 00:44:26 +02:00
Jake Potrebic
083bd9e75c
531/1053 2024-06-13 14:42:02 -07:00
Jake Potrebic
27e29ccaf2
487/1053 2024-06-13 13:57:13 -07:00
Jake Potrebic
0bc9aeef26
385 2024-06-13 13:14:13 -07:00
Jake Potrebic
ec05cb8b38
279 2024-06-13 12:04:27 -07:00
Jake Potrebic
0b7552272a
194 2024-06-13 11:09:28 -07:00
Jake Potrebic
2055809b1e
117 2024-06-13 10:30:39 -07:00
Jake Potrebic
8a37f93925
62 2024-06-13 10:12:48 -07:00
Jake Potrebic
7fbb8278e7
Finish API patches 2024-06-13 08:45:43 -07:00
Bjarne Koll
79e2cb620e
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
376e37db SPIGOT-7677: Update which entities are marked as spawnable
06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE
19b7caaa SPIGOT-7731: Spawn eggs cannot have damage
e585297e PR-1022: Add force option to Player#spawnParticle
d26e0094 PR-1018: Add methods to get players seeing specific chunks
8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance
4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale
8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks
fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed
4c6c8586 PR-1015: Add a tool component to ItemMeta
6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects
f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType
def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation
53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air

CraftBukkit Changes:
ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE
0dae4c62c Fix spawn egg equality check and copy constructor
ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients
3b6093b28 SPIGOT-7736: Creative spawn egg use loses components
c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage
340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound
fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe()
02456e2a5 PR-1413: Add force option to Player#spawnParticle
6a61f38b2 SPIGOT-7680: Per-world weather command
58c41cebb PR-1409: Add methods to get players seeing specific chunks
16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers
7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance
900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale
bdb40c5f1 Increase outdated build delay
d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization
b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed
3ec31ca75 PR-1405: Add a tool component to ItemMeta
5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects
960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType
94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls
a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false
87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues
2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events
ba2d49d21 Increase outdated build delay

Spigot Changes:
fcd94e21 Rebuild patches
342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
Bjarne Koll
906df69f05
Prevent internal NPE on ItemStack#damage (#10836)
ItemStack#damage internally uses ItemStack#hurtAndBreak, which
previously would call a Consumer in case the item broke.
Since 1.20.5 the break game event logic however resides in said method
and was using the equipment slot passed, which is null in the case of
the API ItemStack#damage method.

This commit prevents the NPE by first null checking the slot.
Addittionally, hurtAndBreak also now checks if the player has infinite
materials, e.g. is in creative mode, to prevent damaging the item.

As such as filter is undesirable for API calls, this commit also skips
this logic in case of an API invocation.
2024-06-10 08:24:52 +02:00
Lulu13022002
bd5867a96f
Handle alpha channel from potion_contents component (#10808) 2024-06-04 16:55:29 -04:00
Jake Potrebic
88d76d9fe5
Make Bogged implement Shearable (#10844) 2024-06-04 16:26:40 -04:00
Jake Potrebic
79c1ce1844
Add since to deprecated for removals (#10848) 2024-06-04 15:40:18 -04:00
Spottedleaf
4f13be937e Do not perform chunk existance check for I/O scheduling
In order to check if a chunk exists, the RegionFile lock
(if the RegionFile is opened) will be acquired. However,
the RegionFile may be performing I/O operations, in which
case will stall the acquire operation.

To ensure that threads scheduling loads do not incur a stall,
we can avoid this check entirely - the RegionFile I/O
thread(s) will eventually perform the exist check itself.
2024-06-03 13:31:41 -07:00
Bjarne Koll
b8f2101c36
Only assign blockstate data if super ctor did not (#10841)
The CraftBlockStateMeta constructor CraftBlockStateMeta(Map) invokes its
parent constructor, which itself invokes deserializeInternal, which is
implemented on CraftBlockStateMeta to read the components and block
entity tag from the passed map.

Field initialization happens after the call to the super constructor,
meaning the current code overwrites the parsed internal data with the
EMPTY defaults.

This is prevented by moving the initialization into its own code block
that can null check the fields prior to defaulting their value to EMPTY.
2024-06-03 10:39:20 -07:00
Jake Potrebic
54fbd0cf0c
clarify what getEntityId actually returns (#10839) 2024-06-03 10:20:43 -07:00
Jake Potrebic
ac647513b2
Use RegistryOps in the correct places (#10843) 2024-06-02 15:19:17 -07:00
Bjarne Koll
5d8e53d78d
Fix CommandSourceStack#bypassSelectorPermissions (#10837)
The previous implementation would throw a command exception if the
CommandSourceStack had its bypassSelectorPermissions flag set to true,
which is the incorrect behaviour.

Instead, it should only throw an exception if the flag is set to false
and all its other checks "fail" too.
2024-06-01 16:26:11 +02:00
Jake Potrebic
0513374b1f
Fire TabCompleteEvent for legacy commands (#10834) 2024-05-31 17:46:42 +02:00
TotalledZebra
3181470ad7
Add entity heal API (#10267) 2024-05-30 22:31:45 +02:00
Jake Potrebic
a47e11d464
fix knockback events (#10831)
* fix knockback events

* squash

* handle cancelled event for explosions
2024-05-30 13:17:16 -07:00
Jason Penilla
06e69c8991
Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826) 2024-05-30 11:32:43 -07:00
Shane Freeder
8e6554a80a
Fix sending disconnect packet in phases where it doesn't exist 2024-05-30 19:05:39 +01:00
Jake Potrebic
0fcf3e347f
Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784) 2024-05-29 14:56:14 -07:00
SoSeDiK
27d2ed84f4
Extend fishing API (#10634)
Adds a missing fishing state when the fish is lured and fires an event for it.
Also adds a way to control the fish swimming time towards the bobber.
2024-05-29 23:45:01 +02:00
Jake Potrebic
efd91e52a6
Add registry-related argument types (#10770)
* Add registry-related argument types

* fix tests
2024-05-29 14:11:52 -07:00
Jake Potrebic
a31dc90741
Several fixes and new api for experience merging/stacking (#9242) 2024-05-29 22:58:57 +02:00
Bjarne Koll
ed85aac53c
Flatten namespaced vanilla command alias redirects (#10821)
The brigadier command dispatcher is not capable of executing commands
that redirect more than one.
The exemplary alias 'minecraft:tp' may hence not redirect to 'tp' it
instead has to redirect to 'teleport' as 'tp' itself is merely a
redirect.
2024-05-29 21:47:07 +02:00
Jake Potrebic
7e2b682e54
Fix skipping custom block entity tag (#10812) 2024-05-29 21:22:51 +02:00
Jake Potrebic
d9e659a618
Allow firework effects with no colors (#10814) 2024-05-29 20:50:44 +02:00
Jake Potrebic
716b868b08
Use RegistryOps for loadAdvancement (#10799) 2024-05-29 20:27:29 +02:00
Jake Potrebic
672c07728f
handle BODY slot for non-mobs (#10822) 2024-05-29 11:23:51 -07:00
Lulu13022002
84f6e6e0b1
Fix max temper API for llama (#10823) 2024-05-29 11:17:56 -07:00
Bjarne Koll
9d6f2cced7
[ci skip] Rebuild patches (#10803) 2024-05-28 14:19:41 +02:00
Bjarne Koll
b0c9b9c4d8
Only remove worldgen block entity on changed block (#10794) 2024-05-28 11:45:03 +02:00
Shane Freeder
23fe1166d4
Fix missing debug trace 2024-05-27 18:33:34 +01:00
Tamion
347bbe3897
Fix Cancelling BlockPlaceEvent calling onRemove (#10773) 2024-05-27 00:03:48 +02:00
Jake Potrebic
b0e3ca43b8
Prevent NPE if hooked entity was cleared (#10712) 2024-05-26 23:41:30 +02:00
Lulu13022002
841ab4134d
Fix more item desync when an event is cancelled (#10654) 2024-05-26 23:30:45 +02:00
Cross
1b8cdc6d82
Extend Player Interact cancellation to cover Jigsaw blocks (#10719) 2024-05-26 22:54:55 +02:00
Jake Potrebic
6649a171dc
Fix BlockStateMeta equals (#10795) 2024-05-26 22:49:00 +02:00
Lulu13022002
ac4ee06c01
Fix integer overflow for lag compensating eating check (#10797) 2024-05-26 22:35:58 +02:00
Jake Potrebic
9774a52d11
fix and cleanup loot table patches (#10100)
* fix and cleanup loot table patches

* fixes
2024-05-26 12:51:15 -07:00
Lulu13022002
ca50b87947
Clear firework item properly (#10793) 2024-05-26 19:57:38 +02:00
Jake Potrebic
a7ae966530
readd itemstack data sanitization (#10454)
* readd itemstack data sanitization

* use autocloseable
2024-05-26 10:56:33 -07:00
Jake Potrebic
4e10fadfdc
reset meta block state on BlockStateMeta#setBlockState 2024-05-25 22:36:55 -07:00
Jake Potrebic
41bee55b53
Fix NPE for color-related metas
Fixes #10789
2024-05-25 19:55:51 -07:00
Janet Blackquill
f0bd0cca8f
Expose anvil cost in the API (#10682) 2024-05-26 01:47:14 +02:00
Jake Potrebic
26e90b9ffb
Fix CraftMetaBlockState for data components (#10731)
This will go on forever...
2024-05-25 16:37:35 -07:00
Lulu13022002
535dca56c2
Fix a few issues with ItemMeta (#10740) 2024-05-26 00:58:56 +02:00
jake-brennan714
4fd3ac00b4
[ci skip] Update Player#getListeningPluginChannels Jdoc (#10778) 2024-05-25 23:59:01 +02:00
Lulu13022002
dff591d292
Allow to define new map cursor types (#10782) 2024-05-25 23:56:44 +02:00
TonytheMacaroni
377733d44c
Use getter/setter on Mob for equipment drop chances (#10780) 2024-05-24 19:52:54 +02:00
Shane Freeder
3004717b0e
Do not re-wrap vanilla goals (#10751)
There is no need to rewrap vanilla goals when they're being reregistered,
this breaks some expectations around behavior outside of general
wasting of resources.

Resolves: #10743
2024-05-24 16:22:41 +02:00
Jason Penilla
5e7b65a9a9
Allow using PluginLoader classpath API from Bukkit plugins (#10758)
Allows using the PluginLoader API without any of the other changes imposed by switching to a paper-plugin.yml.

Used by setting paper-plugin-loader in plugin.yml to the class name of your PluginLoader.

Also allows skipping the libraries field by setting paper-skip-libraries to true (by default both libraries and jars provided by the PluginLoader are added to the classpath).
2024-05-23 13:13:02 -07:00
Jake Potrebic
2a90732677
Remove incorrect logic for Fireball#setVelocity (#10764) 2024-05-23 12:48:11 -07:00
Jake Potrebic
6de7a1f052
Improve default item attributes API (#10765) 2024-05-23 11:44:07 -07:00
Jason Penilla
d408381c77
Print CommandRegisteredEvent deprecation warnings again (#10756) 2024-05-23 10:44:45 -07:00
Jake Potrebic
3de408ee3e
Fix equipment slot and group API (#10767) 2024-05-23 10:39:44 -07:00
Jake Potrebic
a9201d4a7d
[ci skip] Move logic in our patches to ItemType/BlockType (#10772) 2024-05-23 10:32:02 -07:00
Jake Potrebic
b14958485d
Always show command exception stack traces in logs (#10766) 2024-05-22 10:24:09 -07:00
Jake Potrebic
d3ffa62b7f
fix default item attributes 2024-05-22 07:16:50 -07:00
Spottedleaf
980cff9f29 Fix compile 2024-05-21 08:41:36 -07:00
Spottedleaf
66cb880754 Remove ThreadedWorldUpgrader patch
The patch does not implement Vanilla forceUpgrade behavior.
Specifically, poi/entity conversion and regionfile recreation.

The Vanilla force upgrader is also no longer broken by CB, so the
bug fixes from this patch are not relevant anymore.
2024-05-21 08:21:28 -07:00
Jason Penilla
9bf4855524
Add a better warning message than "Server performance will be affected" for CommandRegisteredEvent use (#10754) 2024-05-20 11:15:21 -07:00
Jake Potrebic
7d2e5c33ea
Add an 'empty' RecipeChoice for certain ingredient slots (#10710) 2024-05-20 07:20:47 -07:00
Jake Potrebic
591521e697
Check for more correct profile validation (#10730) 2024-05-19 17:45:43 -07:00
Jake Potrebic
b3b340617e
fix CompassMeta not being correct (#10737) 2024-05-19 17:15:44 -07:00
Shane Freeder
0ad09de75b
Make PaperSimplePluginClassLoader show class which is not found 2024-05-18 21:17:54 +01:00
Jake Potrebic
5a9afbee65
Fixes issues in the suppress dismount cancellation patch (#10735) 2024-05-17 14:37:16 -07:00
Jake Potrebic
d8d59e0cde
Fix NPE sending resource pack without prompt
Fixes KyoriPowered/adventure#1075
2024-05-17 14:22:45 -07:00
Riley Park
f17519338b
Expose server build information (#10729)
* Expose server build information

* squash patches

* final tweaks

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: masmc05 <masmc05@gmail.com>
2024-05-15 17:06:59 -07:00
Jason Penilla
3fc93581bb
Show stacktrace when modifyItemStack fails 2024-05-13 22:58:50 -07:00
Jason Penilla
2faa3b2f44 Correctly copy alias requirements in command upgrader
Fixes NPE when converting namespaced commands.

Since the brigadier command api, more aliased commands
(namespaced variants) are registered in the vanilla dispatcher,
which made this issue more apparent.
2024-05-13 15:55:15 -07:00
Spottedleaf
bebcc9cc93 Make exception during command conversion non-fatal
Instead of allowing chunks to fail to convert completely,
simply log the exception and the offending command. Command
conversion failure should never result in chunk data deletion,
as commands are not critical chunk data.
2024-05-13 14:40:02 -07:00
Jake Potrebic
218d33ccb1
fix creating complex recipes that have air results
Fixes #10715
2024-05-13 06:16:52 -07:00
Jake Potrebic
0688f212f5
Better way to keep paper datapack enabled 2024-05-12 21:48:07 -07:00
Jake Potrebic
11c39637de
Improve Recipe validation (#10707) 2024-05-12 13:46:46 -07:00
Bjarne Koll
f041f48458
Prevent infinite recursion on cyclic brig redirect (#10705)
Prevent infinite recursion when declaring a cyclic relation between
command nodes via child nodes redirecting to an nth parent by marking a
command node as unwrapped before unwrapping its children.
2024-05-12 17:41:21 +02:00
Owen
7e48f66c05
Properly pass requirement on namespaced redirects (#10701) 2024-05-11 23:46:42 -07:00
Jason Penilla
711f82e01e
Fix signed book page serialization (#10696) 2024-05-12 00:13:18 +02:00
Jake Potrebic
ac554ad46d
Updated Upstream (Bukkit/CraftBukkit) (#10691)
Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fa99e752 PR-1007: Add ItemMeta#getAsComponentString()
94a91782 Fix copy-pasted BlockType.Typed documentation
9b34ac8c Largely restore deprecated PotionData API
51a6449b PR-1008: Deprecate ITEMS_TOOLS, removed in 1.20.5
702d15fe Fix Javadoc reference
42f6cdf4 PR-919: Add internal ItemType and BlockType, delegate Material methods to them
237bb37b SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent
035ea146 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it
8c7880fb PR-1004: Improve field rename handling and centralize conversion between bukkit and string more
87c90e93 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent

CraftBukkit Changes:
4af0f22e8 SPIGOT-7664: Item meta should prevail over block states
c2ccc46ec SPIGOT-7666: Fix access to llama and horse special slot
124ac66d7 SPIGOT-7665: Fix ThrownPotion#getEffects() implementation only bringing custom effects
66f1f439a Restore null page behaviour of signed books even though not strictly allowed by API
6118e5398 Fix regression listening to minecraft:brand custom payloads
c1a26b366 Fix unnecessary and potential not thread-safe chat visibility check
12360a7ec Remove unused imports
147b098b4 PR-1397: Add ItemMeta#getAsComponentString()
428aefe0e Largely restore deprecated PotionData API
afe5b5ee9 PR-1275: Add internal ItemType and BlockType, delegate Material methods to them
8afeafa7d SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent
4e7d749d4 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it
441880757 Support both entity_data and bucket_entity_data on axolotl/fish buckets
0e22fdd1e Fix custom direct BlockState being not correctly set in DamageSource
f2182ed47 SPIGOT-7659: TropicalFishBucketMeta should use BUCKET_ENTITY_DATA
2a6207fe1 PR-1393: Improve field rename handling and centralize conversion between bukkit and string more
c024a5039 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent
741b84480 PR-1390: Improve internal handling of damage sources
0364df4e1 SPIGOT-7657: Error when loading angry entities
2024-05-11 23:48:37 +02:00
Owen
b98d20a8ac
Brigadier Command Support (#8235)
Adds the ability for plugins to register their own brigadier commands 

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2024-05-11 16:30:30 -04:00
Jake Potrebic
6c02dbcfa1
handle recent ItemMeta changes in serialization logic 2024-05-11 09:14:23 -07:00
Jake Potrebic
a61d58d467
adjust ItemMeta to distinguish null and empty modifiers
Fixes #10686 (again)
2024-05-11 07:16:23 -07:00
Jake Potrebic
cdb6ba8ef1
Fix keepalive time interval (#10690) 2024-05-10 17:23:58 -07:00
Jake Potrebic
39532a1f8c
Fix stacks losing empty attr modifiers
Fixes #10686
2024-05-10 12:05:07 -07:00
Jason Penilla
4fd58a1b8f
Add conversion for summon command 2024-05-10 12:57:07 +02:00
Nassim Jahnke
7f1a154d15
Add validation to player profile and properties (#10680) 2024-05-10 12:52:03 +02:00
Spottedleaf
8748ae16ac Use MCDataConverter instead of raw convert call for cmd converter
MCDataConverter uses the breakpoint system, which for future
updates may be neccesary (probably not).

Also, add the 1.20.6 version field.
2024-05-10 00:34:37 -07:00
Joseph Burton
2df1dace32 Fix DataConverter ConverterParticleToNBT.parseProperties
- The old code was using `StringReader.peek()` in a place where it meant to be `StringReader.skip()`.
- The vanilla code allows a trailing comma, but only if there is no whitespace between it and the closing bracket, which is a bit weird. I think that's a bug and it shouldn't allow trailing commas, but if you disagree then only the first issue needs to be fixed.
2024-05-10 00:32:31 -07:00
Spottedleaf
b56e92f3d4 Fix chunk data version check not running in chunk system
The old read() method should just redirect to the new
chunk system method, however due to an error in moving
the chunk system patch around the data version check was
left in the old (UNUSED) read() method.
2024-05-09 23:47:13 -07:00
Spottedleaf
cc29d2b7d5 Invalidate PathTypeCache when pathfinding updates are disabled
The configuration should not allow the cache to break. Additionally,
invalidating the cache is cheap and as such there is no gain to avoid
invalidating it.
2024-05-09 23:07:32 -07:00
Spottedleaf
1b67e02385 Fix entity tracker desync when new players are added to the tracker
The delta position packet instructs the client to update
the entity position by a position difference. However, this position
difference is relative to the last position in the entity tracker
state, not the last position which has been sent to the player. As
a result, if the last position the player has recorded is different
than the one stored in the entity tracker (which occurs when a new
player is added to an existing entity tracker state) then the sent
position difference will cause a position desync for the client.

We can resolve this problem by either tracking the last position
sent per-player, or by simply resetting the last sent position
in the entity tracker state every time a new player is added.
Resetting the last sent position every time a new player is
added to the tracker is just easier to do, so that is what
this patch does.
2024-05-09 17:08:59 -07:00
Nassim Jahnke
f2512b1238
Print data component type on encoding error 2024-05-09 15:12:12 +02:00
Shane Freeder
5729b294ee
Update Adventure to 4.17.0 Release 2024-05-08 15:48:45 +01:00
Bjarne Koll
eee55d019f
Correctly compare holders in BeaconMenu (#10673) 2024-05-07 18:18:57 -07:00
Lulu13022002
89ad61fd00
Fix hopper pull event being skipped after the first call (#10667) 2024-05-07 14:28:45 +02:00
Jason Penilla
9e51f94941
Fix ping event always receiving protocol version 0 (#10671) 2024-05-07 14:24:45 +02:00
Jake Potrebic
ac3a5471c8
Fix BlockStateMeta (#10647)
* Fixes CraftMetaBlockState block entity data components

* rebase and merge into general item meta fix

* Add javadoc notice

* Update message

---------

Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2024-05-05 12:56:46 -07:00
SoSeDiK
2a6a5fef59
Add a way to check whether the chest is blocked (#10635)
* More Chest Block API

* rebased and slight logic fixes
2024-05-05 10:57:28 -07:00
Bridge
21d91ce634
Prevent profile lookups when unnecessary (#10651) 2024-05-05 19:07:30 +02:00
Tamion
716dfd8698
Fix EntityLoadCrossbowEvent (#10645)
* fix

* hehe
2024-05-05 09:54:04 -07:00
Lulu13022002
816ea9ecd5
[ci skip] Update old particle reference in javadoc (#10652) 2024-05-05 18:44:06 +02:00
NonSwag
54c5ecb4e4
Add missing SpigotConfig logCommands check (#10659) 2024-05-05 18:41:02 +02:00
Nostal Yuu
0e43d3c103
Added API to get player's proxy address (#10400) 2024-05-05 18:39:32 +02:00
Jake Potrebic
9d8d38d137
Updated Upstream (CraftBukkit) (#10646)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
66fd94322 SPIGOT-7652: Remove remap for SPELL_MOB_AMBIENT which no longer exists
ecfa4f973 SPIGOT-7654: ItemStack#isSimilar does not work with empty BlockStateMeta
4460ecc49 SPIGOT-7655: ItemMeta#addItemFlags(ItemFlag.HIDE_ATTRIBUTES) not working when no attribute modifiers set
5d84f48a4 SPIGOT-7653: Update ApiVersion.CURRENT with latest version and include tests
2024-05-05 18:08:55 +02:00
Lulu13022002
b13c7dbe36
Add missing experimental field and annotations (#10653) 2024-05-05 09:00:54 -07:00
Bjarne Koll
7ae2c671c6
Keep components using single items in creative (#10664)
The craftbukkit implementation stores the old and new data patch of an
item during ItemStack#useOn(UseOnContext) to properly cancel events via
comparison and change detection of the component patch.

However, it uses #getComponentsPatch to fetch the new stack component
patch, which always yields an empty patch set if an itemstack is
considered empty by the game.
As the restoration of an itemstack's count to its previous state is
handled after the entire ItemStack#useOn method, items used in creative
mode temporarily have a count of zero, which causes craftbukkit to
consider their new component patch as EMPTY even tho said item may have
data.
The new patch is applied and, after useOn completes, the count is reset
if the player is in creative mode, leading to lost data.

This commit fixes said inconsistency by directly accessing the
components of the item via components#asPatch, storing the proper
component patch even for an item that temporarily has a count of zero.
2024-05-05 11:40:36 +02:00
Jake Potrebic
7401313e16
fix shear drops for wolf and bogged
Fixes #10661
2024-05-04 22:48:10 -07:00
Nassim Jahnke
6fcca46674
Add missing step in V3818 2024-05-04 22:50:20 +02:00
Jake Potrebic
5632210f10
add RegistryAccess for managing registries (#10154)
* add RegistryAccess for managing registries

* add missing types to key data generator

* fix some stuff

* Add RegistryKeys for all other non-server-backed registries

* fix tests

* remove Experimental annotations
2024-05-04 11:22:35 -07:00
Joseph Burton
156675c773
Fix lodestone compass target conversion 2024-05-04 12:58:06 +02:00
Joseph Burton
0db72ac19e
Fix can_place_on conversion and size check for item containers 2024-05-02 20:23:15 +02:00
Shane Freeder
59fe7ccc3b
default save-empty-scoreboard-teams to vanilla
The primary environmental factor which caused this feature to be implemented
is no longer much of a factor within the community
2024-05-02 09:53:43 +01:00
SoSeDiK
544ce20e01
Expose #hasColor to leather armor (#10638) 2024-05-01 19:14:42 +02:00
SoSeDiK
18c201b838
Add EquipmentSlot#getOppositeHand (#10632) 2024-05-01 19:14:27 +02:00
SoSeDiK
faa7aa266a
Add GameMode#isInvulnerable (#10633) 2024-05-01 19:14:17 +02:00
Nassim Jahnke
310b47bb96
Update Java version references, add note on var usages 2024-05-01 18:44:39 +02:00