Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/lib/bossbar.js
Views: 789
const colors = ['pink', 'blue', 'red', 'green', 'yellow', 'purple', 'white']1const divisions = [0, 6, 10, 12, 20]23function loader (registry) {4const ChatMessage = require('prismarine-chat')(registry)5return class BossBar {6constructor (uuid, title, health, dividers, color, flags) {7this._entityUUID = uuid8this._title = ChatMessage.fromNotch(title)9this._health = health10this._dividers = divisions[dividers]11this._color = colors[color]12this._shouldDarkenSky = flags & 0x113this._isDragonBar = flags & 0x214this._createFog = flags & 0x415}1617set entityUUID (uuid) {18this._entityUUID = uuid19}2021set title (title) {22this._title = ChatMessage.fromNotch(title)23}2425set health (health) {26this._health = health27}2829set dividers (dividers) {30this._dividers = divisions[dividers]31}3233set color (color) {34this._color = colors[color]35}3637set flags (flags) {38this._shouldDarkenSky = flags & 0x139this._isDragonBar = flags & 0x240this._createFog = flags & 0x441}4243get flags () {44return (this._shouldDarkenSky) | (this._isDragonBar << 1) | (this._createFog << 2)45}4647set shouldDarkenSky (darkenSky) {48this._shouldDarkenSky = darkenSky49}5051set isDragonBar (dragonBar) {52this._isDragonBar = dragonBar53}5455get createFog () {56return this._createFog57}5859set createFog (createFog) {60this._createFog = createFog61}6263get entityUUID () {64return this._entityUUID65}6667get title () {68return this._title69}7071get health () {72return this._health73}7475get dividers () {76return this._dividers77}7879get color () {80return this._color81}8283get shouldDarkenSky () {84return this._shouldDarkenSky85}8687get isDragonBar () {88return this._isDragonBar89}9091get shouldCreateFog () {92return this._createFog93}94}95}9697module.exports = loader9899100