96 Commits

Author SHA1 Message Date
md_5
735b2d0d7f
Update to Minecraft 1.20.5 2024-04-24 01:15:00 +10:00
coll1234567
b8d6109f0c
#1335: Add API for in-world structures 2024-02-04 10:04:35 +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
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
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
Jishuna
0478e0417b
#1266: Add support for virtual entities 2023-11-19 19:03:35 +13:00
DerFrZocker
d433f086d5
#1297: Change Consumer and Predicates to super 2023-11-14 19:50:14 +13: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
DerFrZocker
08ec344ad1
Fix ChunkGenerator#generateCaves never being called 2023-07-20 09:45:09 +02:00
Doc
40945171bf
#1182: Consolidate Preconditions use and minor cleanup 2023-06-12 19:41:02 +10:00
DerFrZocker
68b3205624
SPIGOT-7266: Found typo in CraftBukkit package 2023-06-08 13:40:54 +10:00
md_5
e1188ed3a2
Update to Minecraft 1.20 2023-06-08 01:30:00 +10:00
Jishuna
7fe5ee022a
#1186: Move getHighestBlockYAt methods from World to RegionAccessor 2023-05-11 06:48:41 +10:00
md_5
bcedf28a1b
Update to Minecraft 1.19.4 2023-03-15 03:30:00 +11:00
FreeSoccerHDX
7167588b14
#1117: Add new BiomeParameterPoint passed to BiomeProvider#getBiome 2023-02-07 21:23:23 +11:00
md_5
19e6be0209
Update to Minecraft 1.19.3 2022-12-08 03:00:00 +11:00
DerFrZocker
e7aab54932
SPIGOT-6765: Pass WorldInfo, Random and coordinates to ChunkGenerator should methods 2022-11-15 17:56:51 +11:00
DerFrZocker
68f888ded3
SPIGOT-7011, SPIGOT-7065: Overhaul of structures 2022-07-01 20:41:04 +10:00
DerFrZocker
cc7edd6bc5
SPIGOT-7051: Worldgen API does not run vanilla noise generation when shouldGenerateNoise is true 2022-06-10 19:08:36 +10:00
md_5
64c15270e7
Update to Minecraft 1.19 2022-06-08 02:00:00 +10:00
md_5
05a38da190
Update to Minecraft 1.18.2 2022-03-01 02:00:00 +11:00
DerFrZocker
1eeba6a0ec
SPIGOT-6891: Crash when importing 1.16 chunks with entities above the world, when a BlockPopulator is active 2022-01-30 10:52:42 +11:00
DerFrZocker
41832ce7e4
SPIGOT-6843: Wrong PLAINS biome during custom chunk generation 2021-12-18 11:33:22 +11:00
md_5
806bb02c17
SPIGOT-6810: Improve / fix biome setting code 2021-11-27 16:42:28 +11:00
md_5
dd02403be2
Fix upgrading worlds with custom generators 2021-11-23 20:00:10 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
DerFrZocker
2d933bae44
SPIGOT-6741: shouldGenerateStructures isn't implemented 2021-09-28 17:52:29 +02:00
DerFrZocker
cbd747afcd
SPIGOT-6719: Add getTileEntities() to LimitedRegion 2021-08-30 18:44:44 +10:00
DerFrZocker
8c6d60cf50
Fix server crash with BlockPopulator when entities are at a negative chunk border 2021-08-16 07:07:13 +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
DerFrZocker
97f629b68f
SPIGOT-6220: Structures in the world with custom generator not work 2021-08-01 08:26:30 +10:00
DerFrZocker
64d149a5a9
SPIGOT-1753: ChunkGenerator lighting updates 2021-07-23 16:43:53 +10:00
md_5
887bc05190
SPIGOT-6592: Tile entities in custom ChunkGenerator causes crash 2021-06-21 08:46:23 +10:00
md_5
77058c79de
SPIGOT-6554: Worlds created with the bukkit ChunkGenerator cannot save 2021-06-14 13:52:25 +10:00
md_5
e2f5ea34e9
Update to Minecraft 1.17 2021-06-11 15:00:00 +10:00
Martoph
0e26ddb6a3
SPIGOT-5877: Add scaffolding for custom dimensions and biomes 2021-04-11 17:54:48 +10:00
md_5
90d6905b15
Repackage NMS 2021-03-16 09:00:00 +11:00
md_5
aeb95e3a30
Add more checkstyle checks 2021-01-31 10:08:41 +11:00
md_5
f3f30947e0
Update to Minecraft 1.16.5 2021-01-16 12:00:00 +11:00
md_5
2ee7318ae1
SPIGOT-6064: world.getBiome() null Error 2020-08-12 10:51:29 +10:00
md_5
9c9fb593f5
Update to Minecraft 1.16.2 2020-08-12 07:00:00 +10:00
md_5
7ea3c040bc
Update to Minecraft 1.16.1 2020-06-25 10:00:00 +10:00
md_5
25a9a9ff62 SPIGOT-5592: Custom ChunkGenerator can cause bugged dirt 2020-02-23 10:29:46 +11:00
konsolas
37f32da8f8 SPIGOT-5573, SPIGOT-5574: Move CustomChunkGenerator generation code back to buildBase() 2020-02-13 09:04:28 +11:00
md_5
d70084e53d Remove unused seed in CustomChunkGenerator 2020-02-02 19:32:36 +11:00
konsolas
8a66d4c7ac #619: Allow delegation of certain elements to Vanilla when using a custom ChunkGenerator
Allows delegation of caves, decorations, mobs and structures to the Vanilla generation algorithms.
Overriding these methods to return true enables that aspect of Vanilla generation, which is applied after the ChunkGenerator's custom generation.
2020-02-02 19:27:10 +11:00
md_5
3c9a4a3ba6 SPIGOT-5529: BiomeGrid uses incorrect indexing 2020-01-22 08:54:12 +11:00
md_5
108b44ca20 SPIGOT-5506: CustomChunkGenerator is processing Phantoms in the Nether and The End 2020-01-10 09:22:31 +11:00