diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java index 1c769e523..f0a1f16fc 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java @@ -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), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java index 8a7efe8fe..21f0ee4c9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java @@ -19,12 +19,20 @@ public class UpdateRank extends CommandBase { 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,9 +60,9 @@ public class UpdateRank extends CommandBase 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 (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 || rank == Rank.JNR_DEV || rank == Rank.DEVELOPER) { - if (rank == Rank.ADMIN && !Plugin.hasRank(caller, Rank.LT)) + if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT)) { UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!")); return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java index f2a63704c..485f5a124 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java @@ -208,20 +208,22 @@ public class AchievementManager extends MiniPlugin { int level = get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel(); - if (sender.getName().equalsIgnoreCase("Phinary") || sender.getName().equalsIgnoreCase("Horus")) - level = -level; - else if (sender.getName().equalsIgnoreCase("B2_mp")) + if (sender.getName().equalsIgnoreCase("B2_mp")) return 101; - else if (rank.Has(Rank.OWNER)) - level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel()); - else if (rank.Has(Rank.ADMIN)) - level = Math.max(level, 30 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel()); - else if (rank.Has(Rank.SNR_MODERATOR)) - level = Math.max(level, 15); - else if (rank.Has(Rank.MODERATOR)) + + if (rank.Has(Rank.MODERATOR)) level = Math.max(level, 5); - else if (rank.Has(Rank.JNR_DEV)) + if (rank.Has(Rank.SNR_MODERATOR)) + level = Math.max(level, 15); + if (rank.Has(Rank.JNR_DEV)) level = Math.max(level, 25); + if (rank.Has(Rank.ADMIN)) + level = Math.max(level, 30 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel()); + if (rank.Has(Rank.OWNER)) + level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel()); + + if (sender.getName().equalsIgnoreCase("Phinary")) + level = -level; return level; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java index 957816f12..03382bf95 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java @@ -12,7 +12,7 @@ public class HomeCommand extends CommandBase { public HomeCommand(NpcManager plugin) { - super(plugin, Rank.DEVELOPER, "home"); + super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "home"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java index 3e3037964..5e66eee21 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java @@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase { 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)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java index 3e447d5ae..e35d2f15e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java @@ -14,7 +14,7 @@ public class SendCommand extends CommandBase { public SendCommand(Portal plugin) { - super(plugin, Rank.ADMIN, "send"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "send"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java index f293eaf8d..31e1bb563 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java @@ -261,7 +261,7 @@ public class PreferencesPage extends ShopPageBase { public HereCommand(Teleport plugin) { - super(plugin, Rank.ADMIN, "here", "h"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "here", "h"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java index ff2a51f08..1067506b0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java @@ -15,7 +15,7 @@ public class RestartServerCommand extends CommandBase { public RestartServerCommand(FileUpdater plugin) { - super(plugin, Rank.ADMIN, "restart"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "restart"); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index dcaac1d40..2cf2e5b53 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -103,7 +103,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class HubManager extends MiniClientPlugin { // ☃❅ 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 @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); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java index 810e964d8..2d99ce5d7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java @@ -10,7 +10,7 @@ public class GadgetToggle extends CommandBase { public GadgetToggle(HubManager plugin) { - super(plugin, Rank.ADMIN, new String[] {"gadget"}); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gadget"}); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java index 7900e79ee..4416e7b15 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java @@ -13,7 +13,7 @@ public class GameModeCommand extends CommandBase { public GameModeCommand(HubManager plugin) { - super(plugin, Rank.ADMIN, new String[] {"gm"}); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gm"}); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java index dd1e33d77..a9e6cf029 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java @@ -10,7 +10,7 @@ public class NewsCommand extends MultiCommandBase { public NewsCommand(HubManager plugin) { - super(plugin, Rank.ADMIN, "news"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "news"); AddCommand(new NewsAddCommand(plugin)); AddCommand(new NewsDeleteCommand(plugin)); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java index e3ca7c240..fa32eb919 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java @@ -19,7 +19,7 @@ public class NewsListCommand extends CommandBase { public NewsListCommand(HubManager plugin) { - super(plugin, Rank.ADMIN, "list"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "list"); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java index 425ce1a0f..07caf2363 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java @@ -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)) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index d54d571ce..394e5dcf7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -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) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java index 8e1e5dc51..f45344d2a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java @@ -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 { 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 diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java index 1718baec5..386d3867d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java @@ -11,7 +11,7 @@ public class WriteCommand extends CommandBase { public WriteCommand(ArcadeManager plugin) { - super(plugin, Rank.ADMIN, "write"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "write"); } @Override