Skip to content

Commit

Permalink
refactored dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidsquid1 authored Feb 28, 2024
1 parent 8b8e718 commit 12c6072
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
"minecrafthawkeye": "^1.3.6",
"mineflayer": "^4.19.0",
"mineflayer-armor-manager": "^2.0.1",
"mineflayer-auto-auth": "^2.0.0",
"mineflayer-collectblock": "^1.4.1",
"mineflayer-dashboard": "^2.0.1",
"mineflayer-pathfinder": "^2.4.5",
"mineflayer-pvp": "^1.3.2",
"prismarine-viewer": "^1.28.0",
"mineflayer-dashboard": "^2.0.1"
"prismarine-viewer": "^1.28.0"
}
}
15 changes: 11 additions & 4 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
const mineflayer = require('mineflayer');
const minecraftHawkEye = require('minecrafthawkeye');
const mineflayerViewer = require('prismarine-viewer').mineflayer;
const mineflayerPVP = require('mineflayer-pvp').plugin;
const mineflayerArmorManager = require('mineflayer-armor-manager');
const mineflayerCollectBlock = require('mineflayer-collectblock').plugin;
const mineflayerDashboard = require('mineflayer-dashboard');
const { pathfinder, Movements } = require('mineflayer-pathfinder');
const { GoalNear, GoalFollow } = require('mineflayer-pathfinder').goals;
Expand All @@ -36,16 +34,24 @@ function createNewBot(user) {
username: user,
checkTimeoutInterval: 2147483646, // This is *awful*, but hack around some upstream bugs related to timeouts https://github.com/PrismarineJS/mineflayer/issues/3292
// This means the bot will take an entire 2 and a half weeks to time out from a server, but thats funny so I don't care - luna
plugins: [mineflayerDashboard, pathfinder, mineflayerPVP, mineflayerArmorManager, mineflayerCollectBlock],
plugins: [
mineflayerDashboard,
pathfinder,
mineflayerArmorManager,
minecraftHawkEye
],
});

bot.on('spawn', () => {

mcData = require('minecraft-data')(bot.version);
bot.loadPlugin(minecraftHawkEye);

// change logging
global.console.log = bot.dashboard.log;
global.console.warn = bot.dashboard.log;
global.console.error = bot.dashboard.log;

// define movements
let botMovements = new Movements(bot);
botMovements.canDig = true;
botMovements.canOpenDoors = true;
Expand All @@ -61,6 +67,7 @@ function createNewBot(user) {

bot.pathfinder.setMovements(botMovements);

// add commands to dashboard
readyCommands(bot);

// require('child_process').exec('start http://localhost:8080/'); // OPENING VIEWER - THIS ISNT MALWARE
Expand Down

0 comments on commit 12c6072

Please sign in to comment.