133 Commits

Author SHA1 Message Date
md_5
a7b8b0270a
Update to Minecraft 1.18-pre5 2021-11-22 09:00:00 +11:00
Doc
376edf4fe5
SPIGOT-6779: Fix LivingEntity#attack for Player entities 2021-11-02 18:33:35 +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
md_5
9e06bb2a26
SPIGOT-6663: Chicken Jockeys chickens don't despawn 2021-07-22 09:53:26 +10:00
Martoph
3252ff189c
#863: Add LivingEntity#isClimbing 2021-06-14 19:11:46 +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
Shane Bee
f8d4da08e1
#743: LivingEntity - add methods for getting/setting invisibility 2020-09-19 17:48:58 +10:00
md_5
bf3d720714
Update to Minecraft 1.16.3 2020-09-11 07:00:00 +10:00
Martoph
39806409e7
#697: Add ArrowBodyCountChangeEvent 2020-09-02 18:59:17 +10:00
Parker Hawke
eae1594350
#721: Add EntityCategory API to LivingEntity 2020-08-27 11:42:39 +10:00
md_5
b136f8430d
SPIGOT-5804: Cannot launch Entity Firework 2020-06-25 12:57:58 +10:00
Phoenix616
2b00831c95
SPIGOT-2106, SPIGOT-3942: Improve collidable API 2020-06-25 10:00:00 +10:00
md_5
7ea3c040bc
Update to Minecraft 1.16.1 2020-06-25 10:00:00 +10:00
md_5
94cb030fb5 SPIGOT-5673: swingHand API does not show to self 2020-04-22 12:06:24 +10:00
md_5
ce66f6937b Misc checkstyle fixes 2020-04-14 12:34:43 +10:00
md_5
3d61a853e3 Fix formatting in CraftLivingEntity 2020-02-23 19:01:11 +11:00
konsolas
f7ab30557e #633: Add LivingEntity#attack, LivingEntity#swingMainHand, LivingEntity#swingOffHand 2020-02-23 19:00:18 +11:00
md_5
d5ef2eab9e SPIGOT-5591: Allow concurrent potion effects 2020-02-23 10:33:10 +11:00
md_5
6ddeb980cf SPIGOT-5317: Create accessors for player absorption hearts 2019-09-13 20:04:43 +10:00
Yannick Lamprecht
eb99127a36 SPIGOT-4833: Allow access to LivingEntity memories 2019-05-19 20:09:15 +10:00
md_5
29b90d2410 SPIGOT-4819: Continue refactoring of Arrow-related APIs 2019-04-30 21:23:11 +10:00
md_5
5193f762a7 SPIGOT-4803: Fox related APIs 2019-04-28 17:59:12 +10:00
md_5
e3df3d5cda Add Override annotations where appropriate 2019-04-28 11:38:01 +10:00
md_5
5fea790398 Apply import ordering rules to CraftBukkit classes 2019-04-23 14:56:58 +10:00
md_5
a2d787f6eb Update to Minecraft 1.14-pre5 2019-04-23 12:00:00 +10:00
blablubbabc
4a47be6164 Add ray tracing and bounding box API 2018-10-26 20:00:00 +11:00
md_5
ce1af0c348 Update to Minecraft 1.13.1 2018-08-26 12:00:00 +10:00
md_5
89492315d1 launchProjectile Fish -> FishHook
Thanks Senmori & SpoonFed on IRC
2018-08-21 18:21:11 +10:00
md_5
272426acd7 SPIGOT-4199: Riptide related APIs 2018-08-02 09:38:52 +10:00
md_5
4d3ef4821f SPIGOT-4164: Treat new _AIR blocks as air 2018-07-28 08:28:56 +10:00
md_5
095239d4c5 SPIGOT-4159: Fix Player.launchProjectile(Trident.class) 2018-07-27 14:29:02 +10:00
md_5
1a6b4f5392 Update to Minecraft 1.13 2018-07-22 12:00:00 +10:00
kaenganxt
814c742554 SPIGOT-840, SPIGOT-2522: [Draft] Add EntityPotionEffectChangeEvent
Discussion ongoing in PR #449
2018-07-20 16:06:34 +10:00
md_5
fe7db9d53b Add EntityToggleSwimEvent and isSwimming / setSwimming API 2018-07-15 16:17:35 +10:00
md_5
421c1728c8 Update to Minecraft 1.13-pre7 2018-07-15 10:00:00 +10:00
md_5
9ab298de7b SPIGOT-3807: Improve getEyeHeight 2018-02-10 12:17:00 +11:00
md_5
ab09b27ef4 Remove a bunch of spurious _INVALID_ methods. 2018-01-05 13:04:18 +11:00
md_5
2a927e8638 Update to Minecraft 1.12.1 2017-08-03 23:00:00 +10:00
md_5
b5dc294d32 SPIGOT-3485: Launch shulker bullets as projectiles 2017-08-03 08:23:27 +10:00
md_5
d7cd7275f2 SPIGOT-3379: Generalise canPickupItems to other entities. 2017-06-26 08:34:52 +10:00
md_5
1004352990 Update to Minecraft 1.12-pre5 2017-05-19 21:00:13 +10:00
Lukas Hennig
2b6c9f40ae Set health before entity death. 2017-05-04 19:18:46 +10:00
md_5
a552117725 SPIGOT-3054: Correct LLamaSpit launching 2017-02-09 09:14:44 +11:00
Parker Hawke
dfe4ed1c3e Add implementation for LlamaSpit in ProjectileSource#launchProjectile 2017-02-01 13:14:41 +11:00
md_5
c1aa85918e SPIGOT-3040: Round health to float for validation 2017-01-28 11:41:09 +11:00
md_5
c25ddf063a Update to Minecraft 1.11 2016-11-17 12:41:03 +11:00
md_5
33071ecfff SPIGOT-2752: Fix resetMaxHealth 2016-11-04 18:11:36 +11:00
md_5
6053c5c8ac SPIGOT-2578: Method to get PotionEffect of specific type. 2016-08-07 10:53:39 +10:00
md_5
83a9dbdef6 SPIGOT-2559: Kill all entities when called with setHealth(0) 2016-07-30 10:06:07 +10:00