52 Commits

Author SHA1 Message Date
Doc
2e61a5f8eb
SPIGOT-6888: Add SpawnReason for Vex spawned by Evokers 2022-01-14 10:55:59 +11:00
DerFrZocker
cc86ab1886
SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Only cancel knockback if the damage event was canceled 2022-01-03 18:07:01 +01:00
md_5
fb92f345d9
SPIGOT-6278: Persistent piglins count towards mob cap 2022-01-02 11:45:52 +11:00
Matthew
752fa511a9
#374: Add isJohnny / setJohnny for Vindicator 2022-01-01 09:58:04 +11:00
Matthew
19f2af066e
#373: Add trap related methods to SkeletonHorse 2022-01-01 09:58:04 +11:00
blablubbabc
0ba6b90135
SPIGOT-5766: The VillagerReplenishTradeEvent is now called when a villager restocks its trades. 2021-12-25 10:14:17 +11:00
DerFrZocker
bdff7d56fb
SPIGOT-5627: Leads vanish when transporting leashed entities through a Nether portal 2021-12-25 09:39:27 +11:00
md_5
3c2af1b7f5
SPIGOT-6831: Fix llama strength crash 2021-12-06 15:15:09 +11:00
Rafael S. M. Santos
fd3478bc77
#967: Store last lava contact location for events 2021-12-04 08:06:32 +11:00
md_5
6f3509d12e
Release POIs when villagers are removed by plugins 2021-12-03 15:05:20 +11:00
md_5
2ccb6a9b9f
SPIGOT-6828: <player> fell off a ladder/vines death message not supported 2021-12-02 12:29:35 +11:00
Doc
a46e7f18e8
SPIGOT-6820: VillagerCareerChangeEvent's ChangeReason is sometimes incorrect 2021-12-01 08:26:14 +11:00
md_5
5a39a236c1
Update to Minecraft 1.18-pre8 2021-11-25 08:00:00 +11:00
md_5
2f6662d467
Improve multi-dimension code 2021-11-23 18:39:43 +11:00
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
md_5
eb14700779
SPIGOT-6797: EntityInteractEvent called with incorrect location 2021-11-21 11:23:17 +11:00
md_5
f63504952f
SPIGOT-6798: EntityChangeBlockEvent called with incorrect location 2021-11-21 11:18:06 +11:00
Doc
9217b523e5
#929: Call EntityBlockFormEvent for Wither Rose placed by dead entity 2021-09-06 18:57:16 +10:00
Phoenix616
6719d1f1e7
SPIGOT-6708: Fix Experience Orb value not being updated in mend event 2021-09-03 18:37:44 +10:00
md_5
c949675e1f
SPIGOT-6713: Cancelling EntityTransformEvent Causes Deceased Slimes To Not Despawn 2021-08-22 18:07:31 +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
md_5
8dfa97afe4
SPIGOT-6669: Shearing a Mooshroom does not fire EntityDropItemEvent 2021-07-23 16:36:16 +10:00
md_5
0abf420c4b
SPIGOT-6665: Shearing a Snowman does not drop a carved pumpkin 2021-07-22 17:51:53 +10:00
md_5
9e06bb2a26
SPIGOT-6663: Chicken Jockeys chickens don't despawn 2021-07-22 09:53:26 +10:00
DerFrZocker
699f2d36b0
SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled 2021-07-22 09:36:54 +10:00
Doc
9add952b76
SPIGOT-6623: Missing API reasons for entity freezing 2021-07-11 09:32:27 +10:00
md_5
fb556bfa14
Update to Minecraft 1.17.1 2021-07-07 00:00:00 +10:00
md_5
cbe0ac7ce1
SPIGOT-6616: Cancellable StriderTemperatureChangeEvent 2021-07-03 09:36:51 +10:00
Ibrahim Ansari
9ba1c67efc
#870: Add isTrusting/setTrusting to CraftOcelot. 2021-06-21 08:43:09 +10:00
md_5
aa1fae732c
SPIGOT-6586: EntityChangeBlockEvent for falling block does not cancel properly 2021-06-20 08:48:15 +10:00
md_5
68d403188a
SPIGOT-6580: Cancelling SlimeSplitEvent Causes Infinite Loop 2021-06-19 08:46:31 +10:00
VendoAU
a07e783a69
#865: Implement Villager#shakeHead 2021-06-14 19:15:13 +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
cbf2f67802
SPIGOT-6508: Rename conflicted getServer 2021-06-11 21:40:36 +10:00
md_5
e2f5ea34e9
Update to Minecraft 1.17 2021-06-11 15:00:00 +10:00
md_5
c51c0f7fbb
SPIGOT-6483: Fix cancelling EntityPickupEvent for villagers 2021-06-01 18:53:01 +10:00
md_5
769a579cb0
SPIGOT-6482: Baby piglins will pick up more items than vanilla 2021-06-01 18:06:53 +10:00
Lars Dormans
fd905ab527
#703: Add piglin bartering API 2021-05-28 09:02:42 +10:00
DerFrZocker
afa0678e1b
SPIGOT-6133: Chorus fruit consumption calls PlayerTeleportEvent multiple times 2021-05-25 08:29:13 +10:00
Martoph
59e2ce9b75
SPIGOT-6224: EntityBreedEvent getEntity location inaccuracy 2021-05-11 18:33:28 +10:00
Julian van den Berkmortel
8a516e0bbb
SPIGOT-6452: Call EntityPickupItemEvent for villagers 2021-05-09 16:57:25 +10:00
Martoph
7c4adc61d0
#776: Add ability to cancel ProjectileHitEvent 2021-05-09 16:51:44 +10:00
Julian van den Berkmortel
6f55b5b888
SPIGOT-6442: Do not cancel zero damage on fireballs 2021-04-30 17:53:58 +10:00
Julian van den Berkmortel
69c8e78509
SPIGOT-6373: Add getAttachedFace and setAttachedFace to the Shulker API 2021-04-28 11:53:21 +10:00
DiamondDagger590
c5494d195a
#683: Add PlayerBucketFishEvent 2021-04-25 08:34:44 +10:00
Julian van den Berkmortel
6b8cd9a7cb
SPIGOT-6207: forcibly drop the items of a converted zombie villager 2021-04-12 08:28:19 +10:00
md_5
170d6febd5
SPIGOT-6417: Add Creeper fuse ticks API 2021-04-11 17:32:26 +10:00
md_5
be0e945812
Add mc-dev imports 2021-04-07 15:03:29 +10:00
md_5
b530534f03
Remove some outdated PAIL comments 2021-04-04 17:14:53 +10:00
md_5
9c32a8794c
Fix broken wandering traders 2021-03-20 08:55:48 +11:00