-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Move various settings from non vanilla custom item data to custom item data and allow use in JSON mappings #4655
Open
eclipseisoffline
wants to merge
11
commits into
GeyserMC:master
Choose a base branch
from
eclipseisoffline:customitemapi
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
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.
Conversation
This file contains 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
…om items - updating implementation soon
…or type in vanilla custom registry
onebeastchris
requested changes
May 11, 2024
api/src/main/java/org/geysermc/geyser/api/item/custom/CustomItemData.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/geysermc/geyser/api/item/custom/CustomItemData.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/geysermc/geyser/api/item/custom/NonVanillaCustomItemData.java
Outdated
Show resolved
Hide resolved
Code looks fine to me, but will delegate to someone else for API approval. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR moves various settings from the
NonVanillaCustomItemData
to theCustomItemData
class, which is useful for datapack/server side mod developers when porting custom items to Bedrock using Geyser's mapping system.Properties that have been moved to the super-interface:
stackSize
maxDamage
attackDamage
toolType
toolTier
armorType
protectionValue
isHat
isFoil
isEdible
canAlwaysEat
- deprecated, won't be movedisTool
The builders for these classes have been correctly updated, alongside the implementations of these classes and their use in
CustomItemRegistryPopulator
.A few notes:
NonVanillaCustomItemData.Builder
class has been given overrides for the moved properties to allow for full backwards compatibility.isTool
boolean field in the implementation ofNonVanillaCustomItemData
(GeyserNonVanillaCustomItemData
) has been removed and not re-implemented in its super class - it has been replaced withdisplayHandheld
and wasn't used anywhere in the implementation anymore. It was not publicly available.TheisTool
method has been moved to the super-interface and redirects to thedisplayHandheld
method (it is marked deprecated, like before).GeyserCustomItemData
has been simplified to simply take its builder as argument.createComponentNbt
method forCustomItemData
has been updated to continue supportingGeyserMappingItem
as well.MappingsReader_v1
has been updated accordingly.edible
property has been updated to include theminecraft:use_modifiers
Bedrock component alongside theminecraft:food
component, which seems to now be required to make edible items behave correctly.A couple of the new JSON mapping properties have been tested (
stack_size
,max_damage
,hat
andedible
), and backwards compatibility of using builder methods inNonVanillaCustomItemData.Builder
in extensions has been tested as well, which all seem to work okay.Feel free to suggest any changes and I'll be sure to implement them!