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 +};