Add new command /hat and update translate keys as well as fix colour codes.

This commit is contained in:
md_5 2012-05-27 17:24:49 +10:00
parent 409f337973
commit 0559b935e9
16 changed files with 128 additions and 7 deletions

View file

@ -271,7 +271,7 @@ public class Essentials extends JavaPlugin implements IEssentials
{
if (getUser(p).isVanished())
{
p.sendMessage(ChatColor.RED + _("unvanishedReload"));
p.sendMessage(_("unvanishedReload"));
}
}
i18n.onDisable();

View file

@ -0,0 +1,36 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
public class Commandhat extends EssentialsCommand
{
public Commandhat()
{
super("hat");
}
@Override
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
if (user.getItemInHand().getType() != Material.AIR)
{
final ItemStack hand = user.getItemInHand();
final PlayerInventory inv = user.getInventory();
final ItemStack head = inv.getHelmet();
inv.removeItem(hand);
inv.setHelmet(hand);
inv.setItemInHand(head);
user.sendMessage(_("hatPlaced"));
}
else
{
user.sendMessage(_("hatFail"));
}
}
}

View file

@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

View file

@ -23,7 +23,7 @@ public class Commandvanish extends EssentialsCommand
{
p.showPlayer(user);
}
user.sendMessage(ChatColor.GREEN + _("vanished"));
user.sendMessage(_("vanished"));
}
else
{
@ -33,7 +33,7 @@ public class Commandvanish extends EssentialsCommand
{
p.hidePlayer(user);
}
user.sendMessage(ChatColor.GREEN + _("unvanished"));
user.sendMessage(_("unvanished"));
}
}
user.toggleVanished();

View file

@ -111,6 +111,8 @@ geoipJoinFormat=Player {0} comes from {1}
godDisabledFor=disabled for {0}
godEnabledFor=enabled for {0}
godMode=\u00a77God mode {0}.
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.
haveBeenReleased=\u00a77You have been released
heal=\u00a77You have been healed.
healOther=\u00a77Healed {0}.
@ -380,8 +382,8 @@ unknownItemName=Unknown item name: {0}
unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}.
unlimitedItems=Unlimited items:
unmutedPlayer=Player {0} unmuted.
unvanished=You are once again visible.
unvanishedReload=A reload has forced you to become visible.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
upgradingFilesError=Error while upgrading the files
userDoesNotExist=The user {0} does not exist.
userIsAway={0} is now AFK
@ -391,7 +393,7 @@ userUsedPortal={0} used an existing exit portal.
userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1}
userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp
usingTempFolderForTesting=Using temp folder for testing:
vanished=You have now been vanished.
vanished=\u00a7aYou have now been vanished.
versionMismatch=Version mismatch! Please update {0} to the same version.
versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version.
voiceSilenced=\u00a77Your voice has been silenced

View file

@ -426,3 +426,11 @@ youAreHealed=\u00a77Byl jsi uzdraven.
youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby jsi si precetl sve zpravy.
currentWorld=Current World: {0}
kickedAll=\u00a7cKicked all players from server
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=\u00e5r
years=\u00e5r
youAreHealed=\u00a77Du er blevet healed. Halleluja!
youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=Jahr
years=Jahre
youAreHealed=\u00a77Du wurdest geheilt.
youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -85,6 +85,8 @@ errorWithMessage=\u00a7cError: {0}
essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
essentialsReload=\u00a77Essentials Reloaded {0}
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
extinguish=\u00a77You extinguished yourself.
extinguishOthers=\u00a77You extinguished {0}.
failedToCloseConfig=Failed to close config {0}
@ -109,6 +111,8 @@ geoipJoinFormat=Player {0} comes from {1}
godDisabledFor=disabled for {0}
godEnabledFor=enabled for {0}
godMode=\u00a77God mode {0}.
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.
haveBeenReleased=\u00a77You have been released
heal=\u00a77You have been healed.
healOther=\u00a77Healed {0}.
@ -364,6 +368,7 @@ tradeSignEmptyOwner=There is nothing to collect from this trade sign.
treeFailure=\u00a7cTree generation failure. Try again on grass or dirt.
treeSpawned=\u00a77Tree spawned.
true=true
tps=Current TPS = {0}
typeTpaccept=\u00a77To teleport, type \u00a7c/tpaccept\u00a77.
typeTpdeny=\u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
typeWorldName=\u00a77You can also type the name of a specific world.
@ -377,6 +382,8 @@ unknownItemName=Unknown item name: {0}
unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}.
unlimitedItems=Unlimited items:
unmutedPlayer=Player {0} unmuted.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
upgradingFilesError=Error while upgrading the files
userDoesNotExist=The user {0} does not exist.
userIsAway={0} is now AFK
@ -386,6 +393,7 @@ userUsedPortal={0} used an existing exit portal.
userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1}
userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp
usingTempFolderForTesting=Using temp folder for testing:
vanished=\u00a7aYou have now been vanished.
versionMismatch=Version mismatch! Please update {0} to the same version.
versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version.
voiceSilenced=\u00a77Your voice has been silenced

View file

@ -423,3 +423,11 @@ year=año
years=años
youAreHealed=\u00a77Has sido curado.
youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=ann\u00e9e
years=ann\u00e9es
youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=anno
years=anni
youAreHealed=\u00a77Sei stato curato.
youHaveNewMail=\u00a7cHai {0} messaggi!\u00a7f digita \u00a77/mail read\u00a7f per consultare la tua mail.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=jaar
years=jaren
youAreHealed=\u00a77Je bent genezen.
youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=rok
years=lat
youAreHealed=\u00a77Zostales/las uleczony/na.
youHaveNewMail=\u00a7cMasz {0} wiadomosci!\u00a7f napisz \u00a77/mail read\u00a7f aby je przeczytac.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -423,3 +423,11 @@ year=ano
years=anos
youAreHealed=\u00a77Voc\u00ea foi curado.
youHaveNewMail=\u00a7cVoc\u00ea tem {0} mensagens!\u00a7f Digite \u00a77/mail read\u00a7f para ver seu email.
exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
vanished=\u00a7aYou have now been vanished.
tps=Current TPS = {0}
hatPlaced=\u00a7eEnjoy your new hat!
hatFail=\u00a7cYou must have something to wear in your hand.

View file

@ -135,6 +135,10 @@ commands:
description: Enables your godly powers.
usage: /<command> [player]
aliases: [tgm,godmode,egod,etgm,egodmode]
hat:
description: Get some cool new headgear
usage: /<command>
aliases: [ehat]
heal:
description: Heals you or the given player.
usage: /<command> [player]