Switch to the new I18n class and format cleanup of all classes

This commit is contained in:
snowleo 2011-11-21 02:55:26 +01:00
parent 19f5a2340d
commit 220d68f375
207 changed files with 1247 additions and 1306 deletions

View file

@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4

View file

@ -1,7 +1,7 @@
package com.earth2me.essentials.chat;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Util;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@ -32,21 +32,21 @@ public class EssentialsChat extends JavaPlugin
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this);
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
public void onDisable()
{
chatListener.clear();
}
public void addEssentialsChatListener(final String plugin, final IEssentialsChatListener listener)
{
chatListener.put(plugin, listener);
}
public IEssentialsChatListener removeEssentialsChatListener(final String plugin)
{
return chatListener.remove(plugin);

View file

@ -1,14 +1,10 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.earth2me.essentials.chat;
import com.earth2me.essentials.ChargeException;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Map;
import java.util.logging.Logger;
import org.bukkit.Location;
@ -20,10 +16,6 @@ import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerListener;
/**
*
* @author Seiji
*/
public abstract class EssentialsChatPlayer extends PlayerListener
{
protected transient IEssentials ess;
@ -117,7 +109,7 @@ public abstract class EssentialsChatPlayer extends PlayerListener
protected void sendLocalChat(final User sender, final long radius, final PlayerChatEvent event)
{
event.setCancelled(true);
logger.info(Util.format("localFormat", sender.getName(), event.getMessage()));
logger.info(_("localFormat", sender.getName(), event.getMessage()));
final Location loc = sender.getLocation();
final World world = loc.getWorld();
final int x = loc.getBlockX();

View file

@ -23,8 +23,7 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
}
/**
* This listener should apply the general chat formatting only...then return control back
* the event handler
* This listener should apply the general chat formatting only...then return control back the event handler
*/
final User user = ess.getUser(event.getPlayer());
if (user.isAuthorized("essentials.chat.color"))

View file

@ -1,9 +1,9 @@
package com.earth2me.essentials.chat;
import com.earth2me.essentials.ChargeException;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Map;
import org.bukkit.Server;
import org.bukkit.event.player.PlayerChatEvent;
@ -25,8 +25,8 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
}
/**
* This file should handle detection of the local chat features...
* if local chat is enabled, we need to handle it here
* This file should handle detection of the local chat features... if local chat is enabled, we need to handle
* it here
*/
final User user = ess.getUser(event.getPlayer());
final String chatType = getChatType(event.getMessage());
@ -56,11 +56,11 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
{
charge(user, command.toString());
event.setMessage(event.getMessage().substring(1));
event.setFormat(Util.format(format.toString(), event.getFormat()));
event.setFormat(_(format.toString(), event.getFormat()));
return;
}
user.sendMessage(Util.i18n(errorMsg.toString()));
user.sendMessage(_(errorMsg.toString()));
event.setCancelled(true);
return;
}