241 Commits

Author SHA1 Message Date
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
Jishuna
771182f70c
#1327: Add methods to place structures with block/entity transformers 2024-01-10 18:44:31 +11:00
md_5
76931e8bd4
Add EntityMountEvent and EntityDismount Event
Adapted from Spigot commit ab1e1a2a5ae1e6cc42afe8bf48832721407365fd.
2024-01-07 08:59:55 +11:00
DerFrZocker
9b29b21c76
#1183: Better handle lambda expression and renaming of classes in Commodore 2024-01-06 16:15:23 +11:00
md_5
1462ebe85d
Reformat Commodore.java 2024-01-06 16:15:21 +11:00
DerFrZocker
bcf56171a6
#1321: Clean up some stuff which got missed during previous PRs
- Add missing CraftBukkit comment to CommandGive
- Remove no longer needed IRegistryCustom from CraftStructure conversion
- Use setBasePotionType instead of deprecated setBasePotionData
2023-12-26 07:44:21 +11:00
md_5
b3b43a6ad2
Add Checkstyle check for unused imports 2023-12-17 10:26:49 +11:00
md_5
07e5dd5d59
Update to Minecraft 1.20.3 2023-12-06 03:40:00 +11:00
DerFrZocker
71b0135cc7
SPIGOT-5753: Back PotionType by a minecraft registry 2023-10-09 20:22:53 +11:00
Jishuna
a6bcb84890
SPIGOT-7080: Add World#locateNearestBiome 2023-10-09 20:11:46 +11:00
Lauriichan
dab849f084
SPIGOT-7283, SPIGOT-7318: Add AsyncStructureGenerateEvent and BlockState cloning 2023-09-29 06:54:35 +10: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
02d4907887
#1250: Standardize and centralize Bukkit / Minecraft registry conversion 2023-09-22 03:02:16 +10:00
DerFrZocker
9024a09b92
#1251: Use Java Consumer instead of Bukkit Consumer 2023-09-22 02:57:13 +10:00
md_5
28c1023286
Update to Minecraft 1.20.2 2023-09-22 02:40:00 +10:00
DerFrZocker
00f5a80fbe
#1252: Fix error when generating a tree in water 2023-09-02 12:55:26 +10:00
md_5
9c5d600d13
Update to Minecraft 1.20.1 2023-06-13 07:00:00 +10:00
Doc
40945171bf
#1182: Consolidate Preconditions use and minor cleanup 2023-06-12 19:41:02 +10:00
md_5
e1188ed3a2
Update to Minecraft 1.20 2023-06-08 01:30:00 +10:00
Doc
dbc70bed55
SPIGOT-7195, SPIGOT-7197: Add DataPack API 2023-05-30 19:05:48 +10:00
Doc
f92a41c396
#1181: Consolidate Location conversion code 2023-04-19 19:59:19 +10:00
md_5
15a3eac661
SPIGOT-7335: Fix typo in TextDisplay#TextAlignment enum name 2023-04-11 18:52:28 +10:00
md_5
1264a6fb57
Fix crash with composters 2023-03-15 18:08:47 +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
md_5
a50301aa51
Fix issues with fluid tag conversion and fluid #isTagged 2023-02-15 21:09:58 +11:00
mfnalex
7dbf862c26
#1131: Added methods to get translation keys for materials, itemstacks and more 2023-02-10 20:50:24 +11:00
md_5
909a246afc
SPIGOT-7211: generateTree() with Consumer or Predicate is broken 2022-12-23 11:36:46 +11:00
md_5
19e6be0209
Update to Minecraft 1.19.3 2022-12-08 03:00:00 +11:00
md_5
ec2b5d4cd1
Update to Minecraft 1.19.2 2022-08-06 07:40:00 +10:00
md_5
6da82662bb
Update to Minecraft 1.19.1 2022-07-28 04:00:00 +10:00
DerFrZocker
68f888ded3
SPIGOT-7011, SPIGOT-7065: Overhaul of structures 2022-07-01 20:41:04 +10:00
Vatuu
3b34c6beae
SPIGOT-7044: Modified RandomSourceWrapper to ensure random is not null before setting seed 2022-06-09 21:06:03 +10:00
md_5
64c15270e7
Update to Minecraft 1.19 2022-06-08 02:00:00 +10:00
Parker Hawke
86292d3e08
#876: Add CreativeCategory API for Materials 2022-03-03 18:55:51 +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
319ca703cd
#978: Add Material#getDefaultAttributeModifiers 2021-12-24 12:11:50 +11:00
md_5
c2e0bbda4e
Update to Minecraft 1.18.1 2021-12-11 00:12:31 +11:00
Doc
8b98c8ed0b
SPIGOT-6840: Fire resistance potion effect does not prevent melt damage of snow golem 2021-12-10 09:01:49 +11:00
md_5
bc14cb649b
Update to Minecraft 1.18 2021-12-01 03:00:00 +11:00
md_5
c98abfb0ff
Update to Minecraft 1.18-rc3 2021-11-27 08:00:00 +11:00
md_5
5a39a236c1
Update to Minecraft 1.18-pre8 2021-11-25 08:00:00 +11:00
md_5
a58fde42cc
Fix crash with composters 2021-11-24 09:33:28 +11:00
md_5
2f6662d467
Improve multi-dimension code 2021-11-23 18:39:43 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
DerFrZocker
a955f15c25
Fix issues with new ChunkGenerator API
- RegionAccessor#setType / RegionAccessor#setBlockData doesn't run entity removal logic
- RegionAccessor#generateTree crashes by bee nest (TreeType#TALL_BIRCH)
2021-08-22 13:23:40 +02: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