-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.js
38 lines (38 loc) · 1.17 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var events = require("events");
var core = require("@magikcraft/core");
global.holograms = require('@magikcraft/core/holograms').default;
function init() {
require('@magikcraft/op-all/autoload');
console.log('Registering Creative mode handler');
events.playerJoin(function (_a) {
var player = _a.player;
setTimeout(function () {
var GameMode = Java.type('org.bukkit.GameMode');
// Initial join is a bit chaotic
player.setGameMode(GameMode.CREATIVE);
echo(player, "Creative Mode set.");
console.log("Set creative mode for " + player.name);
}, 1000);
});
}
exports.init = init;
function create() {
var core = require('@magikcraft/core');
var hologram = core.holograms;
var utils = require('utils');
var p = utils.player('sitapati');
var h = hologram.createHologram({
lines: ['Yolo'],
location: p.getLocation(),
});
return h;
}
exports.create = create;
function get() {
var hologram = core.holograms;
var hs = hologram.getHolograms();
return hs;
}
exports.get = get;