Commit Graph

8794 Commits

Author SHA1 Message Date
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
Jake Potrebic
abbb7415bd remove old vanilla goals 2024-06-14 13:38:42 -07:00
Jake Potrebic
f7118d4e22 update generated API 2024-06-14 13:11:23 -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
Jake Potrebic
79da0788dd 62 2024-06-13 10:12:48 -07:00
Jake Potrebic
0ef31547a1 Finish API patches 2024-06-13 08:45:43 -07:00
Bjarne Koll
b52915b54e 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
5df0660d63 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
bd9e2e7fe8 Handle alpha channel from potion_contents component (#10808) 2024-06-04 22:55:29 +02:00
Jake Potrebic
1eacf97f18 Make Bogged implement Shearable (#10844) 2024-06-04 13:26:40 -07:00
Jake Potrebic
a992033d60 Add since to deprecated for removals (#10848) 2024-06-04 12:40:18 -07:00
Spottedleaf
3df0d9a457 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:28:31 -07:00
Bjarne Koll
ca07564e47 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 19:39:20 +02:00
Jake Potrebic
a69530eb66 clarify what getEntityId actually returns (#10839) 2024-06-03 10:20:43 -07:00
Jake Potrebic
5db39ab195 Use RegistryOps in the correct places (#10843) 2024-06-02 15:19:17 -07:00
Bjarne Koll
97ed3762cf 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
3a135ada91 Fire TabCompleteEvent for legacy commands (#10834) 2024-05-31 08:46:42 -07:00
TotalledZebra
2cc4c182ae Add entity heal API (#10267) 2024-05-30 23:31:45 +03:00
Jake Potrebic
ea9c42406e fix knockback events (#10831)
* fix knockback events

* squash

* handle cancelled event for explosions
2024-05-30 13:17:16 -07:00
Jason Penilla
ef45b03497 Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826) 2024-05-30 11:32:43 -07:00
Shane Freeder
3bb51e10ab Fix sending disconnect packet in phases where it doesn't exist 2024-05-30 19:05:39 +01:00
Jake Potrebic
25b99bc93a Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784) 2024-05-29 14:56:14 -07:00
SoSeDiK
2786ee1e8f 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-30 00:45:01 +03:00