Add TL for commands. Resolves #162. Supercedes #97.

This commit is contained in:
korikisulda
2014-12-07 23:12:52 +00:00
committed by drtshock
parent bd8f572cbf
commit 1230803cfb
64 changed files with 864 additions and 318 deletions

View File

@@ -5,7 +5,11 @@ import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.LazyLocation;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.util.LazyLocation;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
import java.util.Map;
@@ -27,14 +31,14 @@ public class CmdFWarp extends FCommand {
public void perform() {
//TODO: check if in combat.
if (args.size() == 0) {
FancyMessage msg = new FancyMessage("Warps: ").color(ChatColor.GOLD);
FancyMessage msg = new FancyMessage(TL.COMMAND_FWARP_WARPS.toString()).color(ChatColor.GOLD);
Map<String, LazyLocation> warps = myFaction.getWarps();
for (String s : warps.keySet()) {
msg.then(s + " ").tooltip("Click to warp!").command("f warp " + s).color(ChatColor.WHITE);
msg.then(s + " ").tooltip(TL.COMMAND_FWARP_CLICKTOWARP.toString()).command("f warp " + s).color(ChatColor.WHITE);
}
sendFancyMessage(msg);
} else if (args.size() > 1) {
fme.msg("<i>/f warp <warpname>");
fme.msg(TL.COMMAND_FWARP_COMMANDFORMAT);
} else {
String warpName = argAsString(0);
if (myFaction.isWarp(argAsString(0))) {
@@ -42,14 +46,14 @@ public class CmdFWarp extends FCommand {
return;
}
fme.getPlayer().teleport(myFaction.getWarp(warpName).getLocation());
fme.msg("<i>Warped to <a>%s", warpName);
fme.msg(TL.COMMAND_FWARP_WARPED, warpName);
} else {
fme.msg("<i>Couldn't find warp <a>%s", warpName);
fme.msg(TL.COMMAND_FWARP_INVALID, warpName);
}
}
}
private boolean transact(FPlayer player) {
return P.p.getConfig().getBoolean("warp-cost.enabled", false) && !player.isAdminBypassing() && Econ.modifyMoney(player, P.p.getConfig().getDouble("warp-cost.warp", 5), "to warp", "for warping");
return P.p.getConfig().getBoolean("warp-cost.enabled", false) && !player.isAdminBypassing() && Econ.modifyMoney(player, P.p.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
}
}