mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
Reimplement vanish command
- SuperVanish has a wack permission system, and it didn't work in some rare circumstances. Added back TFMs vanish with the SuperVanish API - Fixed the permission nodes so admins can see other admins, like how it was in TFM
This commit is contained in:
parent
541abb1ba8
commit
e294ef8312
@ -35,6 +35,7 @@ public class VanishBridge extends FreedomService
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " unvanished and is now visible to all players.");
|
||||||
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" + "**");
|
||||||
}
|
}
|
||||||
@ -53,7 +54,7 @@ public class VanishBridge extends FreedomService
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (event.isSilent())
|
if (event.isSilent())
|
||||||
{
|
{
|
||||||
plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " silently vanished.");
|
plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " vanished and is now only visible to admins.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,6 @@ import org.bukkit.permissions.PermissionAttachmentInfo;
|
|||||||
@CommandParameters(description = "Check your permissions", usage = "/<command> [prefix | reload]")
|
@CommandParameters(description = "Check your permissions", usage = "/<command> [prefix | reload]")
|
||||||
public class Command_permissions extends FreedomCommand
|
public class Command_permissions extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
|
import de.myzelyam.api.vanish.VanishAPI;
|
||||||
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||||
|
@CommandParameters(description = "Hide yourself from other players", usage = "/<command> [-s]", aliases = "v,ev,evanish")
|
||||||
|
public class Command_vanish extends FreedomCommand
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
|
{
|
||||||
|
if (args.length == 0)
|
||||||
|
{
|
||||||
|
if (!VanishAPI.isInvisible(playerSender))
|
||||||
|
{
|
||||||
|
VanishAPI.hidePlayer(playerSender);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VanishAPI.showPlayer(playerSender);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("-v"))
|
||||||
|
{
|
||||||
|
if (!VanishAPI.isInvisible(playerSender))
|
||||||
|
{
|
||||||
|
VanishAPI.getPlugin().getVisibilityChanger().hidePlayer(playerSender, null, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VanishAPI.getPlugin().getVisibilityChanger().showPlayer(playerSender, null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -15,7 +15,6 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|||||||
|
|
||||||
public class PermissionConfig extends FreedomService
|
public class PermissionConfig extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final String PERMISSIONS_FILENAME = "permissions.yml";
|
public static final String PERMISSIONS_FILENAME = "permissions.yml";
|
||||||
//
|
//
|
||||||
private final EnumMap<PermissionEntry, Object> entries;
|
private final EnumMap<PermissionEntry, Object> entries;
|
||||||
@ -60,13 +59,11 @@ public class PermissionConfig extends FreedomService
|
|||||||
@Override
|
@Override
|
||||||
public void onStart()
|
public void onStart()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStop()
|
public void onStop()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load()
|
public void load()
|
||||||
@ -167,7 +164,6 @@ public class PermissionConfig extends FreedomService
|
|||||||
|
|
||||||
public static class PermissionDefaults
|
public static class PermissionDefaults
|
||||||
{
|
{
|
||||||
|
|
||||||
private YamlConfiguration defaults = null;
|
private YamlConfiguration defaults = null;
|
||||||
|
|
||||||
private PermissionDefaults(InputStream defaultConfig)
|
private PermissionDefaults(InputStream defaultConfig)
|
||||||
@ -190,5 +186,4 @@ public class PermissionConfig extends FreedomService
|
|||||||
return defaults.get(path);
|
return defaults.get(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ import org.bukkit.permissions.PermissionAttachmentInfo;
|
|||||||
|
|
||||||
public class PermissionManager extends FreedomService
|
public class PermissionManager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public Map<Displayable, List<String>> permissions = Maps.newHashMap();
|
public Map<Displayable, List<String>> permissions = Maps.newHashMap();
|
||||||
|
|
||||||
public Map<Player, PermissionAttachment> attachments = Maps.newHashMap();
|
public Map<Player, PermissionAttachment> attachments = Maps.newHashMap();
|
||||||
@ -35,7 +34,6 @@ public class PermissionManager extends FreedomService
|
|||||||
|
|
||||||
public void loadPermissionNodes()
|
public void loadPermissionNodes()
|
||||||
{
|
{
|
||||||
|
|
||||||
FLog.info("Loading permission nodes...");
|
FLog.info("Loading permission nodes...");
|
||||||
|
|
||||||
permissions.clear();
|
permissions.clear();
|
||||||
|
@ -211,7 +211,7 @@ super_admins:
|
|||||||
- "essentials.tphere"
|
- "essentials.tphere"
|
||||||
- "essentials.tpo"
|
- "essentials.tpo"
|
||||||
- "essentials.tpohere"
|
- "essentials.tpohere"
|
||||||
- "sv.use"
|
- "sv.see"
|
||||||
- "sv.toggleitems"
|
- "sv.toggleitems"
|
||||||
|
|
||||||
# Telnet Admin permission nodes
|
# Telnet Admin permission nodes
|
||||||
|
@ -2,6 +2,6 @@ name: TotalFreedomMod
|
|||||||
main: me.totalfreedom.totalfreedommod.TotalFreedomMod
|
main: me.totalfreedom.totalfreedommod.TotalFreedomMod
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
description: Plugin for the Total Freedom server.
|
description: Plugin for the Total Freedom server.
|
||||||
loadbefore: [BukkitTelnet, Essentials, LibsDisguises, WorldEdit, WorldGuard, WorldGuardExtraFlags, TFGuilds]
|
loadbefore: [BukkitTelnet, Essentials, LibsDisguises, WorldEdit, WorldGuard, WorldGuardExtraFlags, TFGuilds, SuperVanish, PremiumVanish]
|
||||||
authors: [Madgeek1450, Prozza]
|
authors: [Madgeek1450, Prozza]
|
||||||
api-version: 1.16
|
api-version: 1.16
|
Loading…
Reference in New Issue
Block a user