Commit Graph

2636 Commits

Author SHA1 Message Date
Bukkit/Spigot
f84947b942 #653: Add World#spawn with randomizeData parameter
The current implementation of World#spawn or World#spawnEntity
respectively, always prepares/finalizes the spawn of every entity
spawned through the API. While this is great to simulate natural
spawning of entities in the world through the API, it fails at
reliably creating default entities for purposes other than vanilla
gameplay.

While the caller of the API could attempt to undo all of the
customization that is applied in the prepare/finalization step, they are
numerous (reaching from sheep colour to equipment) and in some cases,
such as the chicken jockey, even spawn in other entities.

Hence this commit introduces a new overload to the World#spawn and
World#spawnEntity methods that accepts the 'randomizeData' parameter
that, when set to false, skips the prior mentioned
preparation/finalization step.

By: Bjarne Koll <lynxplay101@gmail.com>
2021-08-18 18:04:51 +10:00
Bukkit/Spigot
923e0e64b5 Damageable should extend ItemMeta
By: md_5 <git@md-5.net>
2021-08-16 15:36:45 +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
511a9aba49 Update ASM
By: md_5 <git@md-5.net>
2021-08-13 08:45: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
5fef84d43d SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
By: Brokkonaut <hannos17@gmx.de>
2021-08-05 08:43:00 +10:00
Bukkit/Spigot
f33444292a SPIGOT-6691: Material.LAVA_CAULDRON is not Levelled
By: Doc <nachito94@msn.com>
2021-08-04 17:10:14 +10:00
Bukkit/Spigot
338df40644 #642: Add Crafting methods to API
By: James Peters <jameslfc19@gmail.com>
2021-07-22 11:35:43 +10:00
Bukkit/Spigot
146a88e577 SPIGOT-6641: Use varargs in sendMessage
By: DerFrZocker <derrieple@gmail.com>
2021-07-22 09:38:11 +10:00
Bukkit/Spigot
95cc961f13 SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled
By: DerFrZocker <derrieple@gmail.com>
2021-07-22 09:36:51 +10:00
Bukkit/Spigot
be93ac366d SPIGOT-6661: Fix missing radius from GenericGameEvent
By: md_5 <git@md-5.net>
2021-07-21 09:34:12 +10:00
Bukkit/Spigot
a2f69a4ad8 SPIGOT-6369: Add ItemStack to HangingPlaceEvent
By: DerFrZocker <derrieple@gmail.com>
2021-07-21 09:32:48 +10:00
Bukkit/Spigot
2e77f4180e SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent
By: md_5 <git@md-5.net>
2021-07-18 11:07:59 +10:00
Bukkit/Spigot
ba6c523bf3 SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron
By: md_5 <git@md-5.net>
2021-07-18 10:14:43 +10:00
Bukkit/Spigot
581806d851 SPIGOT-6642: Throw better message if plugin.yml is empty
By: md_5 <git@md-5.net>
2021-07-17 11:25:17 +10:00
Bukkit/Spigot
c30e6c45cd #636: Add FurnaceStartSmeltEvent
By: Rabbitual <38820203+Rabbitual@users.noreply.github.com>
2021-07-17 11:19:48 +10:00
Bukkit/Spigot
16922e92de SPIGOT-6646: Issue with map palette ranges
By: md_5 <git@md-5.net>
2021-07-15 20:32:47 +10:00
Bukkit/Spigot
64a83e2da9 #640: Add new Causes for LightningStrikeEvent
By: Doc <nachito94@msn.com>
2021-07-13 19:16:08 +10:00
Bukkit/Spigot
d4eef77474 SPIGOT-6637: Revert "#636: Add FurnaceStartSmeltEvent"
This reverts commit 09f5cdf4f8.

By: md_5 <git@md-5.net>
2021-07-11 12:26:48 +10:00
Bukkit/Spigot
730e0df7e4 SPIGOT-6623: Missing API reasons for entity freezing
By: Doc <nachito94@msn.com>
2021-07-11 09:32:32 +10:00
Bukkit/Spigot
09f5cdf4f8 #636: Add FurnaceStartSmeltEvent
By: Rabbitual <38820203+Rabbitual@users.noreply.github.com>
2021-07-11 09:25:55 +10:00
Bukkit/Spigot
0637c3f854 Update to Minecraft 1.17.1
By: md_5 <git@md-5.net>
2021-07-07 00:00:00 +10:00
Bukkit/Spigot
e0955fd24a SPIGOT-6527: Add AxolotlBucketMeta
By: Doc <nachito94@msn.com>
2021-07-04 09:31:17 +10:00
Bukkit/Spigot
6dd24e4af2 Update Maven plugins
By: md_5 <git@md-5.net>
2021-07-03 11:06:15 +10:00
Bukkit/Spigot
34e6b033ad SPIGOT-6616: Cancellable StriderTemperatureChangeEvent
By: md_5 <git@md-5.net>
2021-07-03 09:36:33 +10:00
Bukkit/Spigot
10f782354b SPIGOT-6605: Add method to access value of enforce-whitelist
By: md_5 <git@md-5.net>
2021-06-26 09:58:21 +10:00
Bukkit/Spigot
3835d0824b #633: Add isTrusting/setTrusting to Ocelot.
By: Ibrahim Ansari <ansari.ibrahim1@gmail.com>
2021-06-21 08:40:18 +10:00
Bukkit/Spigot
36f10a3e42 SPIGOT-6587: Update documentation/error of drop chance API
By: md_5 <git@md-5.net>
2021-06-20 12:15:14 +10:00
Bukkit/Spigot
b821059026 SPIGOT-6570: Missing InventoryType: COMPOSTER
By: md_5 <git@md-5.net>
2021-06-17 08:29:25 +10:00
Bukkit/Spigot
14e4e9a16c SPIGOT-6562: Add more specific sculk sensor event
By: md_5 <git@md-5.net>
2021-06-16 08:34:08 +10:00
Bukkit/Spigot
e0d1266d3e #631: Add Villager#shakeHead
By: VendoAU <reillyreaby@gmail.com>
2021-06-14 19:13:16 +10:00
Bukkit/Spigot
fd771b653b #629: Add LivingEntity#isClimbing
By: Martoph <sager1018@gmail.com>
2021-06-14 19:10:55 +10:00
Bukkit/Spigot
6a59a19dde SPIGOT-6507: Introduce 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 introduces the AbstractSkeleton interface, which follows the
concept of other abstract interfaces like AbstractArrow and serves as a
common parent to the existing skeleton variances. Furthermore this
commit introduces the previously mentioned stray conversion to the
normal skeleton variance.

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.

By: Bjarne Koll <lynxplay101@gmail.com>
2021-06-14 10:00:57 +10:00
Bukkit/Spigot
106d3eef70 SPIGOT-6551: CaveVinesPlant missing extends BlockData
By: md_5 <git@md-5.net>
2021-06-14 08:43:45 +10:00
Bukkit/Spigot
6b0ff8582b #621: Add Block#getCollisionShape and associated API
By: konsolas <vincentyntang@gmail.com>
2021-06-14 08:32:51 +10:00
Bukkit/Spigot
34291f36d1 #623: Add Block#getBreakSpeed(Player)
By: konsolas <vincentyntang@gmail.com>
2021-06-14 08:27:32 +10:00
Bukkit/Spigot
b29d02153d #621: Add HumanEntity#getItemInUse and Material#getSlipperiness
By: konsolas <vincentyntang@gmail.com>
2021-06-12 21:07:25 +01:00
Bukkit/Spigot
e1c30137fb #622: Add methods to check if item is the breed item for an entity
By: Nathat23 <nathat890@outlook.com>
2021-06-13 08:37:51 +10:00
Bukkit/Spigot
f798154234 Clarify Player#breakBlock only works for blocks in the same world
By: md_5 <git@md-5.net>
2021-06-13 08:28:21 +10:00
Bukkit/Spigot
7efb9ecbfb SPIGOT-6514: Small Dripleaf block data is missing half property
By: DerFrZocker <derrieple@gmail.com>
2021-06-12 08:47:03 +10:00
Bukkit/Spigot
9777d23bd5 #619: Add Player#breakBlock()
By: Parker Hawke <hawkeboyz2@hotmail.com>
2021-06-12 08:29:40 +10:00
Bukkit/Spigot
f034b5f0c2 Fix bad merge of SPIGOT-6502 fix
By: blablubbabc <lukas@wirsindwir.de>
2021-06-11 21:49:32 +10:00
Bukkit/Spigot
66524269f9 Downgrade SnakeYAML due to issues with comments parsing
By: md_5 <git@md-5.net>
2021-06-11 20:50:27 +10:00
Bukkit/Spigot
ba903c9c6d Fix inverted visual fire docs
By: DiamondDagger590 <diamonddagger590@gmail.com>
2021-06-11 16:25:57 +10:00
Bukkit/Spigot
153752dfac Update to Minecraft 1.17
By: md_5 <git@md-5.net>
2021-06-11 15:00:00 +10:00
Bukkit/Spigot
2e1a3720cf SPIGOT-6502: Loading a class from a library of another plugin resulted in a ClassCastException.
By: blablubbabc <lukas@wirsindwir.de>
2021-06-11 14:00:18 +10:00
Bukkit/Spigot
24bab712b3 #615: Calculate the reachable nodes only once per transitive dependency check.
By: blablubbabc <lukas@wirsindwir.de>
2021-06-05 08:09:50 +10:00
Bukkit/Spigot
c6409a81fd #522: Add piglin bartering API
By: Lars Dormans <lars.dormans@live.nl>
2021-05-28 08:59:13 +10:00
Bukkit/Spigot
3d74697e24 #613: Add PlayerBucketEntityEvent and make PlayerBucketFishEvent deprecated in favor of the newer, more generic event
By: DiamondDagger590 <diamonddagger590@gmail.com>
2021-05-28 08:39:24 +10:00
Bukkit/Spigot
b21ce6d13a SPIGOT-6464: Fix ShulkerBox#getColor for undyed shulkers
By: md_5 <git@md-5.net>
2021-05-23 08:30:14 +10:00