394 Commits

Author SHA1 Message Date
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
Doc
36c2681af9
#1066: Add missing server properties methods from 1.19 2022-06-18 20:49:03 +10:00
md_5
64c15270e7
Update to Minecraft 1.19 2022-06-08 02:00:00 +10:00
Parker Hawke
6c308e1b57
SPIGOT-6829: Add per-player world border API 2022-04-09 09:39:33 +10:00
Doc
808cb7ca5c
#1023: Improve consistency of tag API 2022-03-06 16:24:58 +11:00
md_5
21fe78aa4f
SPIGOT-6957: Bad default value for WorldCreator#generatorSettings 2022-03-04 08:15:31 +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
Patrick Choe
439c685f4e
SPIGOT-6789: Improve resource pack related API 2021-12-18 11:46:17 +11:00
md_5
dad8517102
SPIGOT-6851: removeRecipe not unregistering recipe ID 2021-12-13 11:25:22 +11:00
md_5
03b7252338
SPIGOT-6823: Fix loading custom world in combination with superflat 2021-12-03 08:34:38 +11:00
Doc
4bf7f33cc6
#956: Add getHideOnlinePlayers 2021-11-23 12:49:03 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
Sander Knauff
1df303e707
SPIGOT-2903: Add Structure API 2021-10-05 12:24:21 +11:00
Doc
346ebb7a7a
#934: Support for configuring Water Underground Creatures spawn settings 2021-10-05 11:39:21 +11:00
md_5
d3cc412075
SPIGOT-6738: Add entity type tags 2021-09-19 14:51:21 +10:00
md_5
332335e1c6
SPIGOT-6731: "Nag author" message in CraftServer lists one author only 2021-09-10 17:49:53 +10:00
DerFrZocker
09b99daf30
SPIGOT-6722: Close entity manager when unloading world 2021-08-27 19:14:09 +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
James Peters
e8e3cbccf5
#893: Add Crafting methods to API 2021-07-22 11:37:22 +10:00
md_5
fb556bfa14
Update to Minecraft 1.17.1 2021-07-07 00:00:00 +10:00
md_5
b121d3b953
SPIGOT-6605: Add method to access value of enforce-whitelist 2021-06-26 09:58:34 +10:00
md_5
f81f49940f
SPIGOT-6594: NPE at Bukkit.getServer().getGenerateStructures() 2021-06-24 08:37:58 +10:00
md_5
1c39efa340
Fix Inventory#getViewers on the player inventory not returning the player first time their inventory is opened 2021-06-20 09:27:32 +10:00
md_5
f992ce6097
Fix duplicate datapack reload on /reload 2021-06-15 15:51:13 +10:00
md_5
40caacc846
SPIGOT-6526: World entities are not populated when plugin onEnable is called 2021-06-13 15:05:32 +10:00
DerFrZocker
4db9c49f97
SPIGOT-6510: Bukkit#createMap throws NullPointerException 2021-06-12 08:25:44 +10:00
md_5
e2f5ea34e9
Update to Minecraft 1.17 2021-06-11 15:00:00 +10:00
DerFrZocker
cc21bae977
SPIGOT-5569: Call WorldInitEvent before any chunks are getting generated 2021-05-18 08:18:20 +10:00
Kermina Awad
51e2981b5b
#831: Reload unloaded main worlds correctly 2021-05-12 17:20:27 +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
pop4959
768d7fc2df
#773: Add method to get max world size 2020-12-13 11:30:54 +11:00
Martoph
890130b460
#746: Add Fluid types / tags 2020-09-14 19:41:46 +10:00
md_5
bf3d720714
Update to Minecraft 1.16.3 2020-09-11 07:00:00 +10:00
md_5
fa917c4723
Don't create custom registry for custom worlds 2020-08-17 18:48:00 +10:00
md_5
9c9fb593f5
Update to Minecraft 1.16.2 2020-08-12 07:00:00 +10:00
jameslfc19
8b831a9652
#714: Added getRecipe() method to retrieve a Recipe by it's NamespacedKey 2020-07-22 18:14:58 +10:00
md_5
53849f57f5
SPIGOT-5922: Smithing recipes not registering 2020-07-02 11:16:48 +10:00
md_5
92cbf65649
SPIGOT-5884: Tab completions lost on reloadData / minecraft:reload 2020-06-30 10:51:26 +10:00
md_5
7884e07936
SPIGOT-5868: Blocks do not tick in custom nether / end 2020-06-28 09:03:51 +10:00
md_5
71045d3ddb
SPIGOT-5828: Unlock worlds on unload 2020-06-27 09:15:14 +10:00
md_5
c99846cc76
Add configuration options for water_ambient spawning 2020-06-26 18:39:42 +10:00
md_5
8dc1da156f
Misc bugfixes to multiworld support 2020-06-25 17:58:10 +10:00
md_5
7ea3c040bc
Update to Minecraft 1.16.1 2020-06-25 10:00:00 +10:00
md_5
ce66f6937b Misc checkstyle fixes 2020-04-14 12:34:43 +10:00
Phoenix616
fc24934098 SPIGOT-5484: Add more spawn tick settings 2020-03-08 19:43:47 +11:00
ShaneBee
0098037647 #618: Add method to remove a recipe by its key 2020-02-02 10:32:49 +11:00