218 Commits

Author SHA1 Message Date
antiPerson
a4ee40b749
SPIGOT-7799, #1436: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent 2024-07-06 17:19:45 +10:00
DerFrZocker
082aa51c50
#1424: Trial changing a small number of inner enums to classes/interfaces to better support custom values
This PR is a subset of the enum PR #931 and is designed as a low impact
trial run of the design and backwards compatibility to inform
subsequent development.

Additional plugin compatibility features may be available by setting
`settings.compatibility.enum-compatibility-mode` to `true` in
`bukkit.yml`.
2024-07-06 17:14:22 +10:00
DerFrZocker
9ef69aa0b2
#1284: Move ItemType <-> ItemMeta linking to a centralized place 2024-06-15 06:53:46 +10:00
md_5
a4c2ee70db
Update to Minecraft 1.21 2024-06-14 01:05:00 +10:00
Doc
c6b4d5a87f
SPIGOT-7731: Spawn eggs cannot have damage 2024-06-10 14:06:34 +10:00
DerFrZocker
9003845569
SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 2024-06-03 07:18:17 +10:00
2008Choco
5d7d675b95
#1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 2024-05-29 06:50:08 +10:00
DerFrZocker
9608279815
#1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType
This also moves the conversion from and to legacy material to the method
calls of legacy plugins, and no longer allows them directly in the
server.

This has the side effect of fixing some legacy plugin issues, such as
SPIGOT-4288, SPIGOT-6161. Also fixes legacy items sometimes not stacking
in inventory when using addItem, a client disconnect when using legacy
items in recipes and probably some more.
2024-05-29 06:48:55 +10:00
Jishuna
afe5b5ee93
#1275: Add internal ItemType and BlockType, delegate Material methods to them
Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
Co-authored-by: DerFrZocker <derrieple@gmail.com>
Co-authored-by: md_5 <git@md-5.net>
2024-05-05 10:08:54 +10:00
DerFrZocker
2a6207fe15
#1393: Improve field rename handling and centralize conversion between bukkit and string more 2024-05-04 08:19:07 +10:00
Doc
5d84f48a40
SPIGOT-7653: Update ApiVersion.CURRENT with latest version and include tests 2024-05-02 07:00:16 +10:00
DerFrZocker
ad549847ee
Open a direct connection instead of pinging mojang server to check if it is reachable 2024-04-26 09:16:58 +02:00
md_5
590cf09a8e
Fix unit tests always seeing Mojang server as unavailable 2024-04-25 16:26:03 +10:00
DerFrZocker
0297f87bb0
SPIGOT-7355: More field renames and fixes
- Rename MapCursor Types to match their Minecraft names
- SPIGOT-7355: Rename ItemFlag#HIDE_POTION_EFFECTS to better reflect its function
- Fix Attribute rename (CraftBukkit only)
- Add rename routing validation (CraftBukkit only)
2024-04-25 07:49:44 +10:00
DerFrZocker
8c1e7c8410
#1384: Disable certain PlayerProfile tests, if Mojang's services or internet are not available 2024-04-24 18:12:31 +10:00
DerFrZocker
5d57527c2a
#1380: Change wolf variant from enum to interface 2024-04-24 04:22:03 +10:00
DerFrZocker
801767ed80
SPIGOT-5336: Field name parity with Minecraft keys 2024-04-24 01:15:00 +10:00
DerFrZocker
e05615dc78
#1357: Remove legacy Particle values 2024-04-24 01:15:00 +10:00
md_5
735b2d0d7f
Update to Minecraft 1.20.5 2024-04-24 01:15:00 +10:00
Bjarne Koll
ffd15611c7
SPIGOT-7608: Allow empty lists to morph to any PDT list
The minecraft serialisation logic for ListTag updates the type byte of
the list tag during writing to match either the first element in the
list or 0, if said list tag is empty.
As such, list content type information cannot be carried through a
write/read process, e.g. chunk load/unload or a creative client updating
the item.

The recently introduced persistent data type collections for lists hence
can also not enforce a specific list content type if the found list is
empty, which it currently attempts to do.
As such, a call to PersistentDataContainer#has would also yield false
for any empty list as the lists type byte would be 0.

The faulty behaviour has been fixed by considering an empty list in the
persistent data container to match any list type.
This change, while technically breaking the #has check, is needed and
reasonable as the #has check for this is currently broken in the first
place as described above.
2024-03-30 10:46:03 +11:00
DerFrZocker
a2736ddb06
SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, #1008: Add EntityRemoveEvent 2024-02-21 20:55:34 +11:00
Doc
80f0ce4be6
SPIGOT-7300, #1180: Add new DamageSource API providing enhanced information about entity damage 2024-02-11 09:54:25 +11:00
DerFrZocker
161784713a
#1340: Centralize the conversion from and to Minecraft / Bukkit registry items even more and add a test case for them 2024-01-22 20:36:36 +11:00
Bjarne Koll
4e419c774c
#1295: Define native persistent data types for lists 2024-01-06 16:03:58 +11:00
DerFrZocker
2e88514ad3
#1325: Use CraftBlockType and CraftItemType instead of CraftMagicNumbers to convert between minecraft and bukkit block / item representation 2023-12-29 08:36:38 +11:00
DerFrZocker
60d16d7cac
#1306: Centralize Bukkit and Minecraft entity conversion 2023-12-10 10:46:06 +11:00
Jishuna
4fea66e448
#1299: Add new PersistentDataContainer methods and clean up docs 2023-12-08 19:29:38 +11:00
Jishuna
b483a20db0
#1303: Create registry for banner pattern and cat type 2023-12-08 19:26:30 +11:00
Doc
ec1fa2ead3
#1309: Add tests for Bukkit Pose 2023-12-07 08:21:33 +11:00
DerFrZocker
8232a74cf8
SPIGOT-6026: Pull PotionEffectType and Enchantment from registry 2023-12-06 03:40:00 +11:00
md_5
07e5dd5d59
Update to Minecraft 1.20.3 2023-12-06 03:40:00 +11:00
DerFrZocker
67a52a6485
#1279: Back Particle by a minecraft registry 2023-10-21 13:42:09 +11:00
DerFrZocker
71b0135cc7
SPIGOT-5753: Back PotionType by a minecraft registry 2023-10-09 20:22:53 +11:00
DerFrZocker
b3efca57ac
SPIGOT-6400: Use Mockito instead of InvocationHandler 2023-10-07 15:42:18 +11:00
DerFrZocker
44b31da38f
#1264: Load Bukkit class before creating Registry item
This fixes a registry load order issue, which could cause that two different instances of the same registry item could exist, when the Bukkit class was not loaded before an item was queried.
2023-10-03 07:15:37 +11:00
Doc
ef7a4743d8
#1265: Ensure UTF-8 used in new test resource 2023-10-01 15:27:41 +11:00
Bjarne Koll
f0661c3514
#1230: Move unstructured PDC NBT serialisation to SNBT
The initial implementation of the CraftNBTTagConfigSerialiser attempted
to represent the entire NBT tree in yaml. While the tree structure
itself is nicely represented, the values and their respective types
become increasingly difficult to properly store in the context of
snakeyml/yml in general.

This is mainly due to the fact that nbt offers a lot of different types
compared to yaml, specifically the primitive arrays and different
floating point values are troublesome as they require parsing via mojang
parsers due to their custom format.

To build a future proof system for unstructured nbt in spigot yml,
this commit moves the entire serialisation fully into SNBT,
producing a single string as output rather than a full yml tree.
SNBT remains easily readable and editable for server owners, which was
one of the main criteria during the initial implementation of the
serialiser (preventing the use of bas64ed gzipped nbt bytes), while also
completely using mojangs parsing, eliminating any need for custom
parsing logic in spigot.

Additionally, a string allows for very straight forward handling of
legacy data by simply parsing strings as SNBT and maps/yml trees as
legacy content, depending on what type snakeyml produces after parsing
the yml content, removing the need for a versioning schema.
2023-09-24 10:12:19 +10:00
DerFrZocker
452fcb5997
#1256: Update tests to JUnit 5 2023-09-23 18:10:23 +10:00
md_5
f0702775c3
SPIGOT-7486: Alternate approach to null profile names 2023-09-22 07:36:30 +10:00
DerFrZocker
02d4907887
#1250: Standardize and centralize Bukkit / Minecraft registry conversion 2023-09-22 03:02:16 +10:00
md_5
28c1023286
Update to Minecraft 1.20.2 2023-09-22 02:40:00 +10:00
DerFrZocker
10219df3a6
#1248: Load GameEvent and MusicInstrument from registry 2023-09-02 12:55:23 +10:00
DerFrZocker
4f7ff4dece
#1246: Add missing AbstractTestingBase to tests which need them 2023-08-25 19:33:11 +10:00
Parker Hawke
b2322fead2
#1203: Test TrimMaterial and TrimPattern constants 2023-06-12 10:06:51 +10:00
md_5
e1188ed3a2
Update to Minecraft 1.20 2023-06-08 01:30:00 +10:00
Parker Hawke
2270366cdd
#1196: Test Registry instances more thoroughly 2023-06-04 11:28:33 +10:00
md_5
ccbc6abca4
Add test for Chunk.LoadLevel mirroring 2023-04-29 17:44:42 +10:00
Parker Hawke
1eb88374e1
#1147: Add experimental armor trim API 2023-04-07 16:51:00 +10:00
md_5
968d28df04
Fix availability of experimental datapack features in unit tests 2023-03-15 20:41:42 +11:00
md_5
bcedf28a1b
Update to Minecraft 1.19.4 2023-03-15 03:30:00 +11:00