1
0
mirror of https://git.fellies.tech/minecraft/fellies.git synced 2021-02-13 10:18:48 +00:00
Fellies/kubejs[e6]/server_scripts/enigmatica/kubejs/packmode.js

24 lines
755 B
JavaScript
Raw Normal View History

2021-01-28 22:28:10 +00:00
//priority: 1000
events.listen('recipes', (event) => {
const defaultConfig = {
mode: 'normal',
message: 'Valid modes are normal and expert.'
};
const configName = 'mode.json';
let config = json.read(configName);
if (!config || !config.mode) {
json.write(configName, defaultConfig);
console.log('Created new ' + configName);
}
if (config.mode == 'none') {
json.write(configName, defaultConfig);
config.mode = defaultConfig.mode;
console.log(
`Overwrote ${configName}, because the mode 'none' was found. Valid modes are 'normal' and 'expert'.`
);
}
global.packmode = config.mode;
console.log('Current packmode is: ' + global.packmode);
});