From 1d4138866db1798b59f98324b5e010448f2973e1 Mon Sep 17 00:00:00 2001 From: Trever Fischer Date: Sun, 1 Apr 2012 15:10:14 -0400 Subject: [PATCH] Add /vomit --- src/main/java/us/camin/Plugin.java | 3 + src/main/java/us/camin/VomitCommand.java | 95 ++++++++++++++++++++++++ src/main/resources/plugin.yml | 7 ++ 3 files changed, 105 insertions(+) create mode 100644 src/main/java/us/camin/VomitCommand.java diff --git a/src/main/java/us/camin/Plugin.java b/src/main/java/us/camin/Plugin.java index d45a643..a2a8742 100644 --- a/src/main/java/us/camin/Plugin.java +++ b/src/main/java/us/camin/Plugin.java @@ -37,6 +37,7 @@ public class Plugin extends JavaPlugin { private Server m_api; private JoinListener m_listener; private MOTDCommand m_motdCommand; + private VomitCommand m_vomitCommand; public Server api() { return m_api; @@ -58,6 +59,8 @@ public class Plugin extends JavaPlugin { m_motdCommand = new MOTDCommand(this); getCommand("motd").setExecutor(m_motdCommand); + m_vomitCommand = new VomitCommand(this); + getCommand("vomit").setExecutor(m_vomitCommand); log.info("[Caminus] Plugin enabled"); } diff --git a/src/main/java/us/camin/VomitCommand.java b/src/main/java/us/camin/VomitCommand.java new file mode 100644 index 0000000..a617e11 --- /dev/null +++ b/src/main/java/us/camin/VomitCommand.java @@ -0,0 +1,95 @@ +package us.camin; + +/* + This file is part of Caminus + + Caminus is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Caminus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Caminus. If not, see . + */ + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.inventory.ItemStack; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; +import org.bukkit.Material; +import org.bukkit.util.Vector; +import org.bukkit.Location; + +import java.lang.Thread; +import java.lang.Runnable; + +public class VomitCommand implements CommandExecutor { + private Plugin m_plugin; + + public VomitCommand(Plugin p) { + m_plugin = p; + } + + private class VomitRunner implements Runnable { + private ItemStack m_stack; + private Player m_target; + private int m_qty; + + public VomitRunner(ItemStack stack, Player target, int quantity) { + m_stack = stack; + m_target = target; + m_qty = quantity; + } + + public void run() { + for(int i = 0;i + vomit: + description: Causes a player to vomit blocks + usage: / player quantity item permissions: caminus.*: default: op @@ -14,9 +17,13 @@ permissions: children: caminus.whitelisted: true caminus.freedoorday: true + caminus.vomit: true caminus.freedoorday: default: false description: Enables free half door day + caminus.vomit: + default: op + description: Enables /vomit caminus.whitelisted: default: op description: Allows user to bypass caminus API whitelisting