mirror of
https://git.fellies.tech/minecraft/fellies.git
synced 2021-02-13 10:18:48 +00:00
24 lines
755 B
JavaScript
24 lines
755 B
JavaScript
//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);
|
|
});
|