-
-
Notifications
You must be signed in to change notification settings - Fork 739
Custom item API v2 #5189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eclipseisoffline
wants to merge
223
commits into
GeyserMC:master
Choose a base branch
from
eclipseisoffline:custom-item-api-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,971
−924
Open
Custom item API v2 #5189
Changes from 202 commits
Commits
Show all changes
223 commits
Select commit
Hold shift + click to select a range
61f5db1
First work on a new API (wow that's a lot of TODOs)
eclipseisoffline ea6c3c6
Add component readers for all the planned components
eclipseisoffline 0922b18
Fix equippable slot reading and add support for all consume animations
eclipseisoffline 435b73d
Add use cooldown support
eclipseisoffline cce49fa
Fix max stack size and max damage components
eclipseisoffline 1dd854a
Implement block item and entity placer properties
eclipseisoffline 4af8e12
Add documentation and change some stuff in the API
eclipseisoffline efae1f3
Implement the changes in Geyser
eclipseisoffline 8bbad9d
Implement the changes in Geyser part 2
eclipseisoffline 7eeb5bb
Remove old custom item options
eclipseisoffline 4514f55
Work on support for the old format
eclipseisoffline 8ea3c97
Start work on predicates, somewhat
eclipseisoffline 7888956
More work on predicates, I'll probably simplify it later
eclipseisoffline ce55d88
Clean up predicates a bit
eclipseisoffline 52f2b9f
Add model grouping
eclipseisoffline 49f31c9
Work on range dispatch predicate
eclipseisoffline 9139af2
Implement range dispatch predicates when converting old mappings to n…
eclipseisoffline 4d09104
Implement reading range dispatch predicates from mappings
eclipseisoffline 0346a80
Implement sorting for range dispatch predicates, needs testing
eclipseisoffline c38bf26
Add model check to custom item comparator
eclipseisoffline 79bf4af
Clean up predicates a bit
eclipseisoffline f6f6423
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline fd09a05
Update custom item translator for 1.21.4, implement custom model data
eclipseisoffline 7fabf0c
Implement/update register items event for new custom item definitions
eclipseisoffline 04d7f48
More stuff in the custom item registry populator
eclipseisoffline 04fe043
Add priority option to definitions, deprecate texture size and render…
eclipseisoffline 5ecc61f
Implement priority option
eclipseisoffline 12499bf
Read priority option from mappings
eclipseisoffline bca98c7
Add unbreakable condition predicate
eclipseisoffline 6e0e3c0
Use unbreakable predicate when converting v1 to v2 mappings
eclipseisoffline 774e556
Remove BedrockCreativeTab in favour of CreativeCategory
eclipseisoffline 1685918
Remove adventure from API module
eclipseisoffline 7164ca0
Some fixes
eclipseisoffline 2263cc8
Remove this
eclipseisoffline 3fac2cd
Reimplement unbreakable predicate check
eclipseisoffline 361df16
Fix build
eclipseisoffline b80c054
Fix charge type predicate
eclipseisoffline eb0b40c
I'm very confused at why this doesn't work
eclipseisoffline a4c17da
Fix adding multiple definitions for same item model and sorting of pr…
eclipseisoffline a80e90d
Fix adding multiple definitions for same item model again
eclipseisoffline e7d7a9d
Improve mapping custom items
eclipseisoffline 12f2e1a
Improve the reading and error handling of item mappings
eclipseisoffline fe8336a
Some of Adventure was left in the API
eclipseisoffline f44f368
Improve predicate reading error handling
eclipseisoffline a997820
Make item definitions in group able to override the group's model
eclipseisoffline 7ed830a
Improve error handling when registering custom items
eclipseisoffline b5cef99
Clean up custom item registry populator a bit
eclipseisoffline 66e288f
Improve documentation of (predicate) new API
eclipseisoffline 852c5c2
Apparently Javadoc can break builds
eclipseisoffline 18cde32
Improve documentation just a bit
eclipseisoffline 885c4d9
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 25109b7
Add predicate caching
eclipseisoffline 635c8c4
Default to definition type when no type key is given
eclipseisoffline e84f8a3
Whoops got to include the lib
eclipseisoffline bcc7915
Factor in range dispatch scaling when sorting predicate
eclipseisoffline 4aea17a
Component combination validation
eclipseisoffline 1683243
Fix max stack size validation when reading json mappings
eclipseisoffline 4629f7b
"Implement" v2 block mappings reading
eclipseisoffline 2b9f519
Cleanup item registry populator a bit
eclipseisoffline ff35c6e
Fix mapping reading
eclipseisoffline b254594
Move identifierToKey out of ItemRegistryPopulator
eclipseisoffline 56c508d
Throw UnsupportedOperationException when reading block v2 mappings
eclipseisoffline 5620f0a
Move predicate implementations out of API module
eclipseisoffline 0986203
Send nutrition and saturation to the client
eclipseisoffline e8bd2a1
Refactor mappings reading with proper type checking and conversions a…
eclipseisoffline aa365d9
Small cleanup
eclipseisoffline aa13113
Clean up predicates in the API
eclipseisoffline 094ff41
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 7af9518
Implement predicate strategies
eclipseisoffline f4c9c3d
Read predicate strategies from mappings
eclipseisoffline 46e6fd3
Remove MCPL from API module, but now stuff is broken. Also still need…
eclipseisoffline 03402d4
Update implementations and mappings reader, but populator is broken
eclipseisoffline aabd537
My IDE did something it shouldn't have
eclipseisoffline d06ad0b
Improve enum reader error message
eclipseisoffline 1dce683
Move predicate classes up
eclipseisoffline 7e973ea
Fix component patching, MCPL removal is done now
eclipseisoffline 9f21221
Component validation in the API
eclipseisoffline ffb94ff
Proper support for the enchantable value property
eclipseisoffline 44a1bba
Reformat some stuff my IDE shouldn't have done
eclipseisoffline 33b49eb
Properly implement protection value
eclipseisoffline 0e5dba1
Documentation improvements, add converter for enchantable component
eclipseisoffline 0308388
Remove unused stuff
eclipseisoffline d522f61
Remove rarely used method
eclipseisoffline 61b703c
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline ebbd1c5
Small documentation stuff
eclipseisoffline 1afb733
Work on tool component stuff
eclipseisoffline 75e371c
Add tool component to API
eclipseisoffline 67b615e
Implement tool component in custom item populator
eclipseisoffline 261b6ca
Add tool component mappings reader
eclipseisoffline c63386a
Update documentation
eclipseisoffline 2558620
Add repairable mappings reader
eclipseisoffline 373eeac
Implement repairable component in custom item registry populator
eclipseisoffline fbbf210
Documentation whoopsy
eclipseisoffline ab174b5
Javadoc broke my build again (this isn't proper HTML)
eclipseisoffline 422c5a9
Update MCPL
eclipseisoffline a5d6fb1
Consistency renames, start on has component predicate
eclipseisoffline af76cd0
Update API module with has component predicate
eclipseisoffline 505a74b
Update implementations and implement has component predicate
eclipseisoffline dee7b5a
Update reading of match predicate property
eclipseisoffline 6705513
Fix broken/damaged predicates
eclipseisoffline bd7e471
Remove enchantable stuff from chargeable properties as that is decide…
eclipseisoffline ea850f4
Clean up custom item registry populator
eclipseisoffline 020e78e
Make new item definition register method throw exception
eclipseisoffline 27b2ec7
Charge type javadocs
eclipseisoffline fc0103b
Make air model constant
eclipseisoffline 2662c81
Rename creative category internal name to bedrock name
eclipseisoffline 6f67814
Make sure deprecated getExistingCustomItems method still functions
eclipseisoffline c1bd5fa
Data component map javadoc
eclipseisoffline 99b01ee
Apply suggestions from code review
eclipseisoffline b2776a3
Forgot one
eclipseisoffline 5ac8a24
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline ec9e9fc
I messed up the merge conflicts, whoops
eclipseisoffline d22e815
Work on component javadoc
eclipseisoffline 4b7ef99
Some fixes
eclipseisoffline a0b785c
Whoops
eclipseisoffline 92d3296
Work on changing mappings reader to Gson
eclipseisoffline af371b1
Update data component readers to use Gson
eclipseisoffline 2c9596d
Mappings reader gson part 1
eclipseisoffline 4095f89
Mappings reader gson part 2
eclipseisoffline a7fbcc6
Mappings reader gson part 3
eclipseisoffline 0ae556c
Whoops almost removed v2 mappings
eclipseisoffline 3fff601
Some fixes and stuff
eclipseisoffline de95eb5
Bye bye render offsets
eclipseisoffline 215c309
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 97a2e99
More small fixes
eclipseisoffline dac6d53
Rename getExistingCustomItemDefinitions to customItemDefinitions in d…
eclipseisoffline 3c388a7
Use API Identifiers to represent vanilla items instead of strings
eclipseisoffline 2558ca6
Add javadocs to CustomItemDefinitionRegisterException
eclipseisoffline 292efc6
Switch tags to identifiers
eclipseisoffline b3d7747
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline ac5c391
Switch Identifier constructors to short .of call
eclipseisoffline 1b4fc15
Change Identifier in API to interface
eclipseisoffline 085bb6e
Add tag(Identifier) method to bedrock options builder
eclipseisoffline 22d7ef9
Add new creative categories
eclipseisoffline e709e64
Work on making predicates in API abstract
eclipseisoffline 07cd54d
Implement predicate changes in geyser, range predicates still broken
eclipseisoffline 5131a3d
Write javadocs for new predicate stuff in the API
eclipseisoffline 6a8e70c
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 4b3e671
Fix the build™
eclipseisoffline a882d7f
Merge branch 'custom-item-api-v2' into api-predicates
eclipseisoffline 573ace1
Fix the build™ v2.0: now for the fancy predicate API
eclipseisoffline 5bcd9d9
Lazy initialise the stuff in predicate context
eclipseisoffline a433b91
Move item predicate context
eclipseisoffline 4adbccb
Work on fishing_rod/cast predicate
eclipseisoffline d5bbccf
Work on range-dispatch predicates in the new predicate API
eclipseisoffline f2b1b7b
Improve some javadocs
eclipseisoffline 81fefb9
Write more javadocs
eclipseisoffline 7cde240
Re-implement reading range dispatch predicates from JSON mappings
eclipseisoffline bb2f758
Cleanup ItemMatchProperty a bit
eclipseisoffline 6bb5575
Write some TODOs
eclipseisoffline 4c9676e
Some fixes and docs
eclipseisoffline a4a1222
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 17fa9e3
Start working on non-vanilla custom items v2
eclipseisoffline 63a9f8e
Implement the stuff in Geyser
eclipseisoffline 2a3ca59
Update the define custom items event
eclipseisoffline 33ba15d
More progress with non-vanilla custom items
eclipseisoffline f3db517
Implement NonVanillaCustomItemData -> definition conversion
eclipseisoffline c91db0c
Fix v1 mappings using the vanilla item identifier as bedrock identifier
eclipseisoffline 109474c
Add chargeable geyser data component
eclipseisoffline c183b8e
Implement chargeable data component in geyser
eclipseisoffline ffc0481
Convert old chargeable property to new component, don't allow chargea…
eclipseisoffline e0c228f
Remove chargeable method from NonVanillaCustomItemDefinition, work on…
eclipseisoffline 0efee85
Implement attack damage component
eclipseisoffline 366d8b6
Add and implement block placer component
eclipseisoffline a9021d1
Update documentation
eclipseisoffline 1dfb6c5
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 6bf2d0f
Write some more documentation
eclipseisoffline bfbca7b
Some TODOs and stuff
eclipseisoffline 5a64c65
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 826e2f3
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 306c3ea
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 6218884
Reintroduce player place null check in BlockPlaceMixin
eclipseisoffline c510204
Merge branch 'block-item-mixin-fix' into custom-item-api-v2
eclipseisoffline dd9cc61
Make it build
eclipseisoffline 1b0d3f6
Support new equipment slots
eclipseisoffline 8641196
Introduce component converter for tool component and use in custom it…
eclipseisoffline ab9d645
Merge branch 'custom-item-api-v2' into api-predicates
eclipseisoffline 9fcc8eb
Random stuff to make it build
eclipseisoffline cfdde40
Some cleanups
eclipseisoffline d84856e
Predicate conflict detection is back, sort of, by using a bunch of re…
eclipseisoffline 1eb4caa
Add back fishing rod cast predicate
eclipseisoffline 9df0a35
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline dcff4ec
Implement removing of default vanilla item components
eclipseisoffline baed6cf
Fix the build
eclipseisoffline 4e55579
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline d004a13
Allow 0 values for max draw duration in chargeable component
eclipseisoffline aa3e0bd
Fix applying component removals to custom items
eclipseisoffline 2a2738b
Allow overriding vanilla models if the model is not used by the vanil…
eclipseisoffline d5a1f22
Some small changes
eclipseisoffline 7887ba9
Some more small changes
eclipseisoffline 9dafa6c
Merge branch 'custom-item-api-v2' into api-predicates
eclipseisoffline 78a2aa4
Range dispatch predicate sorting and comments/documentation
eclipseisoffline 90c883d
More javadocs
eclipseisoffline da6f859
Merge pull request #2 from eclipseisoffline/api-predicates
eclipseisoffline 17bfcf9
Some more comments
eclipseisoffline 45a6a7e
Add back enchantment glint override component
eclipseisoffline 1ce84cd
Add enchantment_glint_override component reader
eclipseisoffline 1e3ce1e
Give custom items a breaking speed of 1
eclipseisoffline 4eab395
Add useBlockIcon property
eclipseisoffline b035ae2
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 9b6be61
Some clarifying comments
eclipseisoffline 6ddad6d
Allow null values for cooldown group in use cooldown component
eclipseisoffline c28ee88
I worked on this in 2025 too
eclipseisoffline 33f4247
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 2f41ae9
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 9638f82
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 5a85f52
Let it build
eclipseisoffline 6d25f4f
Use the right mappings
eclipseisoffline f9a4467
Component Javadocs and interfaces (#3)
onebeastchris 1d234d9
Start on extended tool properties component, API is done
eclipseisoffline c587673
Work on resolvable components/session based components
eclipseisoffline 49a303f
Create CustomItemContext record
eclipseisoffline bdc9279
Fix build, actually create resolvable tool properties component
eclipseisoffline a2ab1bb
Make it run
eclipseisoffline 7fec9df
Register Holders builder API
eclipseisoffline f764bed
Only store ComponentCache for item stacks, debug statements
eclipseisoffline e0fd201
Fix build
eclipseisoffline d2db5af
Null-safety for component cache
eclipseisoffline 94ddb38
Fix looking up block IDs by key
eclipseisoffline 502396b
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline 69d93ff
Javadocs and minor API changes
eclipseisoffline eeaf827
Proper Repairable component
eclipseisoffline b622ad1
Fix repairable reader
eclipseisoffline File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...rc/main/java/org/geysermc/geyser/api/exception/CustomItemDefinitionRegisterException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2025 GeyserMC. http://geysermc.org | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
* @author GeyserMC | ||
* @link https://github.com/GeyserMC/Geyser | ||
*/ | ||
|
||
package org.geysermc.geyser.api.exception; | ||
|
||
/** | ||
* Thrown when there was an error registering the custom item definition. The exception message will have details as to what went wrong. | ||
*/ | ||
public class CustomItemDefinitionRegisterException extends Exception { | ||
eclipseisoffline marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
public CustomItemDefinitionRegisterException(String message) { | ||
super(message); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.