mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-01 20:30:48 +02:00
Log notice when chat ignore is blocked by another plugin.
This commit is contained in:
@@ -52,7 +52,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
final User user = ess.getUser(event.getPlayer());
|
final User user = ess.getUser(event.getPlayer());
|
||||||
updateCompass(user);
|
updateCompass(user);
|
||||||
user.setDisplayNick();
|
user.setDisplayNick();
|
||||||
|
|
||||||
if (ess.getSettings().isTeleportInvulnerability())
|
if (ess.getSettings().isTeleportInvulnerability())
|
||||||
{
|
{
|
||||||
user.enableInvulnerabilityAfterTeleport();
|
user.enableInvulnerabilityAfterTeleport();
|
||||||
@@ -69,15 +69,30 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
user.sendMessage(_("voiceSilenced"));
|
user.sendMessage(_("voiceSilenced"));
|
||||||
LOGGER.info(_("mutedUserSpeaks", user.getName()));
|
LOGGER.info(_("mutedUserSpeaks", user.getName()));
|
||||||
}
|
}
|
||||||
final Iterator<Player> it = event.getRecipients().iterator();
|
try
|
||||||
while (it.hasNext())
|
|
||||||
{
|
{
|
||||||
final User u = ess.getUser(it.next());
|
final Iterator<Player> it = event.getRecipients().iterator();
|
||||||
if (u.isIgnoredPlayer(user))
|
while (it.hasNext())
|
||||||
{
|
{
|
||||||
it.remove();
|
final User u = ess.getUser(it.next());
|
||||||
|
if (u.isIgnoredPlayer(user))
|
||||||
|
{
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (UnsupportedOperationException ex)
|
||||||
|
{
|
||||||
|
if (ess.getSettings().isDebug())
|
||||||
|
{
|
||||||
|
ess.getLogger().log(Level.INFO, "Ignore could not block chat due to custom chat plugin event.", ex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ess.getLogger().info("Ignore could not block chat due to custom chat plugin event.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
user.updateActivity(true);
|
user.updateActivity(true);
|
||||||
user.setDisplayNick();
|
user.setDisplayNick();
|
||||||
}
|
}
|
||||||
@@ -494,20 +509,20 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
|
|
||||||
ess.scheduleSyncDelayedTask(
|
ess.scheduleSyncDelayedTask(
|
||||||
new Runnable()
|
new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
Location loc = user.getLocation();
|
||||||
|
loc.setX(otarget.getX());
|
||||||
|
loc.setZ(otarget.getZ());
|
||||||
|
while (LocationUtil.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ()))
|
||||||
{
|
{
|
||||||
@Override
|
loc.setY(loc.getY() + 1d);
|
||||||
public void run()
|
}
|
||||||
{
|
user.getBase().teleport(loc, TeleportCause.PLUGIN);
|
||||||
Location loc = user.getLocation();
|
}
|
||||||
loc.setX(otarget.getX());
|
});
|
||||||
loc.setZ(otarget.getZ());
|
|
||||||
while (LocationUtil.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ()))
|
|
||||||
{
|
|
||||||
loc.setY(loc.getY() + 1d);
|
|
||||||
}
|
|
||||||
user.getBase().teleport(loc, TeleportCause.PLUGIN);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -543,14 +558,14 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
used = true;
|
used = true;
|
||||||
ess.scheduleSyncDelayedTask(
|
ess.scheduleSyncDelayedTask(
|
||||||
new Runnable()
|
new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
user.getServer().dispatchCommand(user.getBase(), command);
|
user.getServer().dispatchCommand(user.getBase(), command);
|
||||||
LOGGER.log(Level.INFO, String.format("[PT] %s issued server command: /%s", user.getName(), command));
|
LOGGER.log(Level.INFO, String.format("[PT] %s issued server command: /%s", user.getName(), command));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return used;
|
return used;
|
||||||
|
@@ -9,6 +9,7 @@ import java.util.Iterator;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.logging.Level;
|
||||||
import net.ess3.api.events.LocalChatSpyEvent;
|
import net.ess3.api.events.LocalChatSpyEvent;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
@@ -93,7 +94,7 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
|
|||||||
{
|
{
|
||||||
if (ess.getSettings().isDebug())
|
if (ess.getSettings().isDebug())
|
||||||
{
|
{
|
||||||
ess.getLogger().info("Plugin triggered custom chat event, local chat handling aborted.");
|
ess.getLogger().log(Level.INFO, "Plugin triggered custom chat event, local chat handling aborted.", ex);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user