193 Commits

Author SHA1 Message Date
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
Doc
4a929b5d66
SPIGOT-7267: Fix EntityType#getTranslationKey() and add unit test 2023-02-20 19:35:39 +11:00
byquanton
4768df7366
SPIGOT-7034: Add methods for set/get instrument in Goat Horn 2023-01-08 20:36:10 +11:00
Doc
06a6a10126
#1121: Add unit test for spawn egg meta 2022-12-13 19:04:30 +11:00
md_5
19e6be0209
Update to Minecraft 1.19.3 2022-12-08 03:00:00 +11:00
Doc
4230f8f0e4
SPIGOT-7083: Add Boat.WoodenType, Boat.Status; deprecate TreeSpecies 2022-07-05 20:40:35 +10:00
DerFrZocker
68f888ded3
SPIGOT-7011, SPIGOT-7065: Overhaul of structures 2022-07-01 20:41:04 +10:00
DerFrZocker
6c61b73f38
#1052: Add option to use cached map color palette
This reduces the conversion time drastically with the cost of slightly more memory usage.
2022-06-18 21:13:42 +10:00
md_5
64c15270e7
Update to Minecraft 1.19 2022-06-08 02:00:00 +10:00
DerFrZocker
b02801aa21
#1055: Use correct tile entity for trapped chest in CraftBlockStates 2022-06-06 08:30:54 +10:00
md_5
f48739cae8
Add tests for material creative categories 2022-03-19 09:59:55 +11:00
md_5
05a38da190
Update to Minecraft 1.18.2 2022-03-01 02:00:00 +11:00
Doc
febaa1c6f5
SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls 2022-02-07 18:52:16 +11:00
blablubbabc
8f361ecec0
#1002: Add Player Profile API
Slight changes may occur as this API is stabilized.

This PR is based on work previously done by DerFrZocker in #938.
2022-02-03 09:25:39 +11:00
coll1234567
af8a8b708c
#962: Make PotionEffectType implement Keyed 2021-11-28 11:49:42 +11:00
md_5
d181e1edd9
Fix serializing unhandled NBT + add unit test with unhandled NBT 2021-11-23 12:35:42 +11:00
BlackHole
7c4707e46b
#955: Add test for BlockData class of Material 2021-11-23 08:07:10 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
blablubbabc
dc764e7a2f
#877: Improve and simplify CraftBlockState 2021-09-29 18:56:16 +10:00
DerFrZocker
4f6bcc84f9
SPIGOT-5880, SPIGOT-5567: New ChunkGenerator API
## **Current API**
The current world generation API is very old and limited when you want to make more complex world generation. Resulting in some hard to fix bugs such as that you cannot modify blocks outside the chunk in the BlockPopulator (which should and was per the docs possible), or strange behavior such as SPIGOT-5880.

## **New API**
With the new API, the generation is more separate in multiple methods and is more in line with Vanilla chunk generation. The new API is designed to as future proof as possible. If for example a new generation step is added it can easily also be added as a step in API by simply creating the method for it. On the other side if a generation step gets removed, the method can easily be called after another, which is the case with surface and bedrock. The new API and changes are also fully backwards compatible with old chunk generators.

### **Changes in the new api**
**Extra generation steps:**
Noise, surface, bedrock and caves are added as steps. With those generation steps three extra methods for Vanilla generation are also added. Those new methods provide the ChunkData instead of returning one. The reason for this is, that the ChunkData is now backed by a ChunkAccess. With this, each step has the information of the step before and the Vanilla information (if chosen by setting a 'should' method to true). The old method is deprecated.

**New class BiomeProvider**
The BiomeProvider acts as Biome source and wrapper for the NMS class WorldChunkManager. With this the underlying Vanilla ChunkGeneration knows which Biome to use for the structure and decoration generation. (Fixes: SPIGOT-5880). Although the List of Biomes which is required in BiomeProvider, is currently not much in use in Vanilla, I decided to add it to future proof the API when it may be required in later versions of Minecraft.
The BiomeProvider is also separated from the ChunkGenerator for plugins which only want to change the biome map, such as single Biome worlds or if some biomes should be more present than others.

**Deprecated isParallelCapable**
Mojang has and is pushing to a more multi threaded chunk generation. This should also be the case for custom chunk generators. This is why the new API only supports multi threaded generation. This does not affect the old API, which is still checking this.

**Base height method added**
This method was added to also bring the Minecraft generator and Bukkit generator more in line. With this it is possible to return the max height of a location (before decorations). This is useful to let most structures know were to place them. This fixes SPIGOT-5567. (This fixes not all structures placement, desert pyramids for example are still way up at y-level 64, This however is more a vanilla bug and should be fixed at Mojangs end).

**WorldInfo Class**
The World object was swapped for a WorldInfo object. This is because many methods of the World object won't work during world generation and would mostly likely result in a deadlock. It contains any information a plugin should need to identify the world.

**BlockPopulator Changes**
Instead of directly manipulating a chunk, changes are now made to a new class LimitedRegion, this class provides methods to populated the chunk and its surrounding area. The wrapping is done so that the population can be moved into the place where Minecraft generates decorations. Where there is no chunk to access yet. By moving it into this place the generation is now async and the surrounding area of the chunk can also be used.

For common methods between the World and LimitedRegion a RegionAccessor was added.
2021-08-15 08:08:16 +10:00
Doc
07ed44a415
SPIGOT-6527: Add AxolotlBucketMeta 2021-07-04 09:32:25 +10:00
konsolas
20d3e57c4e
#855: Add HumanEntity#getItemInUse and Material#getSlipperiness 2021-06-13 08:59:59 +10:00
DerFrZocker
b42e708cf2
Fix new map colors rendering as transparent 2021-06-12 19:58:09 +10:00
md_5
e2f5ea34e9
Update to Minecraft 1.17 2021-06-11 15:00:00 +10:00
Jakub Zacek
35124087d2
#819: Implemented test for Material#getEquipmentSlot() method 2021-04-13 19:16:32 +10:00
Martoph
0e26ddb6a3
SPIGOT-5877: Add scaffolding for custom dimensions and biomes 2021-04-11 17:54:48 +10:00