Needed permission changes for Jr Developers (Pending approval)
This commit is contained in:
parent
47d410370d
commit
0b53bca385
@ -1,20 +1,20 @@
|
||||
package mineplex.core.common;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
|
||||
public enum Rank
|
||||
{
|
||||
LT("LT", ChatColor.DARK_RED),
|
||||
OWNER("Owner", ChatColor.DARK_RED),
|
||||
DEVELOPER("Dev", ChatColor.RED),
|
||||
ADMIN("Admin", ChatColor.RED),
|
||||
JNR_DEV("Jr.Dev", ChatColor.RED),
|
||||
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
|
||||
MODERATOR("Mod", ChatColor.GOLD),
|
||||
JNR_DEV("Jr.Dev", ChatColor.RED),
|
||||
HELPER("Trainee", ChatColor.DARK_AQUA),
|
||||
MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
|
||||
MAPDEV("Builder", ChatColor.BLUE),
|
||||
|
@ -19,12 +19,20 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
{
|
||||
public UpdateRank(CoreClientManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "updateRank");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV /*On test servers only*/}, "updateRank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(final Player caller, String[] args)
|
||||
{
|
||||
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
|
||||
if (Plugin.Get(caller).GetRank() == Rank.JNR_DEV && !testServer)
|
||||
{
|
||||
F.main(Plugin.getName(), F.elem(Rank.JNR_DEV.GetTag(true, true)) + "s are only permitted to set ranks on test servers!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args == null)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
|
||||
@ -52,7 +60,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
|
||||
final Rank rank = tempRank;
|
||||
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
if (!testServer && (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR))
|
||||
{
|
||||
if (rank == Rank.ADMIN && !Plugin.hasRank(caller, Rank.LT))
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class AddCommand extends CommandBase<NpcManager>
|
||||
{
|
||||
public AddCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "add");
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "add");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ public class DeleteCommand extends CommandBase<NpcManager>
|
||||
{
|
||||
public DeleteCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "del");
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "del");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ public class HomeCommand extends CommandBase<NpcManager>
|
||||
{
|
||||
public HomeCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "home");
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "home");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase<NpcManager>
|
||||
{
|
||||
public NpcCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "npc");
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "npc");
|
||||
|
||||
AddCommand(new AddCommand(plugin));
|
||||
AddCommand(new DeleteCommand(plugin));
|
||||
|
@ -14,7 +14,7 @@ public class SendCommand extends CommandBase<Portal>
|
||||
{
|
||||
public SendCommand(Portal plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "send");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "send");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -261,7 +261,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
buildPreference(42, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||
buildPreference(44, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
||||
}
|
||||
if (getClientManager().Get(getPlayer()).GetRank().Has(Rank.ADMIN))
|
||||
if (getClientManager().Get(getPlayer()).GetRank().Has(Rank.ADMIN) || getClientManager().Get(getPlayer()).GetRank() == Rank.JNR_DEV)
|
||||
{
|
||||
buildPreference(36, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility);
|
||||
buildPreference(38, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||
|
@ -10,7 +10,7 @@ public class HereCommand extends CommandBase<Teleport>
|
||||
{
|
||||
public HereCommand(Teleport plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "here", "h");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "here", "h");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -103,7 +103,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
public class HubManager extends MiniClientPlugin<HubClient>
|
||||
{
|
||||
// ☃❅ Snowman!
|
||||
public HubType Type = HubType.Normal;
|
||||
public HubType Type = HubType.Normal;
|
||||
|
||||
private BlockRestore _blockRestore;
|
||||
private CoreClientManager _clientManager;
|
||||
@ -495,7 +495,10 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void AdminOP(PlayerJoinEvent event)
|
||||
{
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER))
|
||||
// Give developers operator on their servers
|
||||
boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
|
||||
event.getPlayer().setOp(true);
|
||||
else
|
||||
event.getPlayer().setOp(false);
|
||||
|
@ -10,7 +10,7 @@ public class GadgetToggle extends CommandBase<HubManager>
|
||||
{
|
||||
public GadgetToggle(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new String[] {"gadget"});
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gadget"});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ public class GameModeCommand extends CommandBase<HubManager>
|
||||
{
|
||||
public GameModeCommand(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new String[] {"gm"});
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gm"});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +42,7 @@ public class ForcefieldManager extends MiniPlugin
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (Manager.getPreferences().Get(player).HubForcefield && Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN))
|
||||
if (Manager.getPreferences().Get(player).HubForcefield && (Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN) || Manager.GetClients().Get(player).GetRank() == Rank.JNR_DEV))
|
||||
{
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
@ -56,7 +56,7 @@ public class ForcefieldManager extends MiniPlugin
|
||||
if (UtilMath.offset(other, player) > range)
|
||||
continue;
|
||||
|
||||
if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN))
|
||||
if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN) || Manager.GetClients().Get(other).GetRank() == Rank.JNR_DEV)
|
||||
continue;
|
||||
|
||||
if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false))
|
||||
|
@ -829,6 +829,18 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void AdminOP(PlayerJoinEvent event)
|
||||
{
|
||||
// Give developers operator on their servers
|
||||
boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
|
||||
event.getPlayer().setOp(true);
|
||||
else
|
||||
event.getPlayer().setOp(false);
|
||||
}
|
||||
|
||||
public boolean IsAlive(Player player)
|
||||
{
|
||||
if (_game == null)
|
||||
|
@ -3,9 +3,8 @@ package nautilus.game.arcade.command;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
@ -13,12 +12,13 @@ import mineplex.core.common.util.ProfileLoader;
|
||||
import mineplex.core.common.util.UUIDFetcher;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
|
||||
public class DisguiseCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
public DisguiseCommand(ArcadeManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.TWITCH}, "disguise");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.TWITCH, Rank.JNR_DEV}, "disguise");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,7 +11,7 @@ public class WriteCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
public WriteCommand(ArcadeManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "write");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "write");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user