1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-11 17:15:07 +02:00

Removing server layer part 2

This commit is contained in:
snowleo
2012-08-26 20:17:29 +02:00
parent b98021acab
commit 50ab5ffd93
75 changed files with 429 additions and 537 deletions

View File

@@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IPlugin;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
@@ -22,12 +23,13 @@ public class EssentialsChat extends JavaPlugin
public void onEnable()
{
final PluginManager pluginManager = getServer().getPluginManager();
final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials-3");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
final IPlugin plugin = (IPlugin)pluginManager.getPlugin("Essentials-3");
final IEssentials ess = (IEssentials)plugin.getEssentials();
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
{
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
if (!ess.isEnabled())
if (!plugin.isEnabled())
{
this.setEnabled(false);
return;

View File

@@ -83,7 +83,7 @@ public abstract class EssentialsChatPlayer implements Listener
event.setMessage(Util.stripColor(event.getMessage()));
}
String group = ess.getRanks().getMainGroup(user);
String world = user.getWorld().getName();
String world = user.getPlayer().getWorld().getName();
IRanks groupSettings = ess.getRanks();
event.setFormat(groupSettings.getChatFormat(user).format(new Object[]

View File

@@ -43,7 +43,7 @@ public class EssentialsLocalChatEventListener implements Listener
if (!user.equals(sender))
{
boolean abort = false;
final Location playerLoc = user.getLocation();
final Location playerLoc = user.getPlayer().getLocation();
if (playerLoc.getWorld() != world)
{
abort = true;