feat: update plugins

Signed-off-by: MiaoWoo <admin@yumc.pw>
merge/3/MERGE
MiaoWoo 2019-04-28 18:08:47 +08:00
parent a78e6482e8
commit a28386401c
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,47 @@
'use strict';
/**
* WorldEdit 插件
*/
/*global Java, base, module, exports, require*/
var command = require('api/command');
var Material = Java.type("org.bukkit.Material");
var description = {
name: 'WorldEdit',
version: '1.0',
author: 'MiaoWoo',
commands: {
'/up': {
description: 'Up Player And Set Block'
}
}
};
function load() {
}
function enable() {
command.on(this, '/up', {
cmd: function(sender, command, args) {
if (!sender.openInventory) {
return;
}
var player = sender;
var location = player.location;
var type = Material[args[0]] || Material['STONE'];
player.velocity = player.velocity.setY(0.5);
setTimeout(function() {
location.block.type = type
}, 8);
return true;
},
tab: function(sender, command, args) {
}
});
}
module.exports = {
description: description,
enable: enable
};

View File

@ -217,4 +217,4 @@ module.exports = {
load: load,
enable: enable,
disable: disable
};
};