Skip to content
Draft
6 changes: 6 additions & 0 deletions src/Enums/NBT/AttributeOperation.enum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

module.exports = Object.freeze({
ADD: 0,
MULTIPLY_BASE: 1,
MULTIPLY: 2
});
7 changes: 7 additions & 0 deletions src/Enums/NBT/BookGeneration.enum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

module.exports = Object.freeze({
ORIGINAL: 0,
COPY: 1,
COPY_OF_COPY: 2,
TATTERED: 3
});
19 changes: 19 additions & 0 deletions src/Enums/NBT/CollarColor.enum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

module.exports = Object.freeze({
WHITE: 0,
ORANGE: 1,
MAGENTA: 2,
LIGHT_BLUE: 3,
YELLOW: 4,
LIME: 5,
PINK: 6,
GRAY: 7,
LIGHT_GRAY: 8,
CYAN: 9,
PURPLE: 10,
BLUE: 11,
BROWN: 12,
GREEN: 13,
RED: 14,
BLACK: 15
});
13 changes: 13 additions & 0 deletions src/Enums/NBT/ExplosionType.enum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

/**
* The type of firework explosions
* UNKNOWN_SHAPE will be rendered as small ball and named as Unknown Shape
*/
module.exports = Object.freeze({
SMALL_BALL: 0,
LARGE_BALL: 1,
STAR_SHAPE: 2,
CREEPER_SHAPE: 3,
BURST: 4,
UNKNOWN_SHAPE: 5
});
86 changes: 86 additions & 0 deletions src/modules/Manager/WindowManager.class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
const Manager = require("./Manager.class.js");
const WindowPackageHandler = require("../../Packages/PackageHandler/Player/WindowPackageHandler.class.js");

class WindowManager extends Manager {
constructor() {
super();
}

/**
* addWindow - add a new window to manager
*
* @param {Window} window The window
*
* @return {type} Description
*/
addWindow(window) {
this.addObject(window.id, window);
}


/**
* removeWindow - remove a window from list
*
* @param {Window} window The window to remove
*
* @return {type} Description
*/
removeWindow(window) {
this.removeObject(window.id);
}


/**
* removeWindowById - Remove a specific window by id
*
* @param {number} id the window id
*
* @return {type} Description
*/
removeWindowById(id) {
this.removeObject(id);
}


/**
* getWindow - get a window by id
*
* @param {number} id The window id
*
* @return {Window} return the window
*/
getWindow(id) {
this.getObject(id);
}


/**
* getAllWindows - Get a list with all windows
*
* @return {array} A list with all windows
*/
getAllWindows() {
return this.getAllObjects();
}


/**
* createWindow - create a new window
*
* @param {Player} player The owner player
* @param {number} size The count of window slots
* @param {Entity} entity the entity
* @param {WindowType} type the window type
* @param {string} [title=] custom window title
* @param {number} [id] The window id
*
* @return {type} Description
*/
createWindow(player, size, entity, type, title = "", id = this.getAllWindows().length) {
let window = new WindowPackageHandler(player, id, size, entity, type, title);
this.addWindow(window);
return window;
}
}

module.exports = WindowManager;
25 changes: 25 additions & 0 deletions src/modules/Model/Color.class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

/**
*
*/
class Color {

/**
* constructor - Init Color
*/
constructor() {
this.red = 0;
this.green = 0;
this.blue = 0;
}


/**
* getColorCode - Return a color code for NBT data
*
* @return integer
*/
getColorCode() {
return (this.red << 16) + (this.green << 8) + this.blue;
}
}
Loading