Merge branch 'main' into join-auto-detect

This commit is contained in:
Nimi 2024-11-16 14:28:54 -06:00 committed by GitHub
commit e68069542b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.vscode/ .vscode/
.idea/
node_modules/ node_modules/
package-lock.json package-lock.json
code_records/ code_records/

View file

@ -91,6 +91,12 @@ export class Agent {
this.bot.on('login', () => { this.bot.on('login', () => {
console.log('Logged in!'); console.log('Logged in!');
// Set skin for profile, requires Fabric Tailor. (https://modrinth.com/mod/fabrictailor)
if (this.prompter.profile.skin)
this.bot.chat(`/skin set URL ${this.prompter.profile.skin.model} ${this.prompter.profile.skin.path}`);
else
this.bot.chat(`/skin clear`);
}); });
this.bot.once('spawn', async () => { this.bot.once('spawn', async () => {
@ -100,7 +106,7 @@ export class Agent {
// wait for a bit so stats are not undefined // wait for a bit so stats are not undefined
await new Promise((resolve) => setTimeout(resolve, 1000)); await new Promise((resolve) => setTimeout(resolve, 1000));
console.log(`${this.name} spawned.`); console.log(`${this.name} spawned.`);
this.clearBotLogs(); this.clearBotLogs();

View file

@ -41,6 +41,10 @@ class MinecraftData {
bot.loadPlugin(collectblock); bot.loadPlugin(collectblock);
bot.loadPlugin(autoEat); bot.loadPlugin(autoEat);
bot.loadPlugin(armorManager); // auto equip armor bot.loadPlugin(armorManager); // auto equip armor
bot.once('resourcePack', () => {
bot.acceptResourcePack();
});
return bot; return bot;
} }