JustS-js / debugStickSurvival

Let survival players ability to create and use debug stick from creative inventory
Creative Commons Zero v1.0 Universal
20 stars 5 forks source link

Config is reinforced in creative mode #13

Closed arvitus closed 1 week ago

arvitus commented 1 month ago

Since the latest update, config restrictions are also applied to creative mode but they should only be applied to survival mode. If you want to go a step further, you could make it a config option or even a permission to set it per player.

Also, I think the "properties" key should not be required when it is empty. {"id":"iron_bars"} should be the same as {"id":"iron_bars","properties":{}}

JustS-js commented 1 month ago

Seems like that bug was introduced with left-click functionality, as i forgot to check if player is in Creative or Survival. About "properties" keys, that's just a byproduct of converting existing config code to Minecraft's CODEC system. I couldn't figure out how to implement optional keys.

arvitus commented 1 month ago

The creative bug doesn't happen on v1.2.0

JustS-js commented 1 month ago

i'll look into that

JustS-js commented 1 month ago

just had to use optionalFieldOf() instead of fieldOf(), who could have thought 🤔 Gonna release this fix later, i want to be sure everything works as intended.

arvitus commented 1 month ago

thx for looking into it so fast :)

JustS-js commented 1 week ago

Tested out, should be working fine in the latest release (1.2.2 for Minecraft 1.21)