mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2024-11-14 21:23:33 +00:00
Addressed requested changes
Signed-off-by: Paul Reilly <pawereus@gmail.com>
This commit is contained in:
parent
bbaa325ad6
commit
dd353b4429
@ -1,3 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Freedom-Network-Suite - https://github.com/AtlasMediaGroup/Freedom-Network-Suite
|
||||||
|
* Copyright (C) 2023 Total Freedom Server Network and contributors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
package fns.cladis.command;
|
package fns.cladis.command;
|
||||||
|
|
||||||
import fns.cladis.Cladis;
|
import fns.cladis.Cladis;
|
||||||
@ -8,6 +31,7 @@ import fns.patchwork.command.annotation.Completion;
|
|||||||
import fns.patchwork.command.annotation.Info;
|
import fns.patchwork.command.annotation.Info;
|
||||||
import fns.patchwork.command.annotation.Permissive;
|
import fns.patchwork.command.annotation.Permissive;
|
||||||
import fns.patchwork.command.annotation.Subcommand;
|
import fns.patchwork.command.annotation.Subcommand;
|
||||||
|
import java.util.UUID;
|
||||||
import nl.chimpgamer.networkmanager.api.models.permissions.Group;
|
import nl.chimpgamer.networkmanager.api.models.permissions.Group;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -41,6 +65,8 @@ public class DeopCommand extends Commander
|
|||||||
@Subcommand(permission = "cladis.deop", args = {Player.class})
|
@Subcommand(permission = "cladis.deop", args = {Player.class})
|
||||||
public void deop(final CommandSender sender, final Player player)
|
public void deop(final CommandSender sender, final Player player)
|
||||||
{
|
{
|
||||||
|
final UUID playerUUID = player.getUniqueId();
|
||||||
|
|
||||||
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
||||||
final Group opGroup = nmLink.deopGroup();
|
final Group opGroup = nmLink.deopGroup();
|
||||||
|
|
||||||
@ -50,13 +76,13 @@ public class DeopCommand extends Commander
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nmLink.isDeop(player.getUniqueId()))
|
if (nmLink.isDeop(playerUUID))
|
||||||
{
|
{
|
||||||
sender.sendPlainMessage("Player is not op.");
|
sender.sendPlainMessage("Player is not op.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nmLink.getPlayerGroups(player.getUniqueId()).remove(opGroup);
|
nmLink.getPlayerGroups(playerUUID).remove(opGroup);
|
||||||
|
|
||||||
sender.sendPlainMessage("Player deopped.");
|
sender.sendPlainMessage("Player deopped.");
|
||||||
player.sendPlainMessage("You have been deopped!");
|
player.sendPlainMessage("You have been deopped!");
|
||||||
|
@ -1,3 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Freedom-Network-Suite - https://github.com/AtlasMediaGroup/Freedom-Network-Suite
|
||||||
|
* Copyright (C) 2023 Total Freedom Server Network and contributors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
package fns.cladis.command;
|
package fns.cladis.command;
|
||||||
|
|
||||||
import fns.cladis.Cladis;
|
import fns.cladis.Cladis;
|
||||||
@ -10,6 +33,7 @@ import fns.patchwork.command.annotation.Info;
|
|||||||
import fns.patchwork.command.annotation.Permissive;
|
import fns.patchwork.command.annotation.Permissive;
|
||||||
import fns.patchwork.command.annotation.Subcommand;
|
import fns.patchwork.command.annotation.Subcommand;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
import nl.chimpgamer.networkmanager.api.models.permissions.Group;
|
import nl.chimpgamer.networkmanager.api.models.permissions.Group;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -119,9 +143,10 @@ public class ModStaffCommand extends Commander
|
|||||||
@Subcommand(permission = "cladis.modstaff.modify", args = {String.class, Player.class, String.class})
|
@Subcommand(permission = "cladis.modstaff.modify", args = {String.class, Player.class, String.class})
|
||||||
public void modify(final CommandSender sender, final String arg, final Player target, final String group)
|
public void modify(final CommandSender sender, final String arg, final Player target, final String group)
|
||||||
{
|
{
|
||||||
|
final UUID playerUUID = target.getUniqueId();
|
||||||
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
||||||
final nl.chimpgamer.networkmanager.api.models.player.Player nmPlayer =
|
final nl.chimpgamer.networkmanager.api.models.player.Player nmPlayer =
|
||||||
nmLink.getPlayer(target.getUniqueId()).orElse(null);
|
nmLink.getPlayer(playerUUID).orElse(null);
|
||||||
|
|
||||||
if (nmPlayer == null)
|
if (nmPlayer == null)
|
||||||
{
|
{
|
||||||
@ -139,7 +164,7 @@ public class ModStaffCommand extends Commander
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sender instanceof Player player && (nmLink.getPermissionsPlayer(player.getUniqueId())
|
if (sender instanceof Player s && (nmLink.getPermissionsPlayer(s.getUniqueId())
|
||||||
.getPrimaryGroup()
|
.getPrimaryGroup()
|
||||||
.getId() <= g.getKey()))
|
.getId() <= g.getKey()))
|
||||||
{
|
{
|
||||||
@ -149,12 +174,12 @@ public class ModStaffCommand extends Commander
|
|||||||
|
|
||||||
if (arg.equalsIgnoreCase("add"))
|
if (arg.equalsIgnoreCase("add"))
|
||||||
{
|
{
|
||||||
nmLink.getPermissionsPlayer(target.getUniqueId()).getGroups().add(g.getValue());
|
nmLink.getPlayerGroups(playerUUID).add(g.getValue());
|
||||||
sender.sendPlainMessage("Added " + target.getName() + " to " + group);
|
sender.sendPlainMessage("Added " + target.getName() + " to " + group);
|
||||||
}
|
}
|
||||||
else if (arg.equalsIgnoreCase("remove"))
|
else if (arg.equalsIgnoreCase("remove"))
|
||||||
{
|
{
|
||||||
nmLink.getPermissionsPlayer(target.getUniqueId()).getGroups().remove(g.getValue());
|
nmLink.getPlayerGroups(playerUUID).remove(g.getValue());
|
||||||
sender.sendPlainMessage("Removed " + target.getName() + " from " + group);
|
sender.sendPlainMessage("Removed " + target.getName() + " from " + group);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -166,9 +191,10 @@ public class ModStaffCommand extends Commander
|
|||||||
@Subcommand(permission = "cladis.modstaff.track", args = {String.class, Player.class})
|
@Subcommand(permission = "cladis.modstaff.track", args = {String.class, Player.class})
|
||||||
public void track(final CommandSender sender, final String arg, final Player target)
|
public void track(final CommandSender sender, final String arg, final Player target)
|
||||||
{
|
{
|
||||||
|
final UUID playerUUID = target.getUniqueId();
|
||||||
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
||||||
final nl.chimpgamer.networkmanager.api.models.player.Player nmPlayer =
|
final nl.chimpgamer.networkmanager.api.models.player.Player nmPlayer =
|
||||||
nmLink.getPlayer(target.getUniqueId()).orElse(null);
|
nmLink.getPlayer(playerUUID).orElse(null);
|
||||||
|
|
||||||
if (nmPlayer == null)
|
if (nmPlayer == null)
|
||||||
{
|
{
|
||||||
@ -176,7 +202,7 @@ public class ModStaffCommand extends Commander
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Group primary = nmLink.getPermissionsPlayer(target.getUniqueId()).getPrimaryGroup();
|
final Group primary = nmLink.getPermissionsPlayer(playerUUID).getPrimaryGroup();
|
||||||
final int groupLevel = primary.getId();
|
final int groupLevel = primary.getId();
|
||||||
|
|
||||||
if (arg.equalsIgnoreCase("promote"))
|
if (arg.equalsIgnoreCase("promote"))
|
||||||
@ -188,10 +214,8 @@ public class ModStaffCommand extends Commander
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nmLink.getPermissionsPlayer(target.getUniqueId()).getGroups().remove(primary);
|
nmLink.getPlayerGroups(playerUUID).remove(primary);
|
||||||
nmLink.getPermissionsPlayer(target.getUniqueId())
|
nmLink.getPlayerGroups(playerUUID).add(promo);
|
||||||
.getGroups()
|
|
||||||
.add(promo);
|
|
||||||
sender.sendPlainMessage("Promoted " + target.getName());
|
sender.sendPlainMessage("Promoted " + target.getName());
|
||||||
}
|
}
|
||||||
else if (arg.equalsIgnoreCase("demote"))
|
else if (arg.equalsIgnoreCase("demote"))
|
||||||
@ -203,10 +227,8 @@ public class ModStaffCommand extends Commander
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nmLink.getPermissionsPlayer(target.getUniqueId()).getGroups().remove(primary);
|
nmLink.getPlayerGroups(playerUUID).remove(primary);
|
||||||
nmLink.getPermissionsPlayer(target.getUniqueId())
|
nmLink.getPlayerGroups(playerUUID).add(demo);
|
||||||
.getGroups()
|
|
||||||
.add(demo);
|
|
||||||
sender.sendPlainMessage("Demoted " + target.getName());
|
sender.sendPlainMessage("Demoted " + target.getName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,3 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Freedom-Network-Suite - https://github.com/AtlasMediaGroup/Freedom-Network-Suite
|
||||||
|
* Copyright (C) 2023 Total Freedom Server Network and contributors
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
package fns.cladis.command;
|
package fns.cladis.command;
|
||||||
|
|
||||||
|
|
||||||
@ -9,6 +32,7 @@ import fns.patchwork.command.annotation.Completion;
|
|||||||
import fns.patchwork.command.annotation.Info;
|
import fns.patchwork.command.annotation.Info;
|
||||||
import fns.patchwork.command.annotation.Permissive;
|
import fns.patchwork.command.annotation.Permissive;
|
||||||
import fns.patchwork.command.annotation.Subcommand;
|
import fns.patchwork.command.annotation.Subcommand;
|
||||||
|
import java.util.UUID;
|
||||||
import nl.chimpgamer.networkmanager.api.models.permissions.Group;
|
import nl.chimpgamer.networkmanager.api.models.permissions.Group;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -43,6 +67,7 @@ public class OpCommand extends Commander
|
|||||||
{
|
{
|
||||||
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
final NMLink nmLink = Shortcuts.provideModule(Cladis.class).getNMLink();
|
||||||
final Group opGroup = nmLink.locateGroup("fake_op").orElse(null);
|
final Group opGroup = nmLink.locateGroup("fake_op").orElse(null);
|
||||||
|
final UUID playerUUID = player.getUniqueId();
|
||||||
|
|
||||||
if (opGroup == null)
|
if (opGroup == null)
|
||||||
{
|
{
|
||||||
@ -50,14 +75,14 @@ public class OpCommand extends Commander
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nmLink.isOp(player.getUniqueId()))
|
if (nmLink.isOp(playerUUID))
|
||||||
{
|
{
|
||||||
sender.sendPlainMessage("Player is already op.");
|
sender.sendPlainMessage("Player is already op.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nmLink.getPermissionsPlayer(player.getUniqueId()).getGroups().add(opGroup);
|
nmLink.getPlayerGroups(playerUUID).add(opGroup);
|
||||||
|
|
||||||
sender.sendPlainMessage("You have opped " + player.getName() + ".");
|
sender.sendPlainMessage("You have opped " + player.getName() + ".");
|
||||||
player.sendPlainMessage("You have been opped.");
|
player.sendPlainMessage("You have been opped.");
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
package fns.datura;
|
package fns.datura;
|
||||||
|
|
||||||
|
import fns.datura.cmd.LockerCommand;
|
||||||
import fns.datura.features.CommandSpy;
|
import fns.datura.features.CommandSpy;
|
||||||
import fns.datura.features.Fuckoff;
|
import fns.datura.features.Fuckoff;
|
||||||
import fns.datura.punishment.Cager;
|
import fns.datura.punishment.Cager;
|
||||||
@ -30,6 +31,7 @@ import fns.datura.punishment.Halter;
|
|||||||
import fns.datura.punishment.Locker;
|
import fns.datura.punishment.Locker;
|
||||||
import fns.datura.sql.MySQL;
|
import fns.datura.sql.MySQL;
|
||||||
import fns.patchwork.base.Registration;
|
import fns.patchwork.base.Registration;
|
||||||
|
import fns.patchwork.command.CommandHandler;
|
||||||
import fns.patchwork.service.SubscriptionProvider;
|
import fns.patchwork.service.SubscriptionProvider;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@ -64,6 +66,8 @@ public class Datura extends JavaPlugin
|
|||||||
Bukkit.getPluginManager()
|
Bukkit.getPluginManager()
|
||||||
.registerEvents(commandSpy, this);
|
.registerEvents(commandSpy, this);
|
||||||
|
|
||||||
|
new CommandHandler(this).registerCommands(LockerCommand.class);
|
||||||
|
|
||||||
Registration.getModuleRegistry()
|
Registration.getModuleRegistry()
|
||||||
.addModule(this);
|
.addModule(this);
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,10 @@
|
|||||||
|
|
||||||
package fns.fossil;
|
package fns.fossil;
|
||||||
|
|
||||||
|
import fns.fossil.cmd.CakeCommand;
|
||||||
import fns.fossil.trail.Trailer;
|
import fns.fossil.trail.Trailer;
|
||||||
import fns.patchwork.base.Registration;
|
import fns.patchwork.base.Registration;
|
||||||
|
import fns.patchwork.command.CommandHandler;
|
||||||
import fns.patchwork.service.SubscriptionProvider;
|
import fns.patchwork.service.SubscriptionProvider;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@ -38,6 +40,8 @@ public class Fossil extends JavaPlugin
|
|||||||
.registerService(
|
.registerService(
|
||||||
SubscriptionProvider.syncService(this, trailer));
|
SubscriptionProvider.syncService(this, trailer));
|
||||||
|
|
||||||
|
new CommandHandler(this).registerCommands(CakeCommand.class);
|
||||||
|
|
||||||
Registration.getModuleRegistry()
|
Registration.getModuleRegistry()
|
||||||
.addModule(this);
|
.addModule(this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user