36 Commits

Author SHA1 Message Date
md_5
cf391b51c8
Pass in SpawnReason rather than boolean 2022-04-18 11:05:15 +10:00
Doc
a459f4d4f5
#1033: Add Villager#zombify 2022-04-15 13:48:55 +10:00
md_5
6f3509d12e
Release POIs when villagers are removed by plugins 2021-12-03 15:05:20 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11: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
VendoAU
a07e783a69
#865: Implement Villager#shakeHead 2021-06-14 19:15:13 +10:00
md_5
e2f5ea34e9
Update to Minecraft 1.17 2021-06-11 15:00:00 +10:00
md_5
90d6905b15
Repackage NMS 2021-03-16 09:00:00 +11:00
md_5
0c24068ad6
Organise imports 2021-03-09 08:47:33 +11:00
md_5
ce66f6937b Misc checkstyle fixes 2020-04-14 12:34:43 +10:00
md_5
de42aa13f3 Update to Minecraft 1.15 2019-12-11 09:00:00 +11:00
LelouBil
1215188ff7 SPIGOT-5180: Add Villager#sleep() and #wakeup() methods 2019-07-22 18:22:44 +10:00
md_5
0fc6922bf3 SPIGOT-5028: Villager#setVillagerExperience() doesn't work 2019-06-06 20:46:32 +10:00
i509VCB
fcb9f90bf3 SPIGOT-4946: Add VillagerCareerChangeEvent 2019-05-27 12:21:53 +10:00
blablubbabc
0036d1b753 SPIGOT-4887: Villager level minimum is 1 2019-05-08 07:41:09 +10:00
md_5
c441dba815 SPIGOT-4834: API for Villager levels and experience 2019-05-05 12:03:20 +10:00
md_5
deeecc7f08 SPIGOT-4820: Villager Type API 2019-05-01 18:39:43 +10:00
md_5
e3df3d5cda Add Override annotations where appropriate 2019-04-28 11:38:01 +10:00
md_5
a2d787f6eb Update to Minecraft 1.14-pre5 2019-04-23 12:00:00 +10:00
md_5
b4230a9a7e Update to Minecraft 1.13.2 2018-10-23 06:00:00 +11:00
md_5
479ec05e3b SPIGOT-4310: Reset villager career level with trades 2018-08-27 07:00:56 +10:00
md_5
421c1728c8 Update to Minecraft 1.13-pre7 2018-07-15 10:00:00 +10:00
Senmori
950006003c SPIGOT-355: API for Villager careers 2017-12-31 21:21:03 +11:00
Lukas Hennig
0b154b1852 SPIGOT-2272: Add API for virtual Merchants 2016-11-21 15:29:36 +11:00
md_5
0bc2724e51 SPIGOT-2376: Way to distinguish Zombie professions. 2016-06-12 10:28:09 +10:00
md_5
8b94601269 Better map Zombie/Villager professions. 2016-06-09 12:20:30 +10:00
md_5
a8a4bedd2a Update to Minecraft 1.10 2016-06-09 11:43:49 +10:00
md_5
c5e9a169fa Minecraft 1.9.4 2016-05-10 21:47:39 +10:00
md_5
aa008dff0f Update to Minecraft 1.9 2016-03-01 09:32:45 +11:00
Thinkofdeath
24557bc2b3 Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
2014-11-28 17:16:30 +11:00
aPunch
169c2ee8cb [Bleeding] Added Ageable interface for Villagers and Animals to extend. Addresses BUKKIT-1232 2012-03-21 16:05:07 -04:00
Nathan Adams
ec35500c63 Implemented Villager API for getting/setting Profession. This adds BUKKIT-887 2012-03-03 01:58:40 +00:00
Celtic Minstrel
af51313ffb [Bleeding] Added EntityType to replace CreatureType. 2012-02-22 22:06:29 -05:00
Andrew Ardill
2759809ecb Fix Craft Entity constructors and toStrings.
Also, standardise getHandle and clean up in general.
getHandle is now using the 'entity' member variable instead of
super.getHandle, as this reduces the number of chained calls needed.
2011-11-29 21:22:35 +11:00
Andrew Ardill
0c88f05c0d Fix CraftVillager constructor to only take an EntityVillager 2011-11-29 09:46:20 +11:00
Erik Broes
345ea36c7b Update for 1.0.0 2011-11-20 00:01:33 -08:00