Commit graph

9156 commits

Author SHA1 Message Date
Bjarne Koll
2a39276794
Add CrafterCraftEvent (#11082)
Ports the proposed CrafterCraftEvent proposed in an
open upstream PR.

See: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/1044
2024-07-19 11:21:26 +02:00
Jason Penilla
d08e8d1afa
Add total time to done message (#11109)
* Add total time to done message

Previously it would only show the world load time which is misleading

* Add comments
2024-07-18 15:33:14 -07:00
Nassim Jahnke
a8db527449
Even more cleanup of mcutil patch 2024-07-18 18:15:13 +02:00
granny
3c8a7fe1a4
Re-add missing chunk event calls (#11104) 2024-07-18 13:34:34 +02:00
Nassim Jahnke
dd11ef8441
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11102)
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:
3a3bea52 SPIGOT-7829: Increase maximum outgoing plugin message size to match Vanilla intention
5cd1c8cb SPIGOT-7831: Add CreatureSpawnEvent.SpawnReason#POTION_EFFECT
a8e278f0 SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals
53729d12 Remove spurious ApiStatus.Internal annotation
b9f57486 SPIGOT-7799, PR-1039: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent
7983b966 PR-1029: Trial changing a small number of inner enums to classes/interfaces to better support custom values

CraftBukkit Changes:
403accd56 SPIGOT-7831: Add CreatureSpawnEvent.SpawnReason#POTION_EFFECT
812761660 Increase outdated build delay
bed1e3ff6 SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals
2444c8b23 SPIGOT-7823: Suspicious sand and gravel material are not marked as having gravity correctly
aceddcd0b SPIGOT-7820: Enum changes - duplicate method name
a0d2d6a84 SPIGOT-7813: Material#isInteractable() always returns false
8fd64b091 SPIGOT-7806: Handle both loot and inventory item drop behaviour in PlayerDeathEvent
a4ee40b74 SPIGOT-7799, PR-1436: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent
082aa51c5 PR-1424: Trial changing a small number of inner enums to classes/interfaces to better support custom values
66e78a96b SPIGOT-7815: Consider EntityDamageEvent status for Wolf armor damage

Spigot Changes:
5bbef5ad SPIGOT-7834: Modify max value for generic.max_absorption
2024-07-18 10:13:20 +02:00
Jake Potrebic
44c3dd0d4c
fix exact choice shapeless recipes (#10973) 2024-07-17 12:48:31 -07:00
Spottedleaf
2df5bba16a Log throwable when failing to save chunk/poi/entity data 2024-07-17 11:48:24 -07:00
Spottedleaf
b653276565 Finish chunk tick iteration optimisation port from Moonrise 2024-07-17 11:34:26 -07:00
Spottedleaf
4efd24b336 Remove unused chunk system hooks in MCUtils 2024-07-17 11:08:28 -07:00
Spottedleaf
00b949f1bb Remove Moonrise utils to MCUtils, remove duplicated/unused utils 2024-07-17 10:28:32 -07:00
Spottedleaf
967f98aa81 Optimise chunk tick checking during chunk tick
We don't need to check for this with the chunk system, as
ticking chunks are actually guaranteed to ticking. Additionally,
ticking chunks may only become non-ticking during the chunk holder
manager tick - which will not happen during chunk ticking.
2024-07-17 07:43:49 -07:00
Spottedleaf
05ed6a6ff5 Fix priority scheduling logic
This resolves sync loads not being properly prioritised.
2024-07-17 07:39:30 -07:00
Riley Park
ceeb8c14ee
Disable timings by default (#11095) 2024-07-16 17:33:40 -07:00
Jake Potrebic
506f1651e5
Don't store removed components in multiple places (#11091) 2024-07-16 16:39:57 -07:00
Jake Potrebic
a6ceda12c5
distinguish between null and empty map in API (#10829) 2024-07-16 11:36:07 -07:00
Tamion
ef96a69e84
Fire EntityChangeBlockEvent for weaving potion effect (#11087) 2024-07-16 10:15:18 +02:00
Jakub Zacek
2cd8c461af
Add OMINOUS_ITEM_SPAWNER SpawnReason (#10897) 2024-07-15 17:35:51 -04:00
Spottedleaf
b57b24d549 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
9fd77108e3 Apply automatic regionfile header recalculation patch 2024-07-15 12:20:47 -07:00
Spottedleaf
77fcb29607 Apply incremental player/level saving patch 2024-07-15 11:57:56 -07:00
Spottedleaf
3b45454190 Port random ticking optimisation from Moonrise 2024-07-15 11:13:08 -07:00
Spottedleaf
8b23018575 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
aa929d6666
Call PlayerLaunchProjectileEvent for wind charge (#10911) 2024-07-15 17:07:07 +02:00
Jake Potrebic
05e5865da3
Add ItemType#getItemRarity (#11049) 2024-07-15 16:38:20 +02:00
powercas_gamer
b4f04ff4b3
Add Plugin#getDataPath (#11080) 2024-07-15 14:07:17 +02:00
Tamion
8b35adca88
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
9fd5b3cfbd
Add AttributeModifier constructor without EquipmentSlotGroup (#11079) 2024-07-15 12:31:41 +02:00
Lulu13022002
99ae7bbc97
Don't require author and title to be set on signed book meta (#11068) 2024-07-14 15:33:52 +02:00
Nassim Jahnke
34a2917dcc
Add default canUse and permission methods to BasicCommand (#11047) 2024-07-14 14:04:38 +02:00
Nassim Jahnke
1595e4afc0
Make watchdog thread extend TickThread again 2024-07-14 13:59:18 +02:00
Spottedleaf
2288e13816 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
5a503d7db4
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
ffe31a1cd0
Readd async saveddata io 2024-07-12 17:58:54 +02:00
Bjarne Koll
70ff1ec079
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
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