122 Commits

Author SHA1 Message Date
Doc
3b214b5a21
SPIGOT-6803: Fix ServerPing not using the new logic for show players in 1.18 2021-11-24 07:28:22 +11:00
md_5
2f6662d467
Improve multi-dimension code 2021-11-23 18:39:43 +11:00
md_5
6ac2e0325a
SPIGOT-6802: Fix major issues with --forceUpgrade
More to come
2021-11-23 17:13:52 +11:00
md_5
37e63e63e8
Fix loading / creating secondary worlds (nether/end) 2021-11-23 15:03:34 +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
DerFrZocker
747a73ec92
SPIGOT-6772: Use entity mailbox and re-schedule entities if they get unloaded 2021-11-01 18:54:44 +11:00
Doc
eb9a0f34af
#945: Allow setting BrewEvent results 2021-10-30 18:16:39 +11:00
DerFrZocker
f0f801e58e
SPIGOT-5988: Bedspawn doesn't clear after dying when spawn is blocked 2021-10-16 19:39:14 +11:00
blablubbabc
e2ac9c6ba8
SPIGOT-6758: Reset ItemSign#openSign when aborting the block placement early 2021-10-16 18:49:19 +11:00
md_5
b86793136b
SPIGOT-6760: Chest#getInventory only returns one half of a double chest when one or both halves are blocked 2021-10-16 18:49:04 +11:00
blablubbabc
4faf479e6c
SPIGOT-6754: We ignore any still present TileEntity now when we create a BlockState for a block of type AIR.
During block destruction, the type of the block may already have been set to AIR while the TileEntity has not yet been removed.
Also, TileEntity#getOwner() skips the whole BlockState construction now if the block is of type AIR.

This removes the previous workaround again of returning a dummy CraftBlockEntityState in this case.
2021-10-10 07:55:53 +11:00
Sander Knauff
1df303e707
SPIGOT-2903: Add Structure API 2021-10-05 12:24:21 +11:00
Doc
346ebb7a7a
#934: Support for configuring Water Underground Creatures spawn settings 2021-10-05 11:39:21 +11:00
blablubbabc
dc764e7a2f
#877: Improve and simplify CraftBlockState 2021-09-29 18:56:16 +10:00
Lars Dormans
9aeb46ae1f
SPIGOT-6023, SPIGOT-6745: Fix missing BlockDispenseArmorEvents 2021-09-26 18:38:35 +10: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
422cec08d1
Rebuild patch 2021-09-01 19:02:09 +10:00
DerFrZocker
15f27fc710
SPIGOT-6547: Chunk#getEntities() doesn't return all entities immediately after chunk load 2021-09-01 19:01:52 +10:00
Doc
5be41fb80f
SPIGOT-6720: Fix bed explosion checks 2021-08-27 19:18:05 +10:00
DerFrZocker
09b99daf30
SPIGOT-6722: Close entity manager when unloading world 2021-08-27 19:14:09 +10:00
DerFrZocker
3a9561bf24
SPIGOT-6686: Changes in MaximumRepairCost for Anvil Rename cause inconsistency 2021-08-27 19:14:09 +10:00
md_5
15792f0de1
Rebuild patch 2021-08-22 18:07:39 +10:00
md_5
c949675e1f
SPIGOT-6713: Cancelling EntityTransformEvent Causes Deceased Slimes To Not Despawn 2021-08-22 18:07:31 +10:00
Noah van der Aa
3cad0316e0
SPIGOT-6714: Don't fire PlayerBucketEvent when empty 2021-08-18 17:06:40 +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
c30e8f8d51
#913: Handle campfire damage with EntityDamageByBlockEvent 2021-08-11 19:05:08 +10:00
DerFrZocker
97a4f34a8d
SPIGOT-2222, SPIGOT-6687: Pre-set keepLevel and only use it 2021-08-11 18:49:49 +10:00
DerFrZocker
e1c96e507f
SPIGOT-6682: Blocking with shield not reset after die 2021-08-04 17:09:09 +10:00
DerFrZocker
f7f8dce41f
SPIGOT-6552: Some inventory types reset cursor on switch 2021-07-30 19:08:43 +10:00
md_5
8dfa97afe4
SPIGOT-6669: Shearing a Mooshroom does not fire EntityDropItemEvent 2021-07-23 16:36:16 +10:00
DerFrZocker
629cc539f7
SPIGOT-6667: /schedule function not working correctly in other dimensions 2021-07-23 16:31:49 +10:00
md_5
0abf420c4b
SPIGOT-6665: Shearing a Snowman does not drop a carved pumpkin 2021-07-22 17:51:53 +10:00
James Peters
e8e3cbccf5
#893: Add Crafting methods to API 2021-07-22 11:37:22 +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
DerFrZocker
8ffa54ba8c
SPIGOT-6369: Add ItemStack to HangingPlaceEvent 2021-07-21 09:32:54 +10:00
Brokkonaut
c851639c50
SPIGOT-6645: Call EntityChangeBlockEvent before PlayerHarvestBlockEvent 2021-07-19 18:54:13 +10:00
md_5
b8c522d56d
SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent 2021-07-18 11:08:18 +10:00
md_5
f04a77dc2d
SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron 2021-07-18 10:14:55 +10:00
md_5
d1dbcebcd2
SPIGOT-6653: Canceling snow bucket placement removes snow from bucket 2021-07-18 10:06:38 +10:00
Rabbitual
4e1870454c
#874: Add FurnaceStartSmeltEvent 2021-07-17 11:19:51 +10:00
Brokkonaut
ed2b91c283
SPIGOT-6649: Call BlockFadeEvent when Nylium fades to Netherrack 2021-07-15 20:29:38 +10:00
DerFrZocker
ca0fe5b551
SPIGOT-5561: Warning in logs when changing a Mob Spawner to Air on chunk load 2021-07-13 19:22:27 +10:00
md_5
a6292cc3c4
SPIGOT-6637: Revert "#874: Add FurnaceStartSmeltEvent"
This reverts commit 2ea359f1e4774d038626308888bee273f83b14f4.
2021-07-11 12:26:43 +10:00
Doc
9add952b76
SPIGOT-6623: Missing API reasons for entity freezing 2021-07-11 09:32:27 +10:00
Rabbitual
2ea359f1e4
#874: Add FurnaceStartSmeltEvent 2021-07-11 09:27:57 +10:00
DerFrZocker
be8d625e3e
SPIGOT-5560, SPIGOT-6574, SPIGOT-6632: Remove no longer needed tile entity fix 2021-07-11 09:05:59 +10:00