Skip to content
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

Unable to set a setting with type BlockEntityType #4468

Closed
Redhawk18 opened this issue Aug 10, 2024 · 3 comments
Closed

Unable to set a setting with type BlockEntityType #4468

Redhawk18 opened this issue Aug 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Redhawk18
Copy link

Some information

Operating system:
Java version:
Minecraft version:
Baritone version: master 1.19
Other mods (if used):

Exception, error or logs

I added this setting

    /**
     * The block entity to scan the world for to collect items from.
     */
    public Setting<BlockEntityType> storageBox = new Setting<>(BlockEntityType.CHEST);

When I try to set it in game with for example
#settings storageBox BlockEntityType.SHULKER_BOX I got an uncaught exception.

@Redhawk18 Redhawk18 added the bug Something isn't working label Aug 10, 2024
@ZacSharp
Copy link
Collaborator

If you want to use new types for setting values and be able to set them via commands / settings file you also have to implement a parser + serializer pair for that type in SettingsUtil.
(Note: This is my last inbox check before disappearing for two weeks)

@Redhawk18
Copy link
Author

If you want to use new types for setting values and be able to set them via commands / settings file you also have to implement a parser + serializer pair for that type in SettingsUtil. (Note: This is my last inbox check before disappearing for two weeks)

Is there a style guide for what is expect? Because minecraft has all of these types as constants but we could for example change SHULKER_BOX to minecraft:shulker_box

@ZacSharp
Copy link
Collaborator

No, there is no style guide. For #4452 I went for the enum names mainly for ease of parsing, but generally I think using the textual id is preferable from a usage point of view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants