From a28386401c9f4b87b8938041bfa1e76e24287af1 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Sun, 28 Apr 2019 18:08:47 +0800 Subject: [PATCH] feat: update plugins Signed-off-by: MiaoWoo --- .../resources/plugins/bukkit/WorldEdit.js | 47 +++++++++++++++++++ .../plugins/{ => sponge}/MiaoBoard.js | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/plugins/bukkit/WorldEdit.js rename src/main/resources/plugins/{ => sponge}/MiaoBoard.js (99%) diff --git a/src/main/resources/plugins/bukkit/WorldEdit.js b/src/main/resources/plugins/bukkit/WorldEdit.js new file mode 100644 index 0000000..ff7c8ff --- /dev/null +++ b/src/main/resources/plugins/bukkit/WorldEdit.js @@ -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 +}; diff --git a/src/main/resources/plugins/MiaoBoard.js b/src/main/resources/plugins/sponge/MiaoBoard.js similarity index 99% rename from src/main/resources/plugins/MiaoBoard.js rename to src/main/resources/plugins/sponge/MiaoBoard.js index 01789ee..d07fb47 100644 --- a/src/main/resources/plugins/MiaoBoard.js +++ b/src/main/resources/plugins/sponge/MiaoBoard.js @@ -217,4 +217,4 @@ module.exports = { load: load, enable: enable, disable: disable -}; \ No newline at end of file +};