UNPKG

@nxg-org/mineflayer-util-plugin

Version:

mineflayer utils for NextGEN mineflayer plugins.

33 lines (32 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UtilFunctions = void 0; const vec3_1 = require("vec3"); const entityFunctions_1 = require("./entityFunctions"); const filterFunctions_1 = require("./filterFunctions"); const inventoryFunctions_1 = require("./inventoryFunctions"); const movementFunctions_1 = require("./movementFunctions"); const predictiveFunctions_1 = require("./predictiveFunctions"); const rayTracingFunctions_1 = require("./rayTracingFunctions"); /** * I can't inherit from multiple classes. This language sucks. * I'm not using mixins. Fuck you, fuck that. * I'm just going to segregate these functions into separate categories * because once again, fuck you. * */ class UtilFunctions { constructor(bot) { this.bot = bot; this.inv = new inventoryFunctions_1.InventoryFunctions(bot); this.move = new movementFunctions_1.MovementFunctions(bot); this.entity = new entityFunctions_1.EntityFunctions(bot); this.predict = new predictiveFunctions_1.PredictiveFunctions(bot); this.filters = new filterFunctions_1.FilterFunctions(bot); this.raytrace = new rayTracingFunctions_1.RayTraceFunctions(bot); } getViewDir() { return new vec3_1.Vec3(-Math.sin(this.bot.entity.yaw) * Math.cos(this.bot.entity.pitch), Math.sin(this.bot.entity.pitch), -Math.cos(this.bot.entity.yaw) * Math.cos(this.bot.entity.pitch)); } } exports.UtilFunctions = UtilFunctions;