From 52c97535aba67624474839406fa09892784f3e3d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 15:27:28 -0500 Subject: [PATCH] Added Potato Debugging Tool --- src/alisolarflare/components/BaseCommand.java | 34 +++++++++++++++++++ src/alisolarflare/components/ModCommand.java | 4 +-- .../components/PlayerCommand.java | 4 +-- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 src/alisolarflare/components/BaseCommand.java diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java new file mode 100644 index 0000000..7e6c59d --- /dev/null +++ b/src/alisolarflare/components/BaseCommand.java @@ -0,0 +1,34 @@ +package alisolarflare.components; + +import java.util.Arrays; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public abstract class BaseCommand extends TBMCCommandBase{ + public static ItemStack CreateDebugPotato(List debugMessage){ + ItemStack debugPotato = new ItemStack(Material.BAKED_POTATO); + debugPotato.getItemMeta().setDisplayName("Spicy Debug Potato"); + debugPotato.getItemMeta().setLore(debugMessage); + debugPotato.addEnchantment(Enchantment.ARROW_FIRE, 10); + return debugPotato; + } + public static ItemStack CreateDebugPotato(String debugMessage){ + return CreateDebugPotato(Arrays.asList(debugMessage)); + } + public static void SendDebugPotato(Player player, List debugMessage){ + player.getInventory().addItem(CreateDebugPotato(debugMessage)); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); + return; + } + public static void SendDebugPotato(Player player, String debugMessage){ + SendDebugPotato(player, Arrays.asList(debugMessage)); + } + +} diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/components/ModCommand.java index ebe15f8..3c34e4d 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -2,9 +2,7 @@ package alisolarflare.components; import org.bukkit.command.CommandSender; -import buttondevteam.lib.chat.TBMCCommandBase; - -public abstract class ModCommand extends TBMCCommandBase{ +public abstract class ModCommand extends BaseCommand{ @Override public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java index 5b32d24..5115c9e 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -1,8 +1,6 @@ package alisolarflare.components; -import buttondevteam.lib.chat.TBMCCommandBase; - -public abstract class PlayerCommand extends TBMCCommandBase{ +public abstract class PlayerCommand extends BaseCommand{ @Override public boolean GetPlayerOnly() { // TODO Auto-generated method stub