396 Commits

Author SHA1 Message Date
md_5
07e5dd5d59
Update to Minecraft 1.20.3 2023-12-06 03:40:00 +11:00
Jishuna
0478e0417b
#1266: Add support for virtual entities 2023-11-19 19:03:35 +13:00
Jishuna
8e162d0083
#1301: Various Sound API improvements 2023-11-17 19:54:48 +13:00
DerFrZocker
d433f086d5
#1297: Change Consumer and Predicates to super 2023-11-14 19:50:14 +13:00
DerFrZocker
67a52a6485
#1279: Back Particle by a minecraft registry 2023-10-21 13:42:09 +11:00
Jishuna
a6bcb84890
SPIGOT-7080: Add World#locateNearestBiome 2023-10-09 20:11:46 +11: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
Owen1212055
c1279f7751
#1209: Clean up various patches 2023-06-24 17:15:05 +10:00
md_5
6962456f98
Fix unintended change to playSound contract and various other issues 2023-06-12 21:29:41 +10:00
md_5
0cd47ae827
Remove changes to string API contracts introduced by prior commits 2023-06-12 20:39:58 +10: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
Doc
dbc70bed55
SPIGOT-7195, SPIGOT-7197: Add DataPack API 2023-05-30 19:05:48 +10:00
Jishuna
7fe5ee022a
#1186: Move getHighestBlockYAt methods from World to RegionAccessor 2023-05-11 06:48:41 +10:00
Doc
f92a41c396
#1181: Consolidate Location conversion code 2023-04-19 19:59:19 +10:00
DerFrZocker
1fddefce1c
#1155: Allow getting chunks without generating them and optimize chunk data request for ungenerated chunks 2023-04-02 13:06:59 +10:00
md_5
bcedf28a1b
Update to Minecraft 1.19.4 2023-03-15 03:30:00 +11:00
Gero
b1059a82ea
#1134: Add custom sound parameter option for playSound with entity as source 2023-01-28 11:39:20 +11:00
md_5
19e6be0209
Update to Minecraft 1.19.3 2022-12-08 03:00:00 +11:00
DerFrZocker
68f888ded3
SPIGOT-7011, SPIGOT-7065: Overhaul of structures 2022-07-01 20:41:04 +10:00
md_5
64c15270e7
Update to Minecraft 1.19 2022-06-08 02:00:00 +10:00
Doc
f3c7a6ac7a
SPIGOT-7019: Add yaw in World#getSpawnLocation 2022-05-13 11:24:17 +10:00
pop4959
7fdd7941f6
#1046: Make World implement Keyed 2022-05-09 18:07:51 +10:00
md_5
cf391b51c8
Pass in SpawnReason rather than boolean 2022-04-18 11:05:15 +10:00
Doc
098aecb04f
SPIGOT-7001: Fix entity already exists in CraftWorld#spawnFallingBlock 2022-04-18 11:05:12 +10:00
blablubbabc
4ac8fcce8d
SPIGOT-6980: Since 1.18.2, World#isChunkLoaded returned false for chunks that have just been loaded (e.g. inside ChunkLoadEvent).
Some changes of the 1.18.2 update have been reverted to resolve this regression.
2022-03-27 16:24:06 +11:00
md_5
05a38da190
Update to Minecraft 1.18.2 2022-03-01 02:00:00 +11:00
md_5
af4d848ffd
SPIGOT-6934: Bring plugin chunk tickets back in line with forceload tickets 2022-02-20 08:55:27 +11:00
DerFrZocker
cc5ddd7936
#1010: Add PDC to World 2022-02-15 09:36:00 +11:00
Doc
de95135562
SPIGOT-6927: Fix default value of spawn-limits in Worlds 2022-02-08 08:10:15 +11:00
Doc
febaa1c6f5
SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls 2022-02-07 18:52:16 +11:00
Gero
312d007f03
#990: Add playSound with Entity as source 2022-01-11 18:53:45 +11:00
Gero
c86a3f7a58
#959: Fix World#refreshChunk 2021-11-28 11:54:20 +11:00
md_5
806bb02c17
SPIGOT-6810: Improve / fix biome setting code 2021-11-27 16:42:28 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
Doc
346ebb7a7a
#934: Support for configuring Water Underground Creatures spawn settings 2021-10-05 11:39:21 +11:00
DerFrZocker
1492826118
SPIGOT-6249: Add Missing Effect Constants 2021-09-11 18:40:14 +10:00
md_5
78d5b35b82
SPIGOT-6697: Restore generateTree with BlockChangeDelegate behaviour 2021-08-22 18:12:59 +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
6cfc062a5b
Add dimension setting getters to World 2021-08-11 18:57:16 +10:00
Doc
2f038f2de0
#886: Add new Causes for LightningStrikeEvent 2021-07-13 19:16:36 +10:00
Bjarne Koll
85b8c1fda6
SPIGOT-6507: Implement abstract skeleton and stray conversion
The previous layout and class hierarchy of the skeleton API defined
variances of the skeleton, such as the wither skeleton or the stray, as
child types of the normal skeleton variance, which is technically
incorrect, yet did not produce any specific issue as the normal skeleton
variance did not have any unique logic.

With the introduction of powdered snow in the 1.17 update, the normal
skeleton variance now has unique logic, specifically the conversion to
a stay when stuck inside powdered snow, which cannot be represented in
the current API layout due to the prior mentioned hierarchy.

This commit implements the hierarchy changes made in the bukkit
repository by representing the new hierarchy on the craftbukkit side
through the CraftAbstractSkeleton and the respective additions to the
skeleton implementation in regards to the stray conversion.

This commit does not break ABI yet breaks backwards compatibility due to
the mentioned hierarchy changes. Plugins that previously used the
Skelton interface to compute whether or not an entity is skeleton-like
through instanceOf checks will now only match the normal skeleton variance
instead of any skeleton-like entity.
2021-06-14 10:01:19 +10:00
md_5
c9a92ad08e
SPIGOT-6536: Marker position not set on spawn 2021-06-13 10:25:21 +10:00
md_5
d747f8ed15
Fix NPE with World.getNearbyEntities 2021-06-11 17:24:50 +10:00
md_5
e2f5ea34e9
Update to Minecraft 1.17 2021-06-11 15:00:00 +10:00
DerFrZocker
f3ed1ac1dc
SPIGOT-6430: Fix fungi tree not generating 2021-04-29 07:43:26 +10:00
md_5
28d72c4bd8
SPIGOT-6428: World.generateTree does not generate bee nests 2021-04-18 17:42:35 +10:00
Martoph
0e26ddb6a3
SPIGOT-5877: Add scaffolding for custom dimensions and biomes 2021-04-11 17:54:48 +10:00