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:
@@ -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;
|
||||
|
@@ -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[]
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user