forked from wmantly/mc-bot-town
AI works here
This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
const { sleep } = require('../../utils');
|
||||
const { CJbot } = require('../../model/minecraft');
|
||||
|
||||
// Owner players who can run admin commands
|
||||
const owners = ['wmantly', 'useless666', 'tux4242'];
|
||||
// Team players who can use basic storage features
|
||||
const team = [...owners, 'pi_chef', 'Ethan', 'Vince_NL'];
|
||||
const _team = [...owners, 'pi_chef', 'Ethan', 'Vince_NL'];
|
||||
|
||||
// Dynamic team list that includes all bot usernames
|
||||
Object.defineProperty(Array.prototype, '_includesWithBots', { value: undefined, writable: true });
|
||||
const team = new Proxy(_team, {
|
||||
get(target, prop) {
|
||||
if (prop === 'includes') {
|
||||
return (name) => {
|
||||
if (target.includes(name)) return true;
|
||||
for (const bot of Object.values(CJbot.bots)) {
|
||||
if (bot.bot && bot.bot.entity && bot.bot.entity.username === name) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
return target[prop];
|
||||
}
|
||||
});
|
||||
|
||||
const botSlots = [0, 1, 2, 3, 9, 10, 11, 12, 18, 19, 20, 21];
|
||||
const customerSlots = [5, 6, 7, 8, 14, 15, 16, 17, 23, 24, 25, 26];
|
||||
|
||||
Reference in New Issue
Block a user