mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 10:05:59 +00:00
Merge pull request #257 from speedxx/development
silent joining and leaving fixes
This commit is contained in:
commit
8832d5c870
@ -8,10 +8,10 @@ import me.totalfreedom.totalfreedommod.rank.Displayable;
|
|||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
|
|
||||||
public class VanishBridge extends FreedomService
|
public class VanishBridge extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart()
|
public void onStart()
|
||||||
{
|
{
|
||||||
@ -22,15 +22,19 @@ public class VanishBridge extends FreedomService
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler
|
||||||
public void onPlayerUnvanish(PlayerShowEvent event)
|
public void onPlayerUnvanish(PlayerShowEvent event)
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Displayable display = plugin.rm.getDisplay(player);
|
Displayable display = plugin.rm.getDisplay(player);
|
||||||
String tag = display.getColoredTag();
|
String tag = display.getColoredTag();
|
||||||
|
|
||||||
|
if (!event.isSilent())
|
||||||
|
{
|
||||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(event.getPlayer(), null));
|
FUtil.bcastMsg(plugin.rm.craftLoginMessage(event.getPlayer(), null));
|
||||||
plugin.dc.messageChatChannel("**" + player.getName() + " joined the server" + "**");
|
plugin.dc.messageChatChannel("**" + player.getName() + " joined the server" + "**");
|
||||||
|
}
|
||||||
|
|
||||||
PlayerData playerData = plugin.pl.getData(player);
|
PlayerData playerData = plugin.pl.getData(player);
|
||||||
if (playerData.getTag() != null)
|
if (playerData.getTag() != null)
|
||||||
{
|
{
|
||||||
@ -39,10 +43,13 @@ public class VanishBridge extends FreedomService
|
|||||||
playerData.setTag(tag);
|
playerData.setTag(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler
|
||||||
public void onPlayerVanish(PlayerHideEvent event)
|
public void onPlayerVanish(PlayerHideEvent event)
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
if (!event.isSilent())
|
||||||
|
{
|
||||||
plugin.dc.messageChatChannel("**" + player.getName() + " left the server" + "**");
|
plugin.dc.messageChatChannel("**" + player.getName() + " left the server" + "**");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
@ -44,8 +44,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
|
|
||||||
public class Discord extends FreedomService
|
public class Discord extends FreedomService
|
||||||
{
|
{
|
||||||
@ -251,24 +249,6 @@ public class Discord extends FreedomService
|
|||||||
return VERIFICATION_CODES;
|
return VERIFICATION_CODES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onPlayerJoin(PlayerJoinEvent event)
|
|
||||||
{
|
|
||||||
if (!plugin.al.isVanished(event.getPlayer()))
|
|
||||||
{
|
|
||||||
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " joined the server" + "**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onPlayerLeave(PlayerQuitEvent event)
|
|
||||||
{
|
|
||||||
if (!plugin.al.isVanished(event.getPlayer()))
|
|
||||||
{
|
|
||||||
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " left the server" + "**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerDeath(PlayerDeathEvent event)
|
public void onPlayerDeath(PlayerDeathEvent event)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.admin.Admin;
|
|||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
@ -41,7 +41,7 @@ operators:
|
|||||||
- "libsdisguises.noactionbar"
|
- "libsdisguises.noactionbar"
|
||||||
|
|
||||||
# WorldGuard
|
# WorldGuard
|
||||||
- "worldgyardregion.list.own"
|
- "worldguard.region.list.own"
|
||||||
- "worldguard.region.addmember.own.*"
|
- "worldguard.region.addmember.own.*"
|
||||||
- "worldguard.region.removemember.own.*"
|
- "worldguard.region.removemember.own.*"
|
||||||
- "worldguard.region.info.*"
|
- "worldguard.region.info.*"
|
||||||
|
Loading…
Reference in New Issue
Block a user