-
-
Notifications
You must be signed in to change notification settings - Fork 799
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
275
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.
+10,378
−783
Open
Custom item API v2 #5189
Changes from all commits
Commits
Show all changes
275 commits
Select commit
Hold shift + click to select a range
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 4e23bab
Move v2 JSON mapping reader logic out of MappingsReader_v2 and into s…
eclipseisoffline 0d5305a
Implement legacy definitions
eclipseisoffline 550c1d4
Fix custom item definition sorting and legacy definition reading
eclipseisoffline 32b245e
Allow passing JSON text component as display name
eclipseisoffline 185265a
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
eclipseisoffline d3a3029
First batch of Javadoc reviews
eclipseisoffline ef9ffbc
Address more reviews, and some other things
eclipseisoffline a4ebc3a
More reviews addressed
eclipseisoffline 04e6dd1
Fix: creative item groups/categories (#8)
eclipseisoffline 5ead237
interfacing of predicates (#7)
onebeastchris 69efa63
Simplify some component converters
eclipseisoffline 8a3f9e5
Check non-vanilla item network ID for conflicts in API event call
eclipseisoffline 1c67220
Clarify enchantable component Javadocs
eclipseisoffline 45685ca
Clarify and test consumable animation behaviour
eclipseisoffline 35a37b0
Translation string javadocs
eclipseisoffline 4c03da3
Fix custom trident mappings not having an animation in 3rd-person (#6)
eclipseisoffline 90fa346
Add throwable, projectile, entity placer components to the API
eclipseisoffline 7df5470
Address reviews
eclipseisoffline 7761c87
Merge branch 'master' into custom-item-api-v2
onebeastchris 7ee920e
Little things
eclipseisoffline 704ab1e
Fix the build
eclipseisoffline ce3f260
Merge branch 'master' into custom-item-api-v2
onebeastchris e77b2c3
Merge branch 'master' into custom-item-api-v2
eclipseisoffline 28b9a75
Merge branch 'master' into custom-item-api-v2
eclipseisoffline 65b5d98
Merge branch 'master' into custom-item-api-v2
onebeastchris 716ba95
Merge branch 'master' into custom-item-api-v2
eclipseisoffline f7cd72e
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
onebeastchris 35296aa
Fix: right clicking for custom items
onebeastchris 59b3cb4
Merge branch 'master' into custom-item-api-v2
onebeastchris f06991f
Merge remote-tracking branch 'upstream/master' into fork/eclipseisoff…
onebeastchris efb79fe
Merge branch 'master' into custom-item-api-v2
onebeastchris 5d419ba
Merge branch 'master' into custom-item-api-v2
eclipseisoffline 28b3a84
Account for non-vanilla item definitions in block breaking.
oryxel1 96b19ed
Fix: creative category registration without a creative item group spe…
onebeastchris 1870078
Use IntSet instead of List.
oryxel1 03cc0e9
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
onebeastchris e8b88d3
Merge remote-tracking branch 'upstream/master' into custom-item-api-v2
onebeastchris 9443333
Merge branch 'master' into custom-item-api-v2
onebeastchris a2eda21
Merge branch 'master' into custom-item-api-v2
onebeastchris 1684354
Merge branch 'master' into custom-item-api-v2
onebeastchris 14ed398
Merge branch 'master' into custom-item-api-v2
Kas-tle bc69219
New components API definitions/interfaces, still needs documentation
eclipseisoffline c010c13
Write implementations for new components
eclipseisoffline 5583f67
Implement new components in custom item registry populator
eclipseisoffline 2cdb54d
Implement new component readers
eclipseisoffline 4a4379f
Simplify registering data component readers
eclipseisoffline edf26ea
Write documentation in the API for new components, remove some unnece…
eclipseisoffline 8cb82b4
Merge branch 'master' into custom-item-api-v2
eclipseisoffline 7d2079e
Merge branch 'master' into custom-item-api-v2
onebeastchris 400eae5
Write component converters for 1.21.11 MCPL components and use them i…
eclipseisoffline aa944ec
Custom item registry populator cleanups, only send new context on 1.2…
eclipseisoffline 789abab
Fix trident use animation
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
Some comments aren't visible on the classic Files Changed page.
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
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
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
202 changes: 202 additions & 0 deletions
202
api/src/main/java/org/geysermc/geyser/api/item/custom/v2/CustomItemBedrockOptions.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,202 @@ | ||
| /* | ||
| * Copyright (c) 2024 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.item.custom.v2; | ||
|
|
||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||
| import org.checkerframework.checker.nullness.qual.Nullable; | ||
| import org.checkerframework.common.returnsreceiver.qual.This; | ||
| import org.geysermc.geyser.api.GeyserApi; | ||
| import org.geysermc.geyser.api.util.CreativeCategory; | ||
| import org.geysermc.geyser.api.util.Identifier; | ||
|
|
||
| import java.util.Set; | ||
|
|
||
| /** | ||
| * This is used to store options for a custom item definition that can't be described using item components. | ||
| */ | ||
| public interface CustomItemBedrockOptions { | ||
|
|
||
| /** | ||
| * Gets the item's icon. When not present, the item's Bedrock identifier is used. | ||
| * | ||
| * @return the item's icon | ||
| * @see CustomItemDefinition#icon() | ||
| */ | ||
| @Nullable | ||
| String icon(); | ||
|
|
||
| /** | ||
| * If the item is allowed to be put into the offhand. Defaults to true. | ||
| * | ||
| * @return true if the item is allowed to be used in the offhand, false otherwise | ||
| */ | ||
| boolean allowOffhand(); | ||
onebeastchris marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * If the item should be displayed as handheld, like a tool. Defaults to false. | ||
| * | ||
| * @return true if the item should be displayed as handheld, false otherwise | ||
eclipseisoffline marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| */ | ||
| boolean displayHandheld(); | ||
|
|
||
| /** | ||
| * Since Bedrock doesn't properly support setting item armour values over attributes, this value | ||
| * determines how many armour points should be shown when this item is worn. This is purely visual. | ||
| * | ||
| * <p>Only has an effect when the item is equippable, and defaults to 0.</p> | ||
| * | ||
| * @return the item's protection value. Purely visual and for Bedrock only. | ||
| */ | ||
| int protectionValue(); | ||
|
|
||
| /** | ||
| * The item's creative category. Defaults to {@code NONE}. | ||
| * | ||
| * @return the item's creative category | ||
| */ | ||
| @NonNull | ||
| CreativeCategory creativeCategory(); | ||
|
|
||
| /** | ||
| * The item's creative group. | ||
| * | ||
| * <p>A list of creative groups available in vanilla can be found <a href="https://wiki.bedrock.dev/documentation/menu-categories#list-of-vanilla-groups">here</a>.</p> | ||
| * | ||
| * @return the item's creative group | ||
| */ | ||
| @Nullable | ||
| String creativeGroup(); | ||
|
|
||
| /** | ||
| * Gets the item's set of bedrock tags that can be used in Molang. | ||
| * Equivalent to "tag:some_tag" | ||
| * | ||
| * @return the item's set of bedrock tags, can be empty | ||
| */ | ||
| @NonNull | ||
| Set<Identifier> tags(); | ||
|
|
||
| /** | ||
| * Creates a new builder for custom item bedrock options. | ||
| * | ||
| * @return a new builder | ||
| */ | ||
| static Builder builder() { | ||
| return GeyserApi.api().provider(Builder.class); | ||
| } | ||
|
|
||
| /** | ||
| * Builder for custom item bedrock options. | ||
| */ | ||
| interface Builder { | ||
|
|
||
| /** | ||
| * Sets the item's icon. | ||
| * | ||
| * @param icon the item's icon | ||
| * @see CustomItemBedrockOptions#icon() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder icon(@Nullable String icon); | ||
eclipseisoffline marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * Sets if the item is allowed to be put into the offhand. | ||
| * | ||
| * @param allowOffhand if the item is allowed to be put into the offhand slot | ||
| * @see CustomItemBedrockOptions#allowOffhand() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder allowOffhand(boolean allowOffhand); | ||
|
|
||
| /** | ||
| * Sets if the item should be displayed as handheld, like a tool. | ||
| * | ||
| * @param displayHandheld if the item should be displayed as handheld | ||
| * @see CustomItemBedrockOptions#displayHandheld() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder displayHandheld(boolean displayHandheld); | ||
|
|
||
| /** | ||
| * Sets the item's protection value. | ||
| * | ||
| * @param protectionValue the item's protection value | ||
| * @see CustomItemBedrockOptions#protectionValue() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder protectionValue(int protectionValue); | ||
|
|
||
| /** | ||
| * Sets the item's creative category. | ||
| * | ||
| * @param creativeCategory the item's creative category | ||
| * @see CustomItemBedrockOptions#creativeCategory() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder creativeCategory(@NonNull CreativeCategory creativeCategory); | ||
|
|
||
| /** | ||
| * Sets the item's creative group. | ||
| * | ||
| * @param creativeGroup the item's creative group | ||
| * @see CustomItemBedrockOptions#creativeGroup() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder creativeGroup(@Nullable String creativeGroup); | ||
|
|
||
| /** | ||
| * Adds a tag to the set of bedrock tags this item has, for use in Molang. | ||
| * | ||
| * @param tag the tag to be added | ||
| * @see CustomItemBedrockOptions#tags() | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder tag(@NonNull Identifier tag); | ||
|
|
||
| /** | ||
| * Sets the item's set of bedrock tags, for use in Molang. Pass {@code null} to clear all tags. | ||
| * | ||
| * @param tags the tags to be set, or {@code null} to clear all tags | ||
| * @return this builder | ||
| */ | ||
| @This | ||
| Builder tags(@Nullable Set<Identifier> tags); | ||
|
|
||
| /** | ||
| * Creates the custom item bedrock options. | ||
| * | ||
| * @return the new instance of bedrock options | ||
| */ | ||
| CustomItemBedrockOptions build(); | ||
| } | ||
| } | ||
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.