442 Commits

Author SHA1 Message Date
HimmelKreis4865
d94391af57
Implement Chiseled Bookshelf (#5827) 2023-09-28 15:56:46 +01:00
Dylan K. Taylor
56d7039086
Implemented budding amethyst and amethyst clusters 2023-09-27 17:02:37 +01:00
Dylan K. Taylor
4f13e446a1
StringToItemParser: clean up hardcoded potion aliases
these were needed in PM4, but the type is dynamic in PM5.
2023-09-27 13:18:02 +01:00
Dylan K. Taylor
6ec340359b
Implemented crimson and warped roots 2023-09-27 13:07:46 +01:00
Dylan K. Taylor
14f2368454
ToolTier: remove legacy EnumTrait annotations and doc comment info 2023-09-08 10:02:50 +01:00
Dylan K. Taylor
89f42c80d4
Strip out deprecated stuff 2023-09-07 20:26:04 +01:00
Dylan T
7dcd2592d4
RuntimeDataDescriber: Support dynamically describing arbitrary enums (#6039)
Previously, we were using codegen to support describing a fixed set of enums.

Instead, we implement an enum() function, allowing any native PHP enum to be described.
All enums used in runtime data have been migrated to native PHP 8.1 enums in minor-next to facilitate this.

This implementation:

- is faster (in extreme cases by 40x, such as with PotionType)
- requires way less code
- does not require a build step
- is way more flexible

This fixes #5877, increasing the range of stuff that plugins are now able to do.

EnumTrait enums are not supported, as it's easier and cleaner to just support native enums. Most core EnumTrait enums have been migrated to native enums by now to facilitate this.
2023-09-07 20:07:14 +01:00
Dylan K. Taylor
b50efbc15a
Fix CS 2023-09-07 19:38:29 +01:00
Dylan K. Taylor
94d98fb5c4
Migrate all but two remaining legacy enums to native PHP 8.1 enums 2023-09-07 19:32:45 +01:00
Dylan K. Taylor
ae564e445d
Start migrating EnumTrait enums to PHP 8.1 native enums 2023-09-07 17:20:52 +01:00
Dylan K. Taylor
923f7561fb
Enchantment: added @see tags to @deprecated methods 2023-08-23 16:53:09 +01:00
Dylan K. Taylor
f4e1c31dcf
Change some weird constant names 2023-08-23 16:52:47 +01:00
Dylan K. Taylor
1504fdca24
Use 'enchanting' terminology
'enchant' just didn't feel right, being a verb.
All these things pertain to the act of enchanting.

This is now also consistent with CraftingTransaction etc. The ship already sailed on EnchantInventory, which will have to be renamed at a later datte. However, that was already inconsistent with 'enchanting table', so that's the odd one out here.
2023-08-23 16:14:17 +01:00
Dylan K. Taylor
bf668c0f6c
Rename EnchantHelper related stuff
Perhaps this and EnchantOption should be called EnchantingHelper and EnchantingOption respectively. The terminology used is rather inconsistent, but 'enchantment' definitely isn't the right word here.
2023-08-23 16:07:02 +01:00
Dylan K. Taylor
d942748203
Move enchanting seed generation to EnchantmentHelper 2023-08-23 15:52:49 +01:00
Dylan K. Taylor
29fdc8b08d
Private constructor for EnchantmentHelper 2023-08-23 15:49:31 +01:00
Dylan K. Taylor
5afbb9d807
Allow enchanted books to be enchanted
if an enchanted book is obtained via /give without enchantments, it should be able to receive enchantments in an enchanting table, exactly the same as regular books.
2023-08-15 19:10:03 +01:00
Dylan K. Taylor
b330cbe8e2
Merge remote-tracking branch 'origin/stable' into minor-next 2023-08-15 17:41:41 +01:00
S3v3Nice
39867b97c5
Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
Hugo_
f03e708f64
Fix chorus not working if the destination would be below y=0 (#5979) 2023-08-10 09:42:58 +01:00
ipad54
77dfbc4e23
Implemented pink petals (#5940) 2023-08-09 11:33:33 +01:00
ipad54
83d11c7429
Implemented Big & Small dripleaf (#5835) 2023-07-17 16:30:52 +01:00
ShockedPlot7560
fb6a7d279f
Implement fortune enchantment (#5757) 2023-07-17 11:13:45 +01:00
ace
7132ac0ad3
Implemented strong slowness potion (#5888) 2023-07-13 13:22:01 +01:00
Dylan K. Taylor
ad3f854701
Register aliases for new cherry wood blocks 2023-06-20 12:59:16 +01:00
Dylan K. Taylor
774f92435a
StringToItemParser: added underwater_tnt alias 2023-06-20 12:34:16 +01:00
ace
bccda4fe44
Implement Piglin Head (#5839) 2023-06-19 12:07:49 +01:00
Dylan K. Taylor
0f8e61eda4
Implemented new cherry-wood blocks 2023-06-09 18:04:52 +01:00
IvanCraft623
6d7f44d8fe
Implement glow lichen (#5401) 2023-06-04 16:04:08 +01:00
Dylan K. Taylor
473c062b40
Improve documentation for BlockTypeIds and ItemTypeIds 2023-05-27 17:28:36 +01:00
Dylan K. Taylor
bdb0ed0701
Consistently use 'mob head' terminology in the API
previously, we were sometimes using 'mob head' and other times 'skull', sometimes even within the same file.
2023-05-26 15:08:00 +01:00
Dylan K. Taylor
59ca7b75e1
Fixed PHPStan error 2023-05-17 15:32:38 +01:00
Dylan K. Taylor
c9bb4335a1
Item: added getStateId(), removed state data from public API
state data was only used for indexing stuff along with state ID anyway, so it makes more sense to lock it away in here instead.
2023-05-16 14:14:18 +01:00
Dylan K. Taylor
015c668885
Change confusing 'type data' and 'state data' terminology for blocks and items
For blocks, we now use 'block-item state' and 'block-only state', which should be much clearer for people implementing custom stuff.
'block-item state', as the name suggests, sticks to the item when the block is acquired as an item.
'block-only state' applies only to the block and is discarded when the block is acquired as an item.

'type data' for items was also renamed, since 'type' is too ambiguous to be anything but super confusing.
2023-05-16 14:07:29 +01:00
ipad54
fa719f37d5
Implement Cave Vines & Glow Berries (#5424) 2023-05-08 19:24:23 +01:00
Dylan K. Taylor
299ff5d912
Register mangrove boat item 2023-05-04 16:39:23 +01:00
Dylan K. Taylor
896dd2ec9d
Boat: use BoatType enum instead of TreeType
TreeType really belongs in the generator package. Not all types of tree may have their own boat type (e.g. azalea).
We can't use WoodType for this either, because some types of wood also don't have associated boat types (crimson, warped).
2023-05-04 16:35:31 +01:00
Dylan K. Taylor
c878bd8289
Merge remote-tracking branch 'origin/minor-next' into major-next 2023-04-20 00:18:19 +01:00
Dylan K. Taylor
674b65f789
Item: optimise serializeCompoundTag() a little 2023-04-18 16:18:34 +01:00
Dylan K. Taylor
027d8f7377
always the CS... 2023-04-13 12:55:18 +01:00
Dylan K. Taylor
874fdf5adb
ItemBlock: reference blocks directly (take 2)
This was first attempted in f64dc01bd1c14ff3f79bd6c18d0c337dbc0e87e0, but reverted, since I hadn't considered how to handle stripping state data from blocks.

This removes the abusable API RuntimeBlockStateRegistry::fromTypeId() and related methods. These were only used to allow ItemBlocks to magically start referencing other blocks if the blocks were overridden by a plugin, but this was never a well-supported use-case anyway.

Instead of relying on RuntimeBlockStateRegistry, we remember the state that the block had during its constructor, and use that to normalize the non-item properties for asItem().

closes #5609
2023-04-13 12:44:54 +01:00
Dylan K. Taylor
dbcd2b1e65
ItemTypeIds::toBlockTypeId() now returns null for non-blockitem IDs
closes #5648
2023-04-05 21:04:00 +01:00
Dylan K. Taylor
341a9b78b5
LegacyStringToItemParser: update documentation 2023-03-24 13:48:33 +00:00
Dylan K. Taylor
fff8f0f815
Use Item->canStackWith() instead of Item->equals() wherever possible 2023-03-07 17:08:35 +00:00
Dylan K. Taylor
7c974a12e1
Revert "ItemBlock: drop the charade about overriding built-in block types"
This reverts commit f64dc01bd1c14ff3f79bd6c18d0c337dbc0e87e0.

I forgot that the ItemBlock constructor implicitly strips off any states
of the origin block, which is something that we unfortunately can't do
any other way right now, since the blocks don't remember their default
states.
2023-03-02 15:51:55 +00:00
Dylan K. Taylor
f64dc01bd1
ItemBlock: drop the charade about overriding built-in block types
this allows cleaning up a whole lot of abusable mess from the API, and we never properly supported overriding built-in block types anyway.
2023-03-02 15:50:18 +00:00
Dylan K. Taylor
33140482bb
ItemTypeIds: added fromBlockTypeId() and toBlockTypeId()
this allows checking the type of a blockitem without being required to create a block to do it.
2023-03-02 15:28:50 +00:00
Dylan K. Taylor
77fe0a69ba
ItemIdentifier: remove dead TODO comment 2023-03-02 15:10:46 +00:00
Dylan K. Taylor
c2f6d8139a
Added interface RuntimeDataDescriber 2023-02-16 16:23:32 +00:00
ipad54
75f74454c6
Implemented reinforced deepslate (#5553) 2023-02-15 15:15:04 +00:00