From 905cf2ac45c2085a982ae28e9a7d7f0ce998391d Mon Sep 17 00:00:00 2001 From: Drakia Date: Mon, 28 Mar 2011 12:07:08 -0700 Subject: [PATCH] Fixed a bug in iConomy checking. --- README | 3 +++ src/net/TheDgtl/Stargate/Portal.java | 8 ++++++++ src/net/TheDgtl/Stargate/Stargate.java | 6 ------ src/plugin.yml | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README b/README index dfbf45a..0520daf 100644 --- a/README +++ b/README @@ -90,8 +90,11 @@ not-enough-money-message - The message displayed if a player lacks money to do s ============= Changes ============= +[Version 0.30] + - Fixed a bug in iConomy checking. [Version 0.29] - Added iConomy support. Currently only works with iConomy 4.4 until Niji fixes 4.5 + - Thanks @Jonbas for the base iConomy implementation [Version 0.28] - Fixed an issue with removing stargates during load [Version 0.27] diff --git a/src/net/TheDgtl/Stargate/Portal.java b/src/net/TheDgtl/Stargate/Portal.java index 3c84122..21f8893 100644 --- a/src/net/TheDgtl/Stargate/Portal.java +++ b/src/net/TheDgtl/Stargate/Portal.java @@ -9,6 +9,7 @@ import java.util.Iterator; import java.util.Scanner; import java.util.logging.Level; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; @@ -623,6 +624,13 @@ public class Portal { if ((gate == null) || (buttonVector == null)) { return null; } + + if (iConomyHandler.useiConomy() && !iConomyHandler.chargePlayer(player.getName(), iConomyHandler.createCost)) { + if (!iConomyHandler.inFundMsg.isEmpty()) { + player.sendMessage(ChatColor.RED + iConomyHandler.inFundMsg); + } + return null; + } Portal portal = null; diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index af576a9..6623c33 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -371,12 +371,6 @@ public class Stargate extends JavaPlugin { // Initialize a stargate if (hasPerm(player, "stargate.create", player.isOp()) || hasPerm(player, "stargate.create.personal", false)) { - if (iConomyHandler.useiConomy() && !iConomyHandler.chargePlayer(player.getName(), iConomyHandler.createCost)) { - if (!iConomyHandler.inFundMsg.isEmpty()) { - player.sendMessage(ChatColor.RED + iConomyHandler.inFundMsg); - } - return; - } SignPost sign = new SignPost(new Blox(block)); // Set sign text so we can create a gate with it. sign.setText(0, event.getLine(0)); diff --git a/src/plugin.yml b/src/plugin.yml index d148735..079348a 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.29 +version: 0.30 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net \ No newline at end of file