Commit graph

19060 commits

Author SHA1 Message Date
Nassim Jahnke
3a8f9e0b6e Start update, apply API patches 2024-12-03 17:58:41 +01:00
Bjarne Koll
881d616533 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11702)
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:
ed0ec489 SPIGOT-7965: Unknown TransformReason for Hoglins
9db03457 SPIGOT-7964: Fix typo in Deprecation annotation
d14119af PR-1082: Add "since" to Deprecation annotations
e8a318d4 PR-1067: Add method to get Advancement requirements

CraftBukkit Changes:
40dd796db SPIGOT-7971: NotSerializableException on serialize CraftUseCooldownComponent
fa85c5e0a SPIGOT-7968: ProjectileHitEvent not trigerred when arrow hits entity
b75b792ec SPIGOT-7970: World#getMaxHeight() returning incorrect value
2b9a094bb SPIGOT-7965: Unknown TransformReason for Hoglins
fd3f5a380 SPIGOT-7966: Some trees do not generate with #generateTree
f2822317c PR-1515: Add a Class reader and Class node argument provider
07abf6852 PR-1514: Add a test case for ClassTraverser
a7577cb24 Fix Inventory#addItem not respecting max stack size
066a74e74 PR-1490: Add method to get Advancement requirements
4a1df30e4 PR-1512: Test Art class based on specific values instead of the implementation, to better catch implementation changes
53254c56f PR-1503: Simplify CAS loop to getAndSet
e9447dc5e Make BlockDataMeta#setBlockData hide unspecified states
dd08a7120 SPIGOT-7960: Fix inconsistency between natural item drop coordinates
e9e8ed753 SPIGOT-7960: Improve natural item drop methods

Spigot Changes:
60c9969b Rebuild patches
2024-12-03 15:47:48 +01:00
Nassim Jahnke
0280fbb374 Disable deprecated annotation test 2024-12-03 15:33:45 +01:00
Spottedleaf
65ca4c1911 Fix several off-by-one errors in view distance calculations
1. For NearbyPlayers, we need to be using the view distance, and
   not the load distance (which is +1 of the view distance).
2. Correctly clamp tick distance to view distance. Since
   load distance is +1 of view distance, we need to subtract
   one from the load distance when clamping.

Additionally, add checks inside ViewDistances to ensure that
the inputs are in range to catch future errors.

Also, clamp simulation distance, as values < 0 or above
MAX_VIEW_DISTANCE do not make sense to configure.
2024-12-01 15:43:56 -08:00
Spottedleaf
e9eb96862c Properly handle large values of spawnChunkRadius
The chunk system does not allow ticket levels below 0, so we need
to add tickets for each individual chunk instead.
2024-12-01 14:07:46 -08:00
Spottedleaf
de3742283b Do not break when PlayerNaturallySpawnCreaturesEvent is cancelled
If there is a player nearby which had its event not cancelled,
then that should take precedence.
2024-12-01 13:53:04 -08:00
Spottedleaf
6788ba5e80 Fix non-null initialisation of context collision shape
Force LazyEntityCollisionContext#getEntity() to delegate

- By delegating when the entity is retrieved, we can correctly catch
  cases where the collision method is inspecting some entity state.

Adjust constant collision shape determination

- Our previous hack did not actually catch every case. For now,
  it will only assume a constant collision shape of EMPTY for
  air blocks.

Fixes https://github.com/PaperMC/Paper/issues/11697
2024-12-01 13:43:37 -08:00
MrPowerGamerBR
86e20be366 Only attempt to find spawn position if there isn't a fixed spawn position set (#11682) 2024-12-01 12:44:03 -03:00
Nassim Jahnke
c221e072a3 Fix item_model adapter, rename internal classes
Fixes #11688
2024-11-30 10:56:37 +01:00
Nassim Jahnke
4299c69e13 Add back discard policy 2024-11-30 10:44:57 +01:00
Lulu13022002
326abeaab5 Deprecate ChatVisibility#UNKNOWN (#11683) 2024-11-29 17:12:17 +01:00
Nassim Jahnke
736c78c71e Copy dispatcher root children before passing it into async tree building 2024-11-29 17:04:32 +01:00
Nassim Jahnke
4a5ff5039c Clean up thread pool usage (#11681)
Using an unbound LinkedBlockingQueue means you *have* to set core and max core thread pool size the same, as they will never go above the minimum pool size by just passing them through. So this fixes the async command executor pool to actually use 2 threads, and also cleans up other usage to be explicitly "fixed" thread pool sizes, and splits off one more in Minecraft's Util class
2024-11-29 17:07:35 +01:00
Nassim Jahnke
46ef70e7d1 [ci skip] leaf 2024-11-29 09:44:19 +01:00
Spottedleaf
b37a391c02 Remove chunk save reattempt patch
This patch does not appear to be doing anything useful, and may
hide errors.

Currently, the save logic does not run through this path either
so it did not do anything.

Additionally, properly implement support for handling
RegionFileSizeException in Moonrise.
2024-11-28 17:39:40 -08:00
Spottedleaf
c8457716c4 Use Player view distance for PlayerNaturallySpawnCreaturesEvent
The spigot view distance may not be correct, as the player may
have a specific view distance configured.
2024-11-28 14:22:32 -08:00
Spottedleaf
cb0a972b9f Copy items when constructing ClientboundSetCursorItemPacket
Unlike ClientboundContainerSetSlotPacket, the constructor
itself does not copy the item. Thus, we need to pass a copy of
the item to the constructor.
2024-11-28 14:02:35 -08:00
Jake Potrebic
b207266c7d deprecate adventure key() methods where applicable 2024-11-28 13:51:48 -08:00
Noah
57ab68f4ee Remove string dupe exploit setting (#11670) 2024-11-28 18:17:57 +01:00
Spottedleaf
63d0de648f Do not call modifyEntityTrackingRange on own range
The range is already modified, so this call will not do anything.
2024-11-27 12:19:39 -08:00
Spottedleaf
f9b1c374e4 Replace SimpleRandom with (Simple)ThreadUnsafeRandom
ThreadUnsafeRandom is a random implementation that is
identical to LegacyRandomSource behaviourally, but
without the thread checks.

SimpleThreadUnsafeRandom is ThreadUnsafeRandom except with
its nextInt(int) function replaced with a faster
but more biased implementation when bound is very large.

Additionally, replace Level/Entity randoms with ThreadUnsafeRandom.
This avoids the expensive CAS logic at the expense of losing the
thread check.
2024-11-27 06:16:27 -08:00
Lulu13022002
0cfa6aa89a Prevent duplicate/superfluous BlockPhysicsEvent (#11609) 2024-11-26 20:05:52 +01:00
Lulu13022002
cb940e72b1 Expose particle status client option (#11573) 2024-11-26 18:46:12 +01:00
Nassim Jahnke
cd36f8d3e2 [ci skip] leaf 2024-11-25 20:18:47 +01:00
Spottedleaf
22dea6efbd Add Server#isGlobalTickThread
This method should be present in Paper, not just in Folia, given
that the GlobalRegionScheduler is present.

Additonally, add Server#isOwnedByCurrentRegion(World, int, int, int, int)
for checking of a rectangle of chunks is owned by the current region.
2024-11-25 10:43:28 -08:00
Spottedleaf
c9731fc93d Change MinecraftServer#pluginsBlockingSleep to be Set
A plugin should not be allowed to be added twice or more, as this
would require two or more remove calls to unset the pause block.
2024-11-25 10:13:34 -08:00
dependabot[bot]
cea5939bba Bump dawidd6/action-download-artifact from 3 to 6 in /.github/workflows (#11666)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 3 to 6.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v3...v6)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 16:03:18 +00:00
Glicz
c64c011b1e [ci skip] fix compile issues caused by b52fea4 (#11664) 2024-11-25 11:18:05 +01:00
Jake Potrebic
b52fea44fe [ci skip] use more jspecify in server 2024-11-24 19:26:32 -08:00
Jake Potrebic
ca5499c7fa Switch Impl types to Holderable 2024-11-24 15:08:19 -08:00
Jake Potrebic
ebd2dc259d Add all missing TagKey constants files (#11661) 2024-11-24 13:32:52 -08:00
Lulu13022002
8e2102c70b Fix painting variant builder (#11660) 2024-11-24 20:12:08 +01:00
Bjarne Koll
bbe32f42f0 Call ProjectileHitEvent for entity hits (#11652)
A simple bugfix replacing a new vanilla call to
Projectile#hitTargetOrDeflectSelf with the bukkit replacement to call
the event.
2024-11-23 23:13:10 +01:00
kokiriglade
d5c1214b8e Painting variant registry modification API (#11648) 2024-11-23 22:10:54 +00:00
Bjarne Koll
34989c63b0 Correctly damage tick wolf after armor block (#11653)
Spigot incorrectly returns false in Wolf#actuallyHurt if the armor
absorbed the damage causing the entity to not get damage invuln ticks.
Resolve this by correctly reverting to the "always true" return value as
the event is not cancelled.
2024-11-23 23:05:54 +01:00
Jake Potrebic
564005cc5f Configurable Entity Despawn Time (#11454)
* Configurable Entity Despawn Time

Co-authored-by: Kevin Raneri <kevin.raneri@gmail.com>

* Rebase

* Rebase

* rebase

* throw exceptions for this map

---------

Co-authored-by: Kevin Raneri <kevin.raneri@gmail.com>
2024-11-23 13:27:37 -08:00
Bjarne Koll
e598ee5d08 Correctly mirror vanilla non-exact ingredients (#11651) 2024-11-23 20:37:38 +01:00
Jake Potrebic
0dc6316e04 Support tags for more SimpleRegistry (#11607) 2024-11-23 11:26:51 -08:00
Nassim Jahnke
857931f5cc Make TypedKey an actual Key (#11641) 2024-11-23 20:21:24 +01:00
Lulu13022002
00e253fdf9 Fix jukebox component (#11642) 2024-11-23 20:09:34 +01:00
Jake Potrebic
c72a463cb5 Run 'freeze' listeners before tag events (#11606) 2024-11-23 10:52:00 -08:00
kokiriglade
ed6663d2b9 Expanded Art API 2024-11-23 18:08:13 +00:00
Abel
89bd3e5c99 Add API to allow/disallow tick sleeping (#11611) 2024-11-22 12:53:01 +01:00
Abel
9badea8a55 Add API to check if the server is sleeping (#11605) 2024-11-22 12:22:20 +01:00
Lulu13022002
22792d7987 Check for AbstractBoat instead of Boat in EAR ignore list 2024-11-21 18:37:49 +01:00
Nassim Jahnke
7fc75401ca [ci skip] Fix typos 2024-11-21 17:57:18 +01:00
Nassim Jahnke
e5b723ada2 Update spark 2024-11-21 10:43:07 +01:00
Lulu13022002
a44e23c205 Fix NPE when EntityResurrectEvent is uncancelled (#11636) 2024-11-19 12:21:31 +01:00
Bjarne Koll
938559b3e0 Fix incorrect invulnerability damage reduction (#11599)
Fixes incorrect spigot handling of the invulnerability damage
reduction applied when an already invulnerable entity is damaged with a
larger damage amount than the initial damage.
Vanilla still damages entities even if invulnerable if the damage to be
applied is larger than the previous damage taken. In that case, vanilla
applies the difference between the previous damage taken and the
proposed damage.

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

This patch cannot simply call the EntityDamageEvent with the reduced
damage, as that would lead to EntityDamageEvent#getDamage() returning
the already reduced damage, which breaks its method contract.
Instead, this patch makes use of the DamageModifier API, implementing
the last-damage-reduction as a DamageModifier.
2024-11-19 11:54:58 +01:00
Nassim Jahnke
f13d2012fe Add PlayerItemGroupCooldownEvent (#11625) 2024-11-19 11:33:06 +01:00