36 Commits

Author SHA1 Message Date
Dylan K. Taylor
2c81446e5b
Move TreeType to generator package, added dedicated SaplingType enum
TreeType includes a bunch of stuff that don't have regular saplings associated with them, such as mangrove and azalea trees.
Mangrove has a dedicated propagule block with different behaviour than the others, and azalea trees are grown from azalea blocks, which are solid and have different behaviour to saplings.

We may also want to account for crimson and warped 'trees' in TreeType too, although I'm not sure if those belong there or not.
2023-05-04 16:54:10 +01:00
Dylan K. Taylor
f56339c306
Fix build 2023-01-26 14:48:43 +00:00
Dylan K. Taylor
0a3ecfdae9
Clean up terminology around block state IDs and their handling 2023-01-25 19:01:15 +00:00
Dylan K. Taylor
7abfc46567
First look at 3D biome support 2023-01-17 21:41:30 +00:00
Dylan K. Taylor
d9b050fb68
First look at using (very) basic tags for dynamic block properties
this allows plugins to, for example, add their own custom dirt-like blocks which support having flowers placed on them.
2022-07-24 00:08:02 +01:00
Dylan K. Taylor
0a23e91329
Rename BlockFactory::fromFullBlock() -> BlockFactory::fromStateId() 2022-07-05 13:46:19 +01:00
Dylan K. Taylor
f24f2d9ca9
Hit block legacy metadata with the biggest nuke you've ever seen
This commit completely revamps the way that blocks are represented in memory at runtime.

Instead of being represented by legacy Mojang block IDs and metadata, which are dated, limited and unchangeable, we now use custom PM block IDs, which are generated from VanillaBlocks.
This means we have full control of how they are assigned, which opens the doors to finally addressing inconsistencies like glazed terracotta, stripped logs handling, etc.

To represent state, BlockDataReader and BlockDataWriter have been introduced, and are used by blocks with state information to pack said information into a binary form that can be stored on a chunk at runtime.
Conceptually it's pretty similar to legacy metadata, but the actual format shares no resemblance whatsoever to legacy metadata, and is fully controlled by PM.
This means that the 'state data' may change in serialization format at any time, so it should **NOT** be stored on disk or in a config.

In the future, this will be improved using more auto-generated code and attributes, instead of hand-baked decodeState() and encodeState(). For now, this opens the gateway to a significant expansion of features.
It's not ideal, but it's a big step forwards.
2022-06-24 23:19:37 +01:00
Dylan K. Taylor
1ff69136a3
Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
Dylan K. Taylor
d2613039ed
Replace BlockLegacyIds usages with BlockTypeIds where possible 2022-06-05 21:17:10 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
b88a47929f
Modernize property declarations in src/world/* 2022-04-28 15:06:17 +01:00
Dylan K. Taylor
aae5962f6a
Replace disallowed operators in src/world/ 2022-01-20 19:05:23 +00:00
Dylan T
4111d92b98
Stop hardcoding chunk dimensions everywhere (#4443) 2021-09-10 16:13:25 +01:00
Dylan K. Taylor
938e430b0f
Convert Populator into an interface 2021-08-27 20:41:54 +01:00
Dylan K. Taylor
beba0ffe15
Remove circular dependency between Tree and its children 2021-08-27 20:25:21 +01:00
Colin
8f89c04c51
Refactor Tree classes (#4407) 2021-08-27 20:11:05 +01:00
Dylan K. Taylor
5a1131d72d
Populator: require dependencies explicitly, don't make bad assumptions about fields
this also leaks ChunkManagers on the worker threads because the generator context is long-lived.
2021-01-27 21:08:46 +00:00
Dylan K. Taylor
b176f4c12f Switch to BiomeRegistry
I accidentally committed this in c869a7f099237ca189dc574fe3df6e7630eeec51 and didn't notice. I intended to use it and never noticed.
2020-11-01 16:47:13 +00:00
Dylan K. Taylor
13d784cd0c Convert BlockFactory to singleton 2020-04-23 23:45:13 +01:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
cda1143a79 Merge branch 'stable' 2020-01-09 17:17:42 +00:00
Dylan K. Taylor
200bcb485e Merge branch 'stable' 2019-08-14 18:20:55 +01:00
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00
Shoghi Cervantes
5ea31b57ce First step to namespaces 2014-03-05 23:43:16 +01:00
Shoghi Cervantes
23b8fc32ff removed DocBlock header for logo 2014-03-05 11:15:47 +01:00
Shoghi Cervantes
da554fbf23 Fixed Trees 2014-02-14 00:25:44 +01:00
Shoghi Cervantes
715e51b7c5 Automatic population on side loading 2014-02-14 00:19:26 +01:00
Shoghi Cervantes
5d7198396d Added TallGrassPopulator 2014-02-13 22:39:53 +01:00
Shoghi Cervantes
b3c51c6d2e Faster level generator 2013-09-09 03:32:24 +02:00
Shoghi Cervantes
a21bb5ab6d Revert "Revert "Roll back""
This reverts commit e1e804ffe35f9e6c6411b8ed6425af3f8e72f608.
2013-08-29 18:52:12 +02:00
Shoghi Cervantes
e1e804ffe3 Revert "Roll back"
This reverts commit 29504c09f263e73492c6ffecea201a81dcf3591d.
2013-08-28 20:55:58 +02:00
Shoghi Cervantes
093b86fa43 Fixed URL 2013-08-27 19:16:11 +02:00
Shoghi Cervantes
36ff8331b7 Updated headers 2013-08-27 18:16:57 +02:00
Shoghi Cervantes
bda5e62788 Fixed syntax 2013-06-10 17:13:34 +02:00
Shoghi Cervantes
579175b3bc Ore Generation 2013-06-10 17:11:04 +02:00