From d5b791f8c8539cc3439dbec287447fdfe0a40086 Mon Sep 17 00:00:00 2001 From: Acrobot Date: Sun, 15 May 2011 19:33:03 +0200 Subject: [PATCH] Changed name to ChestShop --- README | 2 +- .../ChestShop.java} | 12 +++--- .../Chests/ChestObject.java | 2 +- .../Chests/MinecraftChest.java | 2 +- .../Economy.java | 2 +- .../Items/ItemName.java | 2 +- .../Items/Odd.java | 2 +- .../Listeners/blockBreak.java | 2 +- .../Listeners/blockPlace.java | 4 +- .../Listeners/playerInteract.java | 10 ++--- .../Listeners/pluginEnable.java | 36 ++++++++-------- .../Listeners/signChange.java | 2 +- com/Acrobot/ChestShop/Logging/Logging.java | 10 +++++ .../Messaging/Message.java | 2 +- .../Permission.java | 2 +- .../Protection/Default.java | 2 +- .../Protection/LWCplugin.java | 2 +- .../Protection/LockettePlugin.java | 2 +- .../Protection/Protection.java | 2 +- .../Protection/Security.java | 2 +- .../Shop/Shop.java | 4 +- .../Utils/Config.java | 10 +++-- .../Utils/Numerical.java | 2 +- .../ChestShop/Utils/SearchForBlock.java | 41 +++++++++++++++++++ .../Utils/SignUtil.java | 2 +- .../iConomyChestShop/Logging/Logging.java | 10 ----- .../Utils/SearchForBlock.java | 13 ------ plugin.yml | 4 +- 28 files changed, 110 insertions(+), 78 deletions(-) rename com/Acrobot/{iConomyChestShop/iConomyChestShop.java => ChestShop/ChestShop.java} (90%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Chests/ChestObject.java (93%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Chests/MinecraftChest.java (99%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Economy.java (95%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Items/ItemName.java (95%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Items/Odd.java (75%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Listeners/blockBreak.java (72%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Listeners/blockPlace.java (82%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Listeners/playerInteract.java (84%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Listeners/pluginEnable.java (54%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Listeners/signChange.java (71%) create mode 100644 com/Acrobot/ChestShop/Logging/Logging.java rename com/Acrobot/{iConomyChestShop => ChestShop}/Messaging/Message.java (79%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Permission.java (92%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Protection/Default.java (90%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Protection/LWCplugin.java (93%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Protection/LockettePlugin.java (91%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Protection/Protection.java (85%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Protection/Security.java (91%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Shop/Shop.java (72%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Utils/Config.java (77%) rename com/Acrobot/{iConomyChestShop => ChestShop}/Utils/Numerical.java (94%) create mode 100644 com/Acrobot/ChestShop/Utils/SearchForBlock.java rename com/Acrobot/{iConomyChestShop => ChestShop}/Utils/SignUtil.java (95%) delete mode 100644 com/Acrobot/iConomyChestShop/Logging/Logging.java delete mode 100644 com/Acrobot/iConomyChestShop/Utils/SearchForBlock.java diff --git a/README b/README index 9313d63..4a78e0d 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -iConomyChestShop +ChestShop Shop plugin for Bukkit diff --git a/com/Acrobot/iConomyChestShop/iConomyChestShop.java b/com/Acrobot/ChestShop/ChestShop.java similarity index 90% rename from com/Acrobot/iConomyChestShop/iConomyChestShop.java rename to com/Acrobot/ChestShop/ChestShop.java index 29a0c19..fadbde0 100644 --- a/com/Acrobot/iConomyChestShop/iConomyChestShop.java +++ b/com/Acrobot/ChestShop/ChestShop.java @@ -1,8 +1,8 @@ -package com.Acrobot.iConomyChestShop; +package com.Acrobot.ChestShop; -import com.Acrobot.iConomyChestShop.Items.ItemName; -import com.Acrobot.iConomyChestShop.Listeners.*; -import com.Acrobot.iConomyChestShop.Utils.Config; +import com.Acrobot.ChestShop.Items.ItemName; +import com.Acrobot.ChestShop.Listeners.*; +import com.Acrobot.ChestShop.Utils.Config; import org.bukkit.Server; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -16,7 +16,7 @@ import org.bukkit.plugin.java.JavaPlugin; * Main file of the plugin * @author Acrobot */ -public class iConomyChestShop extends JavaPlugin { +public class ChestShop extends JavaPlugin { private final pluginEnable pluginEnable = new pluginEnable(); private final blockBreak blockBreak = new blockBreak(); @@ -59,7 +59,7 @@ public class iConomyChestShop extends JavaPlugin { //iCSversion if(commandName.equals("icsversion")){ - sender.sendMessage("iConomyChestShop's version is: " + desc.getVersion()); + sender.sendMessage("ChestShop's version is: " + desc.getVersion()); return true; } diff --git a/com/Acrobot/iConomyChestShop/Chests/ChestObject.java b/com/Acrobot/ChestShop/Chests/ChestObject.java similarity index 93% rename from com/Acrobot/iConomyChestShop/Chests/ChestObject.java rename to com/Acrobot/ChestShop/Chests/ChestObject.java index 0d674bf..513c703 100644 --- a/com/Acrobot/iConomyChestShop/Chests/ChestObject.java +++ b/com/Acrobot/ChestShop/Chests/ChestObject.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Chests; +package com.Acrobot.ChestShop.Chests; import org.bukkit.inventory.ItemStack; diff --git a/com/Acrobot/iConomyChestShop/Chests/MinecraftChest.java b/com/Acrobot/ChestShop/Chests/MinecraftChest.java similarity index 99% rename from com/Acrobot/iConomyChestShop/Chests/MinecraftChest.java rename to com/Acrobot/ChestShop/Chests/MinecraftChest.java index 4c912a0..33e1c16 100644 --- a/com/Acrobot/iConomyChestShop/Chests/MinecraftChest.java +++ b/com/Acrobot/ChestShop/Chests/MinecraftChest.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Chests; +package com.Acrobot.ChestShop.Chests; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/com/Acrobot/iConomyChestShop/Economy.java b/com/Acrobot/ChestShop/Economy.java similarity index 95% rename from com/Acrobot/iConomyChestShop/Economy.java rename to com/Acrobot/ChestShop/Economy.java index 568e34a..3ae6760 100644 --- a/com/Acrobot/iConomyChestShop/Economy.java +++ b/com/Acrobot/ChestShop/Economy.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop; +package com.Acrobot.ChestShop; import com.nijikokun.register.payment.Method; diff --git a/com/Acrobot/iConomyChestShop/Items/ItemName.java b/com/Acrobot/ChestShop/Items/ItemName.java similarity index 95% rename from com/Acrobot/iConomyChestShop/Items/ItemName.java rename to com/Acrobot/ChestShop/Items/ItemName.java index 7399d21..7aef487 100644 --- a/com/Acrobot/iConomyChestShop/Items/ItemName.java +++ b/com/Acrobot/ChestShop/Items/ItemName.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Items; +package com.Acrobot.ChestShop.Items; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/com/Acrobot/iConomyChestShop/Items/Odd.java b/com/Acrobot/ChestShop/Items/Odd.java similarity index 75% rename from com/Acrobot/iConomyChestShop/Items/Odd.java rename to com/Acrobot/ChestShop/Items/Odd.java index 6a0de85..767bdd7 100644 --- a/com/Acrobot/iConomyChestShop/Items/Odd.java +++ b/com/Acrobot/ChestShop/Items/Odd.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Items; +package com.Acrobot.ChestShop.Items; import info.somethingodd.bukkit.odd.item.OddItem; diff --git a/com/Acrobot/iConomyChestShop/Listeners/blockBreak.java b/com/Acrobot/ChestShop/Listeners/blockBreak.java similarity index 72% rename from com/Acrobot/iConomyChestShop/Listeners/blockBreak.java rename to com/Acrobot/ChestShop/Listeners/blockBreak.java index e788e47..f28e09f 100644 --- a/com/Acrobot/iConomyChestShop/Listeners/blockBreak.java +++ b/com/Acrobot/ChestShop/Listeners/blockBreak.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Listeners; +package com.Acrobot.ChestShop.Listeners; import org.bukkit.event.block.BlockListener; diff --git a/com/Acrobot/iConomyChestShop/Listeners/blockPlace.java b/com/Acrobot/ChestShop/Listeners/blockPlace.java similarity index 82% rename from com/Acrobot/iConomyChestShop/Listeners/blockPlace.java rename to com/Acrobot/ChestShop/Listeners/blockPlace.java index 68d57bf..42f4ed3 100644 --- a/com/Acrobot/iConomyChestShop/Listeners/blockPlace.java +++ b/com/Acrobot/ChestShop/Listeners/blockPlace.java @@ -1,6 +1,6 @@ -package com.Acrobot.iConomyChestShop.Listeners; +package com.Acrobot.ChestShop.Listeners; -import com.Acrobot.iConomyChestShop.Utils.SignUtil; +import com.Acrobot.ChestShop.Utils.SignUtil; import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.event.block.BlockListener; diff --git a/com/Acrobot/iConomyChestShop/Listeners/playerInteract.java b/com/Acrobot/ChestShop/Listeners/playerInteract.java similarity index 84% rename from com/Acrobot/iConomyChestShop/Listeners/playerInteract.java rename to com/Acrobot/ChestShop/Listeners/playerInteract.java index 1806a8d..3930cba 100644 --- a/com/Acrobot/iConomyChestShop/Listeners/playerInteract.java +++ b/com/Acrobot/ChestShop/Listeners/playerInteract.java @@ -1,9 +1,9 @@ -package com.Acrobot.iConomyChestShop.Listeners; +package com.Acrobot.ChestShop.Listeners; -import com.Acrobot.iConomyChestShop.Messaging.Message; -import com.Acrobot.iConomyChestShop.Protection.Security; -import com.Acrobot.iConomyChestShop.Utils.Config; -import com.Acrobot.iConomyChestShop.Utils.SignUtil; +import com.Acrobot.ChestShop.Messaging.Message; +import com.Acrobot.ChestShop.Protection.Security; +import com.Acrobot.ChestShop.Utils.Config; +import com.Acrobot.ChestShop.Utils.SignUtil; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; diff --git a/com/Acrobot/iConomyChestShop/Listeners/pluginEnable.java b/com/Acrobot/ChestShop/Listeners/pluginEnable.java similarity index 54% rename from com/Acrobot/iConomyChestShop/Listeners/pluginEnable.java rename to com/Acrobot/ChestShop/Listeners/pluginEnable.java index 725e3b5..e3c3150 100644 --- a/com/Acrobot/iConomyChestShop/Listeners/pluginEnable.java +++ b/com/Acrobot/ChestShop/Listeners/pluginEnable.java @@ -1,12 +1,12 @@ -package com.Acrobot.iConomyChestShop.Listeners; +package com.Acrobot.ChestShop.Listeners; -import com.Acrobot.iConomyChestShop.Economy; -import com.Acrobot.iConomyChestShop.Items.Odd; -import com.Acrobot.iConomyChestShop.Permission; -import com.Acrobot.iConomyChestShop.Protection.LWCplugin; -import com.Acrobot.iConomyChestShop.Protection.LockettePlugin; -import com.Acrobot.iConomyChestShop.Protection.Security; -import com.Acrobot.iConomyChestShop.iConomyChestShop; +import com.Acrobot.ChestShop.Economy; +import com.Acrobot.ChestShop.Items.Odd; +import com.Acrobot.ChestShop.Permission; +import com.Acrobot.ChestShop.Protection.LWCplugin; +import com.Acrobot.ChestShop.Protection.LockettePlugin; +import com.Acrobot.ChestShop.Protection.Security; +import com.Acrobot.ChestShop.ChestShop; import com.griefcraft.lwc.LWCPlugin; import com.nijikokun.bukkit.Permissions.Permissions; import com.nijikokun.register.payment.Methods; @@ -28,53 +28,53 @@ public class pluginEnable extends ServerListener{ if(!this.Methods.hasMethod()){ if(this.Methods.setMethod(event.getPlugin())){ Economy.economy = this.Methods.getMethod(); - System.out.println("[iConomyChestShop] " + Economy.economy.getName() + " " + Economy.economy.getVersion() + " loaded."); + System.out.println("[ChestShop] " + Economy.economy.getName() + " " + Economy.economy.getVersion() + " loaded."); } } //Permissions if (Permission.permissions == null) { - Plugin permissions = iConomyChestShop.getBukkitServer().getPluginManager().getPlugin("Permissions"); + Plugin permissions = ChestShop.getBukkitServer().getPluginManager().getPlugin("Permissions"); if (permissions != null) { Permission.permissions = ((Permissions) permissions).getHandler(); PluginDescriptionFile pDesc = permissions.getDescription(); - System.out.println("[iConomyChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); + System.out.println("[ChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); } } //LWC if (LWCplugin.lwc == null) { - Plugin lwcPlugin = iConomyChestShop.getBukkitServer().getPluginManager().getPlugin("LWC"); + Plugin lwcPlugin = ChestShop.getBukkitServer().getPluginManager().getPlugin("LWC"); if (lwcPlugin != null) { PluginDescriptionFile pDesc = lwcPlugin.getDescription(); LWCplugin.lwc = ((LWCPlugin) lwcPlugin).getLWC(); Security.protection = new LWCplugin(); - System.out.println("[iConomyChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); + System.out.println("[ChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); } } //OddItem if (Odd.oddItem == null) { - Plugin oddItem = iConomyChestShop.getBukkitServer().getPluginManager().getPlugin("OddItem"); + Plugin oddItem = ChestShop.getBukkitServer().getPluginManager().getPlugin("OddItem"); if (oddItem != null) { PluginDescriptionFile pDesc = oddItem.getDescription(); - Odd.oddItem = (OddItem) iConomyChestShop.getBukkitServer().getPluginManager().getPlugin("OddItem"); - System.out.println("[iConomyChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); + Odd.oddItem = (OddItem) ChestShop.getBukkitServer().getPluginManager().getPlugin("OddItem"); + System.out.println("[ChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); } } //Lockette if (LockettePlugin.lockette == null) { - Plugin lockette = iConomyChestShop.getBukkitServer().getPluginManager().getPlugin("Lockette"); + Plugin lockette = ChestShop.getBukkitServer().getPluginManager().getPlugin("Lockette"); if (lockette != null) { PluginDescriptionFile pDesc = lockette.getDescription(); LockettePlugin.lockette = ((Lockette) lockette); Security.protection = new LockettePlugin(); - System.out.println("[iConomyChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); + System.out.println("[ChestShop] " + pDesc.getName() + " version " + pDesc.getVersion() + " loaded."); } } } diff --git a/com/Acrobot/iConomyChestShop/Listeners/signChange.java b/com/Acrobot/ChestShop/Listeners/signChange.java similarity index 71% rename from com/Acrobot/iConomyChestShop/Listeners/signChange.java rename to com/Acrobot/ChestShop/Listeners/signChange.java index a9e1d94..86aaeed 100644 --- a/com/Acrobot/iConomyChestShop/Listeners/signChange.java +++ b/com/Acrobot/ChestShop/Listeners/signChange.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Listeners; +package com.Acrobot.ChestShop.Listeners; import org.bukkit.event.block.BlockListener; diff --git a/com/Acrobot/ChestShop/Logging/Logging.java b/com/Acrobot/ChestShop/Logging/Logging.java new file mode 100644 index 0000000..d68ae2d --- /dev/null +++ b/com/Acrobot/ChestShop/Logging/Logging.java @@ -0,0 +1,10 @@ +package com.Acrobot.ChestShop.Logging; + +/** + * @author Acrobot + */ +public class Logging { + public static void log(String string){ + System.out.println("[ChestShop] " + string); + } +} diff --git a/com/Acrobot/iConomyChestShop/Messaging/Message.java b/com/Acrobot/ChestShop/Messaging/Message.java similarity index 79% rename from com/Acrobot/iConomyChestShop/Messaging/Message.java rename to com/Acrobot/ChestShop/Messaging/Message.java index f38199b..75f68a1 100644 --- a/com/Acrobot/iConomyChestShop/Messaging/Message.java +++ b/com/Acrobot/ChestShop/Messaging/Message.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Messaging; +package com.Acrobot.ChestShop.Messaging; import org.bukkit.entity.Player; diff --git a/com/Acrobot/iConomyChestShop/Permission.java b/com/Acrobot/ChestShop/Permission.java similarity index 92% rename from com/Acrobot/iConomyChestShop/Permission.java rename to com/Acrobot/ChestShop/Permission.java index 9ddbb3f..a1cfdd8 100644 --- a/com/Acrobot/iConomyChestShop/Permission.java +++ b/com/Acrobot/ChestShop/Permission.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop; +package com.Acrobot.ChestShop; import com.nijiko.permissions.PermissionHandler; import org.bukkit.entity.Player; diff --git a/com/Acrobot/iConomyChestShop/Protection/Default.java b/com/Acrobot/ChestShop/Protection/Default.java similarity index 90% rename from com/Acrobot/iConomyChestShop/Protection/Default.java rename to com/Acrobot/ChestShop/Protection/Default.java index 512f6f4..1f59acd 100644 --- a/com/Acrobot/iConomyChestShop/Protection/Default.java +++ b/com/Acrobot/ChestShop/Protection/Default.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Protection; +package com.Acrobot.ChestShop.Protection; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/com/Acrobot/iConomyChestShop/Protection/LWCplugin.java b/com/Acrobot/ChestShop/Protection/LWCplugin.java similarity index 93% rename from com/Acrobot/iConomyChestShop/Protection/LWCplugin.java rename to com/Acrobot/ChestShop/Protection/LWCplugin.java index 6179bab..d62ea36 100644 --- a/com/Acrobot/iConomyChestShop/Protection/LWCplugin.java +++ b/com/Acrobot/ChestShop/Protection/LWCplugin.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Protection; +package com.Acrobot.ChestShop.Protection; import com.griefcraft.lwc.LWC; import com.griefcraft.model.ProtectionTypes; diff --git a/com/Acrobot/iConomyChestShop/Protection/LockettePlugin.java b/com/Acrobot/ChestShop/Protection/LockettePlugin.java similarity index 91% rename from com/Acrobot/iConomyChestShop/Protection/LockettePlugin.java rename to com/Acrobot/ChestShop/Protection/LockettePlugin.java index 26db0dc..1b4a381 100644 --- a/com/Acrobot/iConomyChestShop/Protection/LockettePlugin.java +++ b/com/Acrobot/ChestShop/Protection/LockettePlugin.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Protection; +package com.Acrobot.ChestShop.Protection; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/com/Acrobot/iConomyChestShop/Protection/Protection.java b/com/Acrobot/ChestShop/Protection/Protection.java similarity index 85% rename from com/Acrobot/iConomyChestShop/Protection/Protection.java rename to com/Acrobot/ChestShop/Protection/Protection.java index bf9ca70..9c179ea 100644 --- a/com/Acrobot/iConomyChestShop/Protection/Protection.java +++ b/com/Acrobot/ChestShop/Protection/Protection.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Protection; +package com.Acrobot.ChestShop.Protection; import org.bukkit.block.Block; diff --git a/com/Acrobot/iConomyChestShop/Protection/Security.java b/com/Acrobot/ChestShop/Protection/Security.java similarity index 91% rename from com/Acrobot/iConomyChestShop/Protection/Security.java rename to com/Acrobot/ChestShop/Protection/Security.java index 765380e..378db89 100644 --- a/com/Acrobot/iConomyChestShop/Protection/Security.java +++ b/com/Acrobot/ChestShop/Protection/Security.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Protection; +package com.Acrobot.ChestShop.Protection; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/com/Acrobot/iConomyChestShop/Shop/Shop.java b/com/Acrobot/ChestShop/Shop/Shop.java similarity index 72% rename from com/Acrobot/iConomyChestShop/Shop/Shop.java rename to com/Acrobot/ChestShop/Shop/Shop.java index 72b3192..7e900d8 100644 --- a/com/Acrobot/iConomyChestShop/Shop/Shop.java +++ b/com/Acrobot/ChestShop/Shop/Shop.java @@ -1,6 +1,6 @@ -package com.Acrobot.iConomyChestShop.Shop; +package com.Acrobot.ChestShop.Shop; -import com.Acrobot.iConomyChestShop.Chests.ChestObject; +import com.Acrobot.ChestShop.Chests.ChestObject; import org.bukkit.block.Sign; import org.bukkit.inventory.ItemStack; diff --git a/com/Acrobot/iConomyChestShop/Utils/Config.java b/com/Acrobot/ChestShop/Utils/Config.java similarity index 77% rename from com/Acrobot/iConomyChestShop/Utils/Config.java rename to com/Acrobot/ChestShop/Utils/Config.java index bf3d9e6..58df5a2 100644 --- a/com/Acrobot/iConomyChestShop/Utils/Config.java +++ b/com/Acrobot/ChestShop/Utils/Config.java @@ -1,6 +1,6 @@ -package com.Acrobot.iConomyChestShop.Utils; +package com.Acrobot.ChestShop.Utils; -import com.Acrobot.iConomyChestShop.Logging.Logging; +import com.Acrobot.ChestShop.Logging.Logging; import org.bukkit.util.config.Configuration; import java.io.File; @@ -9,7 +9,7 @@ import java.io.File; * @author Acrobot */ public class Config { - private static File configFile = new File("plugins/iConomyChestShop/config.yml"); + private static File configFile = new File("plugins/ChestShop/config.yml"); private static Configuration config = new Configuration(configFile); @@ -34,6 +34,10 @@ public class Config { return config.getBoolean(node, false); } + public static String getString(String node){ + return config.getString(node, ""); + } + public static int getInteger(String node){ return config.getInt(node, 0); } diff --git a/com/Acrobot/iConomyChestShop/Utils/Numerical.java b/com/Acrobot/ChestShop/Utils/Numerical.java similarity index 94% rename from com/Acrobot/iConomyChestShop/Utils/Numerical.java rename to com/Acrobot/ChestShop/Utils/Numerical.java index f36e52b..aea293f 100644 --- a/com/Acrobot/iConomyChestShop/Utils/Numerical.java +++ b/com/Acrobot/ChestShop/Utils/Numerical.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Utils; +package com.Acrobot.ChestShop.Utils; /** * Checks if string is a numerical value diff --git a/com/Acrobot/ChestShop/Utils/SearchForBlock.java b/com/Acrobot/ChestShop/Utils/SearchForBlock.java new file mode 100644 index 0000000..8235c05 --- /dev/null +++ b/com/Acrobot/ChestShop/Utils/SearchForBlock.java @@ -0,0 +1,41 @@ +package com.Acrobot.ChestShop.Utils; + +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.block.Chest; +import org.bukkit.block.Sign; + +/** + * @author Acrobot + */ +public class SearchForBlock { + + public static Chest findChest(Sign sign){ + Block block = sign.getBlock(); + return findChest(block); + } + + public static Chest findChest(Block block){ + for(BlockFace bf : BlockFace.values()){ + Block faceBlock = block.getFace(bf); + if(faceBlock.getType() == Material.CHEST){ + return (Chest) faceBlock.getState(); + } + } + return null; + } + + public static Sign findSign(Block block){ + for(BlockFace bf : BlockFace.values()){ + Block faceBlock = block.getFace(bf); + if(SignUtil.isSign(faceBlock)){ + Sign sign = (Sign) faceBlock; + if(SignUtil.isValid(sign)){ + return sign; + } + } + } + return null; + } +} diff --git a/com/Acrobot/iConomyChestShop/Utils/SignUtil.java b/com/Acrobot/ChestShop/Utils/SignUtil.java similarity index 95% rename from com/Acrobot/iConomyChestShop/Utils/SignUtil.java rename to com/Acrobot/ChestShop/Utils/SignUtil.java index e9f1a5d..5f1df27 100644 --- a/com/Acrobot/iConomyChestShop/Utils/SignUtil.java +++ b/com/Acrobot/ChestShop/Utils/SignUtil.java @@ -1,4 +1,4 @@ -package com.Acrobot.iConomyChestShop.Utils; +package com.Acrobot.ChestShop.Utils; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/com/Acrobot/iConomyChestShop/Logging/Logging.java b/com/Acrobot/iConomyChestShop/Logging/Logging.java deleted file mode 100644 index 207913e..0000000 --- a/com/Acrobot/iConomyChestShop/Logging/Logging.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.Acrobot.iConomyChestShop.Logging; - -/** - * @author Acrobot - */ -public class Logging { - public static void log(String string){ - System.out.println("[iConomyChestShop] " + string); - } -} diff --git a/com/Acrobot/iConomyChestShop/Utils/SearchForBlock.java b/com/Acrobot/iConomyChestShop/Utils/SearchForBlock.java deleted file mode 100644 index 2815ea6..0000000 --- a/com/Acrobot/iConomyChestShop/Utils/SearchForBlock.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.Acrobot.iConomyChestShop.Utils; - -import org.bukkit.block.Chest; -import org.bukkit.block.Sign; - -/** - * @author Acrobot - */ -public class SearchForBlock { - public static Chest findChest(Sign sign){ - return null; - } -} diff --git a/plugin.yml b/plugin.yml index 9a4a464..34fd42a 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ -name: iConomyChestShop +name: ChestShop -main: com.Acrobot.iConomyChestShop.iConomyChestShop +main: com.Acrobot.ChestShop.ChestShop database: true version: 3.00