Commit graph

3082 commits

Author SHA1 Message Date
Spottedleaf
e3d92c508f Do not try to stop main thread during watchdog shutdown
In Java 21, Thread#stop is no longer implemented and wiill throw
an exception when called. As a result, we simply cannot halt
the main thread during shutdown anymore.
2024-07-15 12:46:23 -07:00
Spottedleaf
043559513c Apply automatic regionfile header recalculation patch 2024-07-15 12:20:47 -07:00
Spottedleaf
900c617ae5 Apply incremental player/level saving patch 2024-07-15 11:57:56 -07:00
Spottedleaf
479ca6ef4d Port random ticking optimisation from Moonrise 2024-07-15 11:11:04 -07:00
Spottedleaf
e08de25a2a Avoid collision shapes outside world border in findFreePosition
This is to correctly adhere to Vanilla behavior.
2024-07-15 09:56:17 -07:00
Lulu13022002
084923b9ac Call PlayerLaunchProjectileEvent for wind charge (#10911) 2024-07-15 17:07:07 +02:00
Jake Potrebic
14b789b68a Add ItemType#getItemRarity (#11049) 2024-07-15 07:38:20 -07:00
powercas_gamer
5e9272f83c Add Plugin#getDataPath (#11080) 2024-07-15 14:07:17 +02:00
Tamion
137019f867 Fix HelpCommand searching (#11066)
Prevent a IOB exception when querying topic
suggestions on query string `/`.

Additionally hide help topics indices if no topics
are visible to the player requesting them.
2024-07-15 12:42:10 +02:00
Malfrador
656cc3915f Add AttributeModifier constructor without EquipmentSlotGroup (#11079) 2024-07-15 12:31:41 +02:00
Lulu13022002
b8af72fa88 Don't require author and title to be set on signed book meta (#11068) 2024-07-14 15:33:52 +02:00
Nassim Jahnke
c1d9a67e3f Add default canUse and permission methods to BasicCommand (#11047) 2024-07-14 14:04:38 +02:00
Nassim Jahnke
13940e5a97 Make watchdog thread extend TickThread again 2024-07-14 13:58:27 +02:00
Spottedleaf
7c3194af85 Update last chunk position in findSupportingBlock
Fixes fetching chunks needlessly multiple times.

Thanks Lulu13022002 for pointing this out
2024-07-13 11:44:52 -07:00
Bjarne Koll
1b20e12355 Bulk bugfixes for itemstack damage API (#11063)
A general set of bugfixes for itemstack damage related logic.

1. Prevent NPE when calling deprecated ItemStack#getMaxItemUseDuration()
2. Do not apply enchantments when damaging items via API
3. Do not error when passing a null equipment slot to hurtAndBreak
4. Correctly call PlayerItemBreakEvent
2024-07-12 20:47:08 +02:00
Nassim Jahnke
32d0bfcdea Readd async saveddata io 2024-07-12 17:58:54 +02:00
Bjarne Koll
cb518f9878 Only skip damage tick if damage is unmodified zero (#11058)
Only skip the damage tick logic on player entities if the original
damage was zero and was not modified by plugins down the line.

This way all the following three scenarios trigger the damage tick

  a) vanilla damage was 0, plugin set it to non zero
  b) vanilla damage was non zero, plugin did not modify it
  c) vanilla damage was non zero, plugin set it to zero.

Regarding case c, the argument here is that EntityDamageEvent#setDamage
should not modify the damage tick logic.
2024-07-12 09:47:50 +02:00
Nassim Jahnke
be464edaf2 Add light block to indestructible block list 2024-07-12 09:24:37 +02:00
Shane Freeder
12356fbe77 Fix explosions calculation getting stuck (#11061)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2024-07-12 08:16:03 +01:00
Spottedleaf
467c178970 Port watchdog detail patch 2024-07-11 12:28:27 -07:00
Spottedleaf
235d6cc2dd Port lag compensation patch 2024-07-11 12:22:59 -07:00
Spottedleaf
8a7d58d082 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:11:49 -07:00
Spottedleaf
1237931f88 Port collision optimisation patch from Moonrise
Drop random ticking optimisation for now
2024-07-11 12:09:15 -07:00
Spottedleaf
bde31b3ce4 Optimise entity tracker
Patch is ported from Folia
2024-07-11 09:23:56 -07:00
Spottedleaf
68cacfe830 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
eea4ab322d 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:32:15 -07:00
Spottedleaf
14eb93fb65 Apply entity tracker desync patch 2024-07-11 08:15:36 -07:00
Spottedleaf
ed3350e66e 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
76d8369ad4 Fix method reflection remapping with null parameter types passed
Fixes #11052
2024-07-10 18:21:33 +02:00
Bjarne Koll
360b879fa0 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
9300b8714a 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
f3655a41ab Fix entity distance check when applying knockback
Fixes #11036
2024-07-07 19:27:45 +02:00
Jake Potrebic
eb450b6025 Fix horse inventories (#11028) 2024-07-06 14:25:23 -07:00
Bjarne Koll
980b33a6d0 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
5cc2489fef 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
9253ea8b42 Fix respawn error due to null location
Closes #11017
2024-07-04 16:20:03 +02:00
Nassim Jahnke
37b7551e48 Readd more patches 2024-07-04 12:34:11 +02:00
Spottedleaf
7058cbc1aa 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:00 -07:00
powercas_gamer
ce499f57d6 [ci skip] add adventure-key javadoc (#11014) 2024-07-02 22:52:04 +02:00
granny
ad222d4ad1 Fix summon_entity effect attempting to add incorrect entity (#11004) 2024-07-01 01:16:07 -07:00
Nassim Jahnke
f148164419 Add forRemoval to material data deprecations (#10996)
2018 is calling
2024-06-29 10:58:37 +02:00
Nassim Jahnke
d097e7cec1 Change item/xp merge and entity tracking range defaults (#10986) 2024-06-27 22:08:34 +02:00
Spottedleaf
17824b557c 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:58:31 -07:00
Jake Potrebic
eaaeed5041 bump reflection-rewriter to 0.0.3 (#10969) 2024-06-23 16:39:45 -07:00
Lulu13022002
acbaa46a96 Swap some nullable annotations (#10960) 2024-06-24 00:42:44 +02:00
Jake Potrebic
fed26cf9a8 Bump reflection-rewriter to 0.0.2 (#10927) 2024-06-23 15:29:50 -07:00
Jake Potrebic
e015c297db Call EntityPortalEnterEvent on endgateways and make cancellable (#10892) 2024-06-23 15:01:12 -07:00
Lulu13022002
35acc5b73b Fix speed for launched trident using api (#10936) 2024-06-23 23:37:20 +02:00
Lulu13022002
189504bc7f Fix StackOverflowError for new dispenser interaction (#10949) 2024-06-23 22:24:17 +02:00
SoSeDiK
079105010e Expose LivingEntity#canUseSlot (#10930) 2024-06-23 23:11:39 +03:00
Lulu13022002
2891c40adb Add missing effect cause and deprecate PATROL_CAPTAIN cause (#10958) 2024-06-23 22:08:13 +02:00
scarfacered
ef2ce51913 Fix SoundEffects only to players diff (#10966)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2024-06-23 16:03:32 -04:00
Shane Freeder
69258a8c33 Do not crash when an exp orb attempts to mend an unrepairable item 2024-06-23 14:04:58 +01:00
Lulu13022002
8c6ba348c9 Fix wrong diff applying delta twice (#10959) 2024-06-22 20:11:34 +02:00
Pedro
f5e0f69e72 Fix PlayerShearBlockEvent drops ignored for Pumpkin (#10956) 2024-06-22 09:50:47 -04:00
Spottedleaf
89961bad94 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
31ddf26e18 Preserve velocity for fireball (#10934) 2024-06-21 20:06:31 +02:00
Lulu13022002
ffff490cc8 deprecate and update some entity tags (#10932) 2024-06-21 18:51:00 +02:00
Lulu13022002
58268601ac Validate using_converts_to for food component (#10931) 2024-06-21 18:48:48 +02:00
Lulu13022002
22e64d8059 Fix NPE of AbstractArrow#getWeapon (#10933) 2024-06-21 18:48:29 +02:00
Lulu13022002
5c5a5fb93c Fix base damage for trident (#10948) 2024-06-21 18:48:18 +02:00
Shane Freeder
28238907c1 Revert "Fixes exception log messages getting dropped during bootstrap (#10935)" (Closes #10945)
This reverts commit 05dd6c2bec.
2024-06-21 10:05:27 +01:00
Shane Freeder
71f3228b5c Fix diff in sprint interruption option (Closes #10939) 2024-06-21 01:21:23 +01:00
Jake Potrebic
05dd6c2bec Fixes exception log messages getting dropped during bootstrap (#10935) 2024-06-20 11:26:07 -07:00
Lulu13022002
26fd1c1b56 Validate speed for tool component rule (#10923) 2024-06-20 18:32:32 +02:00
Lulu13022002
461f02dce2 Experimental annotation changes (#10914)
* Experimental annotation changes

* wind charge damage type is not experimental anymore
2024-06-20 18:03:09 +02:00
Lulu13022002
a362e724b2 Fix jukebox playable component not being applied on item meta (#10922) 2024-06-20 17:57:56 +02:00
Spottedleaf
72883ff600 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
287baeab18 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
e985ffabb2 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
3c4ca08b26 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
45ae3a360b 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
311fbf4a30 Re-add fixlight command 2024-06-19 08:37:12 -07:00
Jason Penilla
2475b329fa Add ticket for chunk load in isChunkGenerated 2024-06-18 21:15:20 -07:00
Jason Penilla
15c0e90d6e 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:13 -07:00
Jason Penilla
6ae5176a52 Add missing null check to getFullChunkIfLoaded
fixes #10915
2024-06-18 18:27:50 -07:00
Jason Penilla
acc349cf7d 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
aaf37cb47d 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
97bd52887e Use ItemStack.empty() when air is passed into constructor 2024-06-18 15:31:30 +02:00
Bjarne Koll
8d4decb590 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
59da9d1a80 Fix NPE for Jukebox#setRecord
Fallback to the global registry if no level exists
Fixes #10899
2024-06-17 17:42:48 -07:00
Emilia Kond
ffa51cc8b0 [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-18 00:54:49 +03:00
willkroboth
7887bddbae Fix hasFiredAsync parameter when AsyncPlayerSendCommandsEvent is called (#10896) 2024-06-17 21:16:55 +02:00
Jake Potrebic
70f3730d25 Delegate ItemStack (#10852) 2024-06-17 12:12:42 -07:00
Nassim Jahnke
27a9efdca5 Make chunk system loggers calm down a bit 2024-06-17 13:43:21 +02:00
Nassim Jahnke
08a87667f7 Add back improved watchdog support patch 2024-06-17 13:36:43 +02:00
Jake Potrebic
a9fdf73f2e make EntityPortalReadyEvent#setTargetWorld work again 2024-06-16 15:48:38 -07:00
Jake Potrebic
1862266320 remove remaining reference to 'pgive' 2024-06-16 15:38:59 -07:00
Jake Potrebic
bb6b0b4cb1 Enchantment and GameEvent Registry builders (#10889)
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2024-06-16 15:00:12 -07:00
Nassim Jahnke
e816087107 Fix legacy cb version in remapper 2024-06-16 23:23:50 +02:00
Spottedleaf
50fedea85f 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
25c3a98398 Registry Modification API (#10893)
* Registry Modification API

* some fixes

* even more fixes
2024-06-16 12:39:59 -07:00
Nassim Jahnke
c675152a56 Fix getAddress connection check 2024-06-16 21:31:39 +02:00
Jake Potrebic
bff551166c call EntityDamageItemEvent for thorns 2024-06-16 09:47:53 -07:00
Bjarne Koll
07e821664d Update Wither#canTravelThroughPortals 2024-06-16 18:04:11 +02:00
Bjarne Koll
d04e9fafa4 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:21:14 +02:00
Jake Potrebic
35a678ddb3 update 'improve mass craft perf' patch 2024-06-16 08:08:06 -07:00
Jakub Zacek
b6b5a57b8b Add Adventure API to ServerLinks (#10891) 2024-06-16 13:54:38 +02:00
Nassim Jahnke
78a67f00ea 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
fc90ea0624 Add back more patches 2024-06-16 12:47:57 +02:00
Bjarne Koll
3753d8b292 De-deprecate BlockData#getDestroySpeed 2024-06-16 12:44:22 +02:00
Yannick Lamprecht
f594b47eda address compile and test issue (#10890) 2024-06-16 11:47:44 +02:00
Spottedleaf
f63023a6ac Fix NPE in V3808
The armor items may not exist, so we need to null check it.
2024-06-15 22:57:01 -07:00
Owen1212055
c4a1f15d70 Restore functionality to sand dupe setting 2024-06-15 22:04:02 -04:00
Owen1212055
0410d79c1d Owen fixing stuff!!! 2024-06-15 21:43:06 -04:00
Spottedleaf
f679845d59 Remove unnecessary changes from chunk status fix 2024-06-15 15:31:04 -07:00
Bjarne Koll
a2c7a9b490 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
26f246b908 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
cffcda2bc7 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:09:34 +02:00
Aya
87aea64a44 Add back RecipeIterator fixes patch (#10887) 2024-06-15 20:49:08 +01:00
Jake Potrebic
80cb0a621b correctly change enchantment registry to a 'delayed' version 2024-06-15 12:04:06 -07:00
Nassim Jahnke
3a74801788 Fix max chunk status checks 2024-06-15 19:57:59 +02:00
Nassim Jahnke
b81fffb934 Add back more optimization patches 2024-06-15 19:24:11 +02:00
Bjarne Koll
128085ba3e 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
967ee0c7b1 Merge remote-tracking branch 'origin/dev/1.21' into dev/1.21 2024-06-15 18:52:19 +02:00
Bjarne Koll
22595ec4c0 Revert DamageSource#getCausingEntity to vanilla 2024-06-15 18:39:55 +02:00
Nassim Jahnke
efb91589dc 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:28:18 +02:00
Ghast
4c472e3401 Fix ItemMeta#removeEnchantments (#10886) 2024-06-15 17:26:55 +02:00
Jake Potrebic
87f8c7ca9b Fix Player#sendBlockState (#10855) 2024-06-15 08:05:21 -07:00
Jake Potrebic
2053f3bd83 Update AbstractArrow item method implementations for 1.20.6 (#10885) 2024-06-15 16:40:29 +02:00
Nassim Jahnke
9b3cf41d7a Update more optimization patches 2024-06-15 14:12:22 +02:00
Spottedleaf
fddfa624cf 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:19:25 -07:00
Jake Potrebic
9b34dc14d9 remove api that was scheduled for removal 2024-06-14 14:07:44 -07:00
Spottedleaf
2bfea35de3 Update ConcurrentUtil
Mostly for the primitive long to reference hashtable impl
2024-06-14 10:47:33 -07:00
Spottedleaf
6b1346c1f6 DataConverter 1.21 2024-06-14 10:34:45 -07:00
Spottedleaf
e9068d28c6 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
3f581a6024 Fix body equipmentslot and effect enum 2024-06-14 18:53:32 +02:00
Nassim Jahnke
1aee096320 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:14:55 +02:00
Nassim Jahnke
201427a880 Make it compile 2024-06-14 18:02:15 +02:00
Bjarne Koll
492de57f77 Adopt previous commit changes in API 2024-06-14 16:02:59 +02:00
Bjarne Koll
f548e7fbd5 Some work on the ItemMend events 2024-06-14 16:01:00 +02:00
Bjarne Koll
be8b9314b4 Pretend to fix compile errors 2024-06-14 15:16:29 +02:00
Nassim Jahnke
d29210d668 Fix more compile issues 2024-06-14 14:28:06 +02:00
Nassim Jahnke
bcdf841f2d Fix more compile issues 2024-06-14 14:11:52 +02:00
Nassim Jahnke
9206b1ea14 Fix a few compile errors 2024-06-14 13:07:50 +02:00
Bjarne Koll
7289589315 988 2024-06-14 11:59:44 +02:00
Bjarne Koll
8a6e31ec59 960 2024-06-14 11:07:50 +02:00
Bjarne Koll
2b73df0fd7 956 2024-06-14 10:56:28 +02:00
Bjarne Koll
4eaa335676 922 2024-06-14 10:17:11 +02:00
Jason Penilla
0785c29a37 update some patches 2024-06-13 20:41:44 -07:00
Jake Potrebic
a0f4d303eb 788/1053 2024-06-13 18:30:23 -07:00
Jake Potrebic
4ff15b38e5 650/1053 2024-06-13 17:08:12 -07:00
Jake Potrebic
dfa326fc2f 585/1053 2024-06-13 16:32:45 -07:00
Bjarne Koll
e0f5e2a1d5 538 2024-06-14 00:44:26 +02:00
Jake Potrebic
02d989b548 531/1053 2024-06-13 14:42:02 -07:00
Jake Potrebic
29e69c49da 487/1053 2024-06-13 13:57:13 -07:00
Jake Potrebic
7bcc1a4674 385 2024-06-13 13:14:13 -07:00
Jake Potrebic
e07671b7df 279 2024-06-13 12:04:27 -07:00
Jake Potrebic
9120ce5d4b 194 2024-06-13 11:09:28 -07:00
Jake Potrebic
6a05c85176 117 2024-06-13 10:30:39 -07:00