mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 11:46:40 +00:00
[WIP / DO NOT USE ON PRODUCTION!!] Begin implementing support for SuperVanish and fix bugs
- Update dependencies in pom.xml - Replace TotalFreedomMod's vanish system with SuperVanish. It's widely supported by many major plugins and does a better job vanishing players - Fixed a typo in the SQL command for creating admin tables, where the table would not be created on a clean install of TFM - Update bStats Metrics to latest version - Remove the VanishHandler - Sync the permissions.yml from whats on the server. Entries for Essentials and SuperVanish will be added soon KNOWN BUG: - Plugins override TFM commands (e.g. Essentials takes over /list instead of giving it to TFM). I noticed that there is a semicolon before every TFM command. (:/ban, :/list), which is the actual TFM command. I have no idea where / how this bug came from. Urgently needs to be fixed.
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import de.myzelyam.api.vanish.PlayerHideEvent;
|
||||
import de.myzelyam.api.vanish.PlayerShowEvent;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
public class VanishBridge extends FreedomService
|
||||
{
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerUnvanish(PlayerShowEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
Displayable display = plugin.rm.getDisplay(player);
|
||||
String tag = display.getColoredTag();
|
||||
|
||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(event.getPlayer(), null));
|
||||
plugin.dc.messageChatChannel("**" + player.getName() + " joined the server" + "**");
|
||||
PlayerData playerData = plugin.pl.getData(player);
|
||||
if (playerData.getTag() != null)
|
||||
{
|
||||
tag = FUtil.colorize(playerData.getTag());
|
||||
}
|
||||
playerData.setTag(tag);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerVanish(PlayerHideEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
plugin.dc.messageChatChannel("**" + player.getName() + " left the server" + "**");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user