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

[Feature] Config #44

Open
Ecdcaeb opened this issue Apr 22, 2024 · 1 comment
Open

[Feature] Config #44

Ecdcaeb opened this issue Apr 22, 2024 · 1 comment
Labels
help wanted Extra attention is needed low priority

Comments

@Ecdcaeb
Copy link

Ecdcaeb commented Apr 22, 2024

Summary

Enable mod packer make and use config for their scripts.

Details

For example

config.zs
val cfg as CFG = ConfigManager.define("example"); //example.cfg

cfg.startSub("subFirst");
cfg.startSub("subTwo");
cfg.int(10, 0, 100); //default, min, max;
cfg.requireMCRestart();
cfg.define("energy");
cfg.endSub();
cfg.endSub();

cfg.register();
example.zs
VanillaFactory.createEnergyItem("example_energe_item", ConfigManager.getInt("example:subFirst.subTwo.energy"), ConfigManager.getInt("example:subFirst.subTwo.energy"), ConfigManager.getInt("example:subFirst.subTwo.energy"));

Why we do not edit the script directly.

It is player-friendly. Yes, friendly.

@friendlyhj
Copy link
Owner

I mark it low priority, but feel free to make a PR.

@friendlyhj friendlyhj added help wanted Extra attention is needed low priority labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed low priority
Projects
None yet
Development

No branches or pull requests

2 participants