diff options
Diffstat (limited to 'EssentialsChat/src')
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/ChatPermissions.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/ChatPermissions.java) | 8 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/ChatStore.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/ChatStore.java) | 4 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/EssentialsChat.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java) | 15 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java) | 9 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEvent.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEvent.java) | 5 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java) | 21 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerHighest.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerHighest.java) | 6 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerLowest.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerLowest.java) | 6 | ||||
-rw-r--r-- | EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerNormal.java (renamed from EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerNormal.java) | 6 | ||||
-rw-r--r-- | EssentialsChat/src/plugin.yml | 4 |
10 files changed, 41 insertions, 43 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/ChatPermissions.java b/EssentialsChat/src/net/ess3/chat/ChatPermissions.java index 361bbbdda..888b85f9d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/ChatPermissions.java +++ b/EssentialsChat/src/net/ess3/chat/ChatPermissions.java @@ -1,4 +1,4 @@ -package com.earth2me.essentials.chat; +package net.ess3.chat; import net.ess3.api.IPermission; import net.ess3.permissions.BasePermission; @@ -6,7 +6,9 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -public class ChatPermissions { + +public class ChatPermissions +{ private static Map<String, IPermission> permissions = new HashMap<String, IPermission>(); public static IPermission getPermission(final String groupName) @@ -14,7 +16,7 @@ public class ChatPermissions { IPermission perm = permissions.get(groupName); if (perm == null) { - perm = new BasePermission("essentials.chat.",groupName.toLowerCase(Locale.ENGLISH)); + perm = new BasePermission("essentials.chat.", groupName.toLowerCase(Locale.ENGLISH)); permissions.put(groupName, perm); } return perm; diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/ChatStore.java b/EssentialsChat/src/net/ess3/chat/ChatStore.java index 4f6630187..4d696fb36 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/ChatStore.java +++ b/EssentialsChat/src/net/ess3/chat/ChatStore.java @@ -1,8 +1,8 @@ -package com.earth2me.essentials.chat; +package net.ess3.chat; -import net.ess3.economy.Trade; import net.ess3.api.IEssentials; import net.ess3.api.IUser; +import net.ess3.economy.Trade; public class ChatStore diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/net/ess3/chat/EssentialsChat.java index 53f2aa591..4c922c45f 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsChat.java @@ -1,10 +1,10 @@ -package com.earth2me.essentials.chat; +package net.ess3.chat; import static net.ess3.I18n._; import net.ess3.api.IEssentials; -import com.earth2me.essentials.chat.listenerlevel.EssentialsChatPlayerListenerHighest; -import com.earth2me.essentials.chat.listenerlevel.EssentialsChatPlayerListenerLowest; -import com.earth2me.essentials.chat.listenerlevel.EssentialsChatPlayerListenerNormal; +import net.ess3.chat.listenerlevel.EssentialsChatPlayerListenerHighest; +import net.ess3.chat.listenerlevel.EssentialsChatPlayerListenerLowest; +import net.ess3.chat.listenerlevel.EssentialsChatPlayerListenerNormal; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; @@ -22,7 +22,7 @@ public class EssentialsChat extends JavaPlugin public void onEnable() { final PluginManager pluginManager = getServer().getPluginManager(); - final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials3"); + final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials-3"); if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { LOGGER.log(Level.WARNING, _("versionMismatchAll")); @@ -45,9 +45,4 @@ public class EssentialsChat extends JavaPlugin final EssentialsLocalChatEventListener localChatListener = new EssentialsLocalChatEventListener(getServer(), ess); pluginManager.registerEvents(localChatListener, this); } - - @Override - public void onDisable() - { - } } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java index 6376f9171..ae8fce4a1 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java @@ -1,14 +1,14 @@ -package com.earth2me.essentials.chat; +package net.ess3.chat; -import net.ess3.api.ChargeException; import static net.ess3.I18n._; -import net.ess3.economy.Trade; -import net.ess3.utils.Util; +import net.ess3.api.ChargeException; import net.ess3.api.IEssentials; import net.ess3.api.IRanks; import net.ess3.api.ISettings; import net.ess3.api.IUser; +import net.ess3.economy.Trade; import net.ess3.permissions.Permissions; +import net.ess3.utils.Util; import java.util.Locale; import java.util.Map; import java.util.logging.Logger; @@ -111,6 +111,7 @@ public abstract class EssentialsChatPlayer implements Listener protected void handleLocalChat(final PlayerChatEvent event, final ChatStore chatStore) { + long radius = 0; ISettings settings = ess.getSettings(); settings.acquireReadLock(); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEvent.java b/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEvent.java index 2eae385a9..e0ce6602d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEvent.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEvent.java @@ -1,4 +1,4 @@ -package com.earth2me.essentials.chat; +package net.ess3.chat; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; @@ -98,6 +98,7 @@ public class EssentialsLocalChatEvent extends Event implements Cancellable return parentEvent; } + @Override public HandlerList getHandlers() { return handlers; @@ -107,4 +108,4 @@ public class EssentialsLocalChatEvent extends Event implements Cancellable { return handlers; } -}
\ No newline at end of file +} diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java b/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java index 86b4760c5..be7b20ba6 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java @@ -1,4 +1,4 @@ -package com.earth2me.essentials.chat; +package net.ess3.chat; import static net.ess3.I18n._; import net.ess3.api.IEssentials; @@ -18,7 +18,6 @@ public class EssentialsLocalChatEventListener implements Listener { protected transient IEssentials ess; protected final transient Server server; - private static final Logger LOGGER = Logger.getLogger("Minecraft"); public EssentialsLocalChatEventListener(final Server server, final IEssentials ess) { @@ -37,33 +36,33 @@ public class EssentialsLocalChatEventListener implements Listener { String type = _("chatTypeLocal"); final IUser user = ess.getUser(onlinePlayer); - //TODO: remove reference to op - if (user.isIgnoringPlayer(sender.getName()) && !sender.isOp()) + if (user.isIgnoringPlayer(ess.getUser(sender))) { continue; } if (!user.equals(sender)) { + boolean abort = false; final Location playerLoc = user.getLocation(); if (playerLoc.getWorld() != world) { - continue; + abort = true; } final double delta = playerLoc.distanceSquared(loc); if (delta > event.getRadius()) { - if (Permissions.CHAT_SPY.isAuthorized(user)) + abort = true; + } + + if (abort) + { + if (ChatPermissions.getPermission("spy").isAuthorized(user)) { type = type.concat(_("chatTypeSpy")); } - else - { - continue; - } } } - final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage())); user.sendMessage(message); } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerHighest.java b/EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerHighest.java index eba0b02c8..46dc2af82 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerHighest.java +++ b/EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerHighest.java @@ -1,8 +1,8 @@ -package com.earth2me.essentials.chat.listenerlevel; +package net.ess3.chat.listenerlevel; import net.ess3.api.IEssentials; -import com.earth2me.essentials.chat.ChatStore; -import com.earth2me.essentials.chat.EssentialsChatPlayer; +import net.ess3.chat.ChatStore; +import net.ess3.chat.EssentialsChatPlayer; import java.util.Map; import org.bukkit.Server; import org.bukkit.event.EventHandler; diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerLowest.java index 7be17c73c..dfe96df35 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerLowest.java @@ -1,9 +1,9 @@ -package com.earth2me.essentials.chat.listenerlevel; +package net.ess3.chat.listenerlevel; import net.ess3.api.IEssentials; import net.ess3.api.IUser; -import com.earth2me.essentials.chat.ChatStore; -import com.earth2me.essentials.chat.EssentialsChatPlayer; +import net.ess3.chat.ChatStore; +import net.ess3.chat.EssentialsChatPlayer; import java.util.Map; import org.bukkit.Server; import org.bukkit.event.EventHandler; diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerNormal.java b/EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerNormal.java index f6b8fa334..2e3b44549 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/listenerlevel/EssentialsChatPlayerListenerNormal.java +++ b/EssentialsChat/src/net/ess3/chat/listenerlevel/EssentialsChatPlayerListenerNormal.java @@ -1,8 +1,8 @@ -package com.earth2me.essentials.chat.listenerlevel; +package net.ess3.chat.listenerlevel; import net.ess3.api.IEssentials; -import com.earth2me.essentials.chat.ChatStore; -import com.earth2me.essentials.chat.EssentialsChatPlayer; +import net.ess3.chat.ChatStore; +import net.ess3.chat.EssentialsChatPlayer; import java.util.Map; import org.bukkit.Server; import org.bukkit.event.EventHandler; diff --git a/EssentialsChat/src/plugin.yml b/EssentialsChat/src/plugin.yml index 488ef7b50..6e314cbbb 100644 --- a/EssentialsChat/src/plugin.yml +++ b/EssentialsChat/src/plugin.yml @@ -1,10 +1,10 @@ # This determines the command prefix when there are conflicts (/name:home, /name:help, etc.) name: EssentialsChat -main: com.earth2me.essentials.chat.EssentialsChat +main: net.ess3.chat.EssentialsChat # Note to developers: This next line cannot change, or the automatic versioning system will break. version: ${build.number} website: http://tiny.cc/EssentialsWiki description: Provides chat control features for Essentials. Requires Permissions. authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Okamosy] -depend: [Essentials3] +depend: [Essentials-3] #softdepend: [Factions]
\ No newline at end of file |