Commit Graph

201 Commits

Author SHA1 Message Date
Spottedleaf 8170ae9d64 Allow Blocks to be accessed via a long key
The key can be retrieved via methods Location#toBlockKey() and
Block#getBlockKey()

World provides lookup for blocks by long key via method World#getBlockAtKey(long)

The formatting for the key is as follows:

10 bit y|27 bit z|27 bit x

The y value is considered unsigned while z and x are considered two's complement

Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]
2018-08-14 21:42:10 -07:00
Aikar 1dd927ee10 Provide Chunk Coordinates as a Long API
Allows you to easily access the chunks X/z as a long, and a method
to look up by the long key too.
2018-08-04 19:37:35 -04:00
Brokkonaut f8562d67ca Add World.getEntity(UUID) API 2018-07-03 16:07:16 +02:00
Aikar 9624ed131b Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.

Co-authored-by: Esoteric Enderman <90862990+EsotericEnderman@users.noreply.github.com>
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2017-12-19 16:24:42 -05:00
Aikar 2a57740d34 Expand World.spawnParticle API and add Builder
Adds ability to control who receives it and who is the source/sender (vanish API)
the standard API is to send the packet to everyone in the world, which is ineffecient.

This adds a new Builder API which is much friendlier to use.
2017-08-29 23:58:48 -04:00
Aikar f8d5489645 Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
2018-04-30 17:55:28 -04:00
Zach Brown 0c37d20354 Fix upstream javadocs 2017-06-10 16:59:40 -05:00
Aikar 204f5daef7 Provide E/TE/Chunk count stat methods
Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
2017-01-07 15:23:03 -05:00
Byteflux 5fe2709f4c Add view distance API
Add per player no-tick, tick, and send view distances.

Also add send/no-tick view distance to World.
2016-02-29 18:05:37 -06:00
Riley Park 15081a5912 Adventure
Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
2021-01-29 17:21:55 +01:00
Bukkit/Spigot 7e29c12d04 Silenceable Lightning API
By: drXor <mcyoungsota@gmail.com>
2014-02-23 16:16:29 -04:00
Bukkit/Spigot 8de3a6a15d Skeleton API Implementations
By: md_5 <git@md-5.net>
2017-05-15 15:16:15 +10:00
Bukkit/Spigot 0023e5549a #1082: Add "since" to Deprecation annotations
By: DerFrZocker <derrieple@gmail.com>
2024-11-25 07:52:33 +11:00
Bukkit/Spigot b4ac71a201 #1018: Add methods to get players seeing specific chunks
By: MetallicGoat <the.great.metallic.goat@gmail.com>
2024-06-08 09:03:39 +10:00
Bukkit/Spigot f3502f6dac Update to Minecraft 1.20.5
By: md_5 <git@md-5.net>
2024-04-24 01:15:00 +10:00
Bukkit/Spigot c71ea48a49 SPIGOT-7613: Make note of impact of mobGriefing gamerule for World#createExplosion()
By: 2008Choco <hawkeboyz2@hotmail.com>
2024-04-17 19:13:27 +10:00
Bukkit/Spigot 1f1ef375be #988: Add World#getIntersectingChunks(BoundingBox)
By: Flo0 <flo.roma@web.de>
2024-04-01 09:43:44 +11:00
Bukkit/Spigot 7087785389 #963: Add API for in-world structures
By: coll1234567 <joshl5324@gmail.com>
2024-02-04 10:04:33 +11:00
Bukkit/Spigot 83aefc37a9 SPIGOT-3071, #969: Add entity spawn method with spawn reason
By: DerFrZocker <derrieple@gmail.com>
2024-01-31 20:08:03 +11:00
Bukkit/Spigot d34ae053c8 Add API for per-world simulation distances
Adapted from Spigot commit 6234669574cf0c5fb951f504399f4b171d1a09a7.

By: md_5 <git@md-5.net>
2023-12-23 14:32:35 +11:00
Bukkit/Spigot ce1f206316 Add API for per-world view distances
Adapted from Spigot commit ea7e48b3e6d973551afe440a8cbc6d96a49d10fc.

By: Spottedleaf <Spottedleaf@users.noreply.github.com>
2023-12-23 14:32:33 +11:00
Bukkit/Spigot 1f322369a0 #938: Various Sound API improvements
By: Jishuna <joshl5324@gmail.com>
2023-11-17 19:54:43 +13:00
Bukkit/Spigot 44cbcb80d4 #937: Minor improvements to World#rayTrace documentation
By: Jishuna <joshl5324@gmail.com>
2023-11-16 15:36:28 +13:00
Bukkit/Spigot 72d2572304 #935: Change Consumer and Predicates to super
By: DerFrZocker <derrieple@gmail.com>
2023-11-14 19:50:23 +13:00
Bukkit/Spigot 199105c1d5 SPIGOT-7080: Add World#locateNearestBiome
By: Jishuna <joshl5324@gmail.com>
2023-10-09 20:11:42 +11:00
Bukkit/Spigot 8f34277f6a #898: Use Java Consumer instead of Bukkit Consumer
By: DerFrZocker <derrieple@gmail.com>
2023-09-22 02:57:09 +10:00
Bukkit/Spigot f45d2e6a77 SPIGOT-7195, SPIGOT-7197: Add DataPack API
By: Doc <nachito94@msn.com>
2023-05-30 19:05:41 +10:00
Bukkit/Spigot 1ca237423e #854: Move getHighestBlockYAt methods from World to RegionAccessor
By: Jishuna <joshl5324@gmail.com>
2023-05-11 06:48:38 +10:00
Bukkit/Spigot ad473b0e5c SPIGOT-6780: Improve documentation for World#spawnFallingBlock
By: Doc <nachito94@msn.com>
2023-04-16 10:32:33 +10:00
Bukkit/Spigot 0b65fda2e0 #832: Allow getting chunks without generating them and optimize chunk data request for ungenerated chunks
By: DerFrZocker <derrieple@gmail.com>
2023-04-02 13:10:32 +10:00
Bukkit/Spigot 0bb0794be6 #808: Add custom sound parameter option for playSound with entity as source
By: Gero <gecam59@gmail.com>
2023-01-28 11:38:58 +11:00
Bukkit/Spigot 869f647744 SPIGOT-1244, SPIGOT-6860, SPIGOT-6874: Various Javadoc and formatting fixes
By: Parker Hawke <hawkeboyz2@hotmail.com>
2022-09-24 09:31:42 +10:00
Bukkit/Spigot 24ea881685 SPIGOT-7011, SPIGOT-7065: Overhaul of structures
By: DerFrZocker <derrieple@gmail.com>
2022-07-01 20:41:02 +10:00
Bukkit/Spigot 4dea0ab04a #742: Make World implement Keyed
By: pop4959 <pop4959@gmail.com>
2022-05-09 18:07:47 +10:00
Bukkit/Spigot 0458eb0bfc #724: Add PDC to World
By: DerFrZocker <derrieple@gmail.com>
2022-02-15 09:35:32 +11:00
Bukkit/Spigot dd8840cd02 SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls
By: Doc <nachito94@msn.com>
2022-02-07 18:47:24 +11:00
Bukkit/Spigot 5dd0f2a5b6 #706: Add playSound with Entity as source
By: Gero <gecam59@gmail.com>
2022-01-11 18:53:34 +11:00
Bukkit/Spigot 8b6e67635a #662: Support for configuring Water Underground Creatures spawn settings
By: Doc <nachito94@msn.com>
2021-10-05 11:31:21 +11:00
Bukkit/Spigot 99ce197044 SPIGOT-6697: Deprecate generateTree with BlockChangeDelegate as it does not handle tiles
By: md_5 <git@md-5.net>
2021-08-22 18:12:37 +10:00
Bukkit/Spigot c255eb3333 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.

By: DerFrZocker <derrieple@gmail.com>
2021-08-15 08:08:11 +10:00
Bukkit/Spigot 7f258ff344 Add dimension setting getters to World
By: Doc <nachito94@msn.com>
2021-08-11 18:57:21 +10:00
Bukkit/Spigot fbf66f5957 SPIGOT-6302: Javadoc fix for World#spawnEntity()
Method does not return null

By: Mmaarten <mmaartendisc@gmail.com>
2021-04-20 18:47:00 +10:00
Bukkit/Spigot 3b841edc7c SPIGOT-5877: Add scaffolding for custom dimensions and biomes
By: Martoph <sager1018@gmail.com>
2021-04-11 17:54:45 +10:00
Bukkit/Spigot b2935a657a SPIGOT-6357: Add World#getMinHeight
By: md_5 <git@md-5.net>
2021-03-28 19:31:39 +11:00
Bukkit/Spigot d1017aa606 #591: Add option for a consumer before spawning an item
By: Martoph <sager1018@gmail.com>
2021-03-09 08:47:28 +11:00
Bukkit/Spigot 652b7b8ea8 SPIGOT-5778: Added World.getGameTime method
By: Jakub Zacek <dawon.cz@gmail.com>
2021-02-13 10:25:32 +11:00
Bukkit/Spigot c88819ddd0 Fix javadoc in previous commit
By: md_5 <git@md-5.net>
2020-11-26 10:20:11 +11:00
Bukkit/Spigot 031310657d #561: Add clear weather World API
By: Parker Hawke <hawkeboyz2@hotmail.com>
2020-11-26 10:08:22 +11:00
Bukkit/Spigot 87927f4484 #543: Let World#setSpawnLocation() support an angle
By: Parker Hawke <hawkeboyz2@hotmail.com>
2020-08-18 17:54:34 +10:00
Bukkit/Spigot 4cf580fde0 Add configuration options for water_ambient spawning
By: md_5 <git@md-5.net>
2020-06-26 18:39:34 +10:00