diff options
author | ementalo <ementalodev@gmx.co.uk> | 2012-10-10 14:00:38 +0100 |
---|---|---|
committer | ementalo <ementalodev@gmx.co.uk> | 2012-10-10 14:01:22 +0100 |
commit | 3d2870cc4e6f771a37304ce9e6267663e10d01e6 (patch) | |
tree | 008085f4380398b7c21de638696b176d5876a021 /EssentialsSigns/src/net/ess3/signs/SignGameMode.java | |
parent | 62d5f63ab19fd5b35f712598080b8aab7e5e7185 (diff) | |
download | Essentials-3d2870cc4e6f771a37304ce9e6267663e10d01e6.tar Essentials-3d2870cc4e6f771a37304ce9e6267663e10d01e6.tar.gz Essentials-3d2870cc4e6f771a37304ce9e6267663e10d01e6.tar.lz Essentials-3d2870cc4e6f771a37304ce9e6267663e10d01e6.tar.xz Essentials-3d2870cc4e6f771a37304ce9e6267663e10d01e6.zip |
Esschat clean up
Re-implement sign throttle Test #2331
Diffstat (limited to 'EssentialsSigns/src/net/ess3/signs/SignGameMode.java')
-rw-r--r-- | EssentialsSigns/src/net/ess3/signs/SignGameMode.java | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/EssentialsSigns/src/net/ess3/signs/SignGameMode.java b/EssentialsSigns/src/net/ess3/signs/SignGameMode.java deleted file mode 100644 index 1109956ab..000000000 --- a/EssentialsSigns/src/net/ess3/signs/SignGameMode.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.ess3.signs; - -import java.util.Locale; -import static net.ess3.I18n._; -import net.ess3.api.ChargeException; -import net.ess3.api.IEssentials; -import net.ess3.api.IUser; -import net.ess3.economy.Trade; -import org.bukkit.GameMode; - - -public class SignGameMode extends EssentialsSign -{ - public SignGameMode() - { - super("GameMode"); - } - - @Override - protected boolean onSignCreate(final ISign sign, final IUser player, final String username, final IEssentials ess) throws SignException - { - final String gamemode = sign.getLine(1); - if (gamemode.isEmpty()) - { - sign.setLine(1, "Survival"); - } - - validateTrade(sign, 2, ess); - - return true; - } - - @Override - protected boolean onSignInteract(final ISign sign, final IUser player, final String username, final IEssentials ess) throws SignException, ChargeException - { - final Trade charge = getTrade(sign, 2, ess); - final String mode = sign.getLine(1).trim(); - - if (mode.isEmpty()) - { - throw new SignException(_("invalidSignLine", 2)); - } - charge.isAffordableFor(player); - - //this needs to be fixed - player.getPlayer().setGameMode(player.getPlayer().getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL); - player.sendMessage(_("gameMode", _(player.getPlayer().getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getPlayer().getDisplayName())); - charge.charge(player); - return true; - } -} |