Archived
0

Merge pull request #33 from RedstonerServer/updated

Cleaned Up
This commit is contained in:
Minenash
2018-11-07 17:02:47 -05:00
committed by GitHub
52 changed files with 672 additions and 1762 deletions

View File

@@ -0,0 +1,7 @@
command abot {
reload {
help Reloads answers from the .json file.;
run abot_reload;
perm utils.abot.reload;
}
}

View File

@@ -19,9 +19,9 @@ import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Abot implements Module, Listener
{
private File answerFile = new File(Main.plugin.getDataFolder(), "abot.json");
@@ -65,18 +65,4 @@ public class Abot implements Module, Listener
loadAnswers(Bukkit.getConsoleSender());
return true;
}
// @noformat
@Override
public String getCommandString()
{
return "command abot {\n" +
" reload {" +
" help Reloads answers from the .json file.;\n" +
" run abot_reload;\n" +
" perm utils.abot.reload;" +
" }\n" +
"}";
}
// format
}

View File

@@ -0,0 +1,42 @@
command ac {
[string:message...] {
help Sends a message in Admin Chat;
perm utils.ac;
run ac_msg message;
}
}
command acn {
[string:name] [string:message...] {
help Sends a message in Admin Chat;
perm utils.ac;
type console;
run acn_msg name message;
}
}
command ackey {
[string:key] {
help Sets your Admin Chat key;
perm utils.ac;
type player;
run setackey key;
}
}
command act {
on {
help Turns on act;
perm utils.ac;
run act_on;
}
off {
help Turns off act;
perm utils.ac;
run act_off;
}
[empty] {
help toggles Admin Chat;
perm utils.ac;
run act;
}
}

View File

@@ -28,9 +28,9 @@ import net.nemez.chatapi.ChatAPI;
/** AdminChat module. Allows staff to chat to other staff using /ac \<message\> as well as a one char prefix or a toggle.
*
* @author Pepich */
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Adminchat implements Module, Listener
{
private static final char defaultKey = ',';
@@ -51,55 +51,6 @@ public class Adminchat implements Module, Listener
return true;
}
// @noformat
@Override
public String getCommandString()
{
return "command ac {\n" +
" [string:message...] {\n" +
" help Sends a message in Admin Chat;\n" +
" perm utils.ac;\n" +
" run ac_msg message;\n" +
" }\n" +
"}\n" +
"command acn {\n" +
" [string:name] [string:message...] {\n" +
" help Sends a message in Admin Chat;\n" +
" perm utils.ac;\n" +
" type console;\n" +
" run acn_msg name message;\n" +
" }\n" +
"}\n" +
" \n" +
"command ackey {\n" +
" [string:key] {\n" +
" help Sets your Admin Chat key;\n" +
" perm utils.ac;\n" +
" type player;\n" +
" run setackey key;\n" +
" }\n" +
"}\n" +
"\n" +
"command act {\n" +
" on {\n" +
" help Turns on act;\n" +
" perm utils.ac;\n" +
" run act_on;\n" +
" }\n" +
" off {\n" +
" help Turns off act;\n" +
" perm utils.ac;\n" +
" run act_off;\n" +
" }\n" +
" [empty] {\n" +
" help toggles Admin Chat;\n" +
" perm utils.ac;\n" +
" run act;\n" +
" }\n" +
"}";
}
// @format
@Command(hook = "ac_msg")
public boolean acSay(CommandSender sender, String message)
{

View File

@@ -1,216 +0,0 @@
package com.redstoner.modules.adminnotes;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.json.simple.JSONArray;
import com.nemez.cmdmgr.Command;
import com.redstoner.annotations.AutoRegisterListener;
import com.redstoner.annotations.Commands;
import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.modules.Module;
import de.pepich.chestapi.CallbackHandler;
import de.pepich.chestapi.ClickableInventory;
import de.pepich.chestapi.DefaultSize;
import net.nemez.chatapi.click.ClickCallback;
import net.nemez.chatapi.click.Message;
@Commands(CommandHolderType.String)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
public class AdminNotes implements Module, Listener
{
JSONArray notes;
File saveFile = new File(Main.plugin.getDataFolder(), "adminnotes.json");
@Override
public boolean onEnable()
{
notes = JsonManager.getArray(saveFile);
if (notes == null)
notes = new JSONArray();
return true;
}
@EventHandler
public void onJoin(PlayerJoinEvent e)
{
if (e.getPlayer().hasPermission("utils.adminnotes"))
if (notes.size() > 0)
{
Message m = new Message(e.getPlayer(), null);
m.appendSendChat(getLogger().getPrefix(), "/an list");
m.appendSendChat("&cThere are " + notes.size() + " open notes!", "/an list");
m.send();
}
}
@Override
public void onDisable()
{
saveNotes();
}
@SuppressWarnings("unchecked")
@Command(hook = "an_create")
public void createNote(CommandSender sender, String note)
{
JSONArray temp = new JSONArray();
temp.add(sender.getName());
temp.add(note);
temp.add((double) System.currentTimeMillis() / 1000);
notes.add(temp);
getLogger().message(sender, "&aNote added!");
saveNotes();
}
@Command(hook = "an_del")
public void delNote(CommandSender sender, int id)
{
if (id < notes.size() && id >= 0 && notes.get(id) != null)
{
notes.remove(id);
getLogger().message(sender, "&aNote " + id + " has been removed!");
saveNotes();
}
else
{
getLogger().message(sender, "&cThat note does not exist!");
}
}
@Command(hook = "an_list")
public void list(CommandSender sender)
{
Message m = new Message(sender, null);
m.appendText(getLogger().getHeader());
for (Object note : notes)
{
String string = ChatColor.YELLOW + "" + notes.indexOf(note) + ": ";
string += "§a" + ((JSONArray) note).get(1);
string += "\n§e - " + ((JSONArray) note).get(0) + ", §6";
SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy HH:mm");
string += format.format((double) ((JSONArray) note).get(2) * 1000);
m.appendCallbackHover(string, new ClickCallback(true, true, null)
{
@Override
public void run(CommandSender sender)
{
if (notes.contains(note))
showMenu((Player) sender, notes.indexOf(note));
else
getLogger().message(sender, true, "That note no longer exists!");
}
}, "Click to show note options.");
m.appendText("\n");
}
m.send();
}
public void showMenu(Player player, int index)
{
String note_text = ((String) ((JSONArray) notes.get(index)).get(1));
if (note_text.length() > 15)
note_text = note_text.substring(0, 15) + "...";
ClickableInventory inv = new ClickableInventory("Note " + index + ": " + note_text, DefaultSize.FINAL_FIXED(9));
ItemStack addItem = new ItemStack(Material.BOOK_AND_QUILL);
ItemMeta addMeta = addItem.getItemMeta();
addMeta.setDisplayName("§aAdd note!");
addItem.setItemMeta(addMeta);
inv.set(1, addItem, new CallbackHandler()
{
@Override
public void run(Player player, ClickType type)
{
Message m = new Message(player, null);
m.appendSuggest(getLogger().getPrefix(), "/an add ");
m.appendSuggest("Click me to add a note!", "/an add ");
m.send();
player.closeInventory();
}
});
ItemStack deleteItem = new ItemStack(Material.WOOL, 1, (short) 14);
ItemMeta deleteMeta = deleteItem.getItemMeta();
deleteMeta.setDisplayName("§cDelete note!");
deleteMeta.setLore(Arrays.asList(new String[] {"Shift click to execute!"}));
deleteItem.setItemMeta(deleteMeta);
inv.set(3, deleteItem, new CallbackHandler()
{
@Override
public void run(Player player, ClickType type)
{
if (type == ClickType.SHIFT_LEFT)
{
delNote(player, index);
player.closeInventory();
}
else
getLogger().message(player, true, "You need to shift click to execute this!");
}
});
ItemStack closeItem = new ItemStack(Material.BARRIER);
ItemMeta closeMeta = closeItem.getItemMeta();
closeMeta.setDisplayName("§eClose menu");
closeItem.setItemMeta(closeMeta);
inv.set(9, closeItem, new CallbackHandler()
{
@Override
public void run(Player player, ClickType type)
{
player.closeInventory();
}
});
inv.show(player);
}
public void saveNotes()
{
JsonManager.save(notes, saveFile);
}
// @noformat
@Override
public String getCommandString()
{
return "command an {\n" +
" \n" +
" add [string:note...] {\n" +
" help Creates a new admin note;\n" +
" run an_create note;\n" +
" perm utils.an;" +
" }\n" +
" \n" +
" del [int:id] {\n" +
" help Deletes an admin note;\n" +
" run an_del id;\n" +
" perm utils.an;" +
" }\n" +
" \n" +
" list {\n" +
" help Lists all notes;\n" +
" run an_list;\n" +
" perm utils.an;" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,42 @@
command bc {
[string:message...] {
help Sends a message in BuildTeam Chat;
perm utils.bc;
run bc_msg message;
}
}
command bcn {
[string:name] [string:message...] {
help Sends a message in BuildTeam Chat;
perm utils.bc;
type console;
run bcn_msg name message;
}
}
command bckey {
[string:key] {
help Sets your BuildTeam Chat key;
perm utils.bc;
type player;
run setbckey key;
}
}
command bct {
on {
help Turns on bct;
perm utils.bc;
run bct_on;
}
off {
help Turns off bct;
perm utils.bc;
run bct_off;
}
[empty] {
help toggles BuildTeam Chat;
perm utils.bc;
run bct;
}
}

View File

@@ -26,9 +26,9 @@ import com.redstoner.modules.Module;
/** BuildTeamChat module. Allows the build team to chat privately using /bc \<message\> as well as a one char prefix or a toggle.
*
* @author Pepich */
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class BuildChat implements Module, Listener
{
private static final char defaultKey = ';';
@@ -49,55 +49,6 @@ public class BuildChat implements Module, Listener
return true;
}
// @noformat
@Override
public String getCommandString()
{
return "command bc {\n" +
" [string:message...] {\n" +
" help Sends a message in BuildTeam Chat;\n" +
" perm utils.bc;\n" +
" run bc_msg message;\n" +
" }\n" +
"}\n" +
"command bcn {\n" +
" [string:name] [string:message...] {\n" +
" help Sends a message in BuildTeam Chat;\n" +
" perm utils.bc;\n" +
" type console;\n" +
" run bcn_msg name message;\n" +
" }\n" +
"}\n" +
" \n" +
"command bckey {\n" +
" [string:key] {\n" +
" help Sets your BuildTeam Chat key;\n" +
" perm utils.bc;\n" +
" type player;\n" +
" run setbckey key;\n" +
" }\n" +
"}\n" +
"\n" +
"command bct {\n" +
" on {\n" +
" help Turns on bct;\n" +
" perm utils.bc;\n" +
" run bct_on;\n" +
" }\n" +
" off {\n" +
" help Turns off bct;\n" +
" perm utils.bc;\n" +
" run bct_off;\n" +
" }\n" +
" [empty] {\n" +
" help toggles BuildTeam Chat;\n" +
" perm utils.bc;\n" +
" run bct;\n" +
" }\n" +
"}";
}
// @format
@Command(hook = "bc_msg")
public boolean bcSay(CommandSender sender, String message)
{

View File

@@ -0,0 +1,16 @@
command alias {
add [flag:-r] [string:keyword] [string:replacement...] {
help Adds a new alias. Set -r to make it a regex-alias.;
run addalias -r keyword replacement;
}
del [flag:-r] [string:keyword] {
help Deletes an alias. -r indicates if it was a regex-alias.;
run delalias -r keyword;
}
list {
help Lists your aliases.;
run listaliases;
}
perm utils.alias;
type player;
}

View File

@@ -30,9 +30,9 @@ import com.redstoner.modules.Module;
import net.nemez.chatapi.ChatAPI;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 3, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Chatalias implements Module, Listener
{
private final String[] commands = new String[] {"e?r", "e?m .+?", "e?t", "e?w", "e?msg .+?", "e?message .+?",
@@ -314,27 +314,4 @@ public class Chatalias implements Module, Listener
temp.put("data", aliases.get(uuid.toString()));
JsonManager.save(temp, new File(Main.plugin.getDataFolder(), "aliases/" + uuid.toString() + ".json"));
}
// @noformat
@Override
public String getCommandString()
{
return "command alias {\n" +
" add [flag:-r] [string:keyword] [string:replacement...] {\n" +
" help Adds a new alias. Set -r to make it a regex-alias.;\n" +
" run addalias -r keyword replacement;\n" +
" }\n" +
" del [flag:-r] [string:keyword] {\n" +
" help Deletes an alias. -r indicates if it was a regex-alias.;\n" +
" run delalias -r keyword;\n" +
" }\n" +
" list {\n" +
" help Lists your aliases.;\n" +
" run listaliases;\n" +
" }\n" +
" perm utils.alias;\n" +
" type player;\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,35 @@
command cgt {
[empty] {
help Toggles your cgtoggle status.;
type player;
run cgtoggle;
}
}
command cgkey {
[string:key] {
help Sets your chatgroup key.;
run setcgkey key;
type player;
}
}
command cgsay {
[string:message...] {
help Chats in your chatgroup.;
run cgsay message;
}
}
command cg {
join [string:group] {
help Joins a chatgroup.;
run cgjoin group;
}
leave {
help Leaves your chatgroup.;
run cgleave;
}
info {
help Displays info about your chatgroup.;
run cginfo;
}
}

View File

@@ -32,9 +32,9 @@ import net.nemez.chatapi.ChatAPI;
/** The ChatGroups module. Allows people to have private sub-chats that can be accessed via a single char prefix or a toggle.
*
* @author Pepich */
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 2, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Chatgroups implements Module, Listener
{
private static final char defaultKey = ':';
@@ -69,48 +69,6 @@ public class Chatgroups implements Module, Listener
saveGroups();
}
// @noformat
@Override
public String getCommandString()
{
return "command cgt {\n" +
" [empty] {\n" +
" help Toggles your cgtoggle status.;\n"+
" type player;\n" +
" run cgtoggle;\n" +
" }\n" +
"}\n" +
"command cgkey {\n" +
" [string:key] {\n" +
" help Sets your chatgroup key.;\n" +
" run setcgkey key;\n" +
" type player;\n" +
" }\n" +
"}\n" +
"command cgsay {\n" +
" [string:message...] {\n" +
" help Chats in your chatgroup.;\n"+
" run cgsay message;\n" +
" }\n" +
"}\n" +
"command cg {\n" +
" join [string:group] {\n" +
" help Joins a chatgroup.;\n" +
" run cgjoin group;\n" +
" }\n" +
" leave {\n" +
" help Leaves your chatgroup.;\n" +
" run cgleave;\n" +
" }\n" +
" info {\n" +
" help Displays info about your chatgroup.;\n" +
" run cginfo;\n" +
" }\n" +
"}";
}
// @format
/** Prints chatgroup info (like players in the group, groupname) to the sender.
*
* @param sender the issuer of the command.

View File

@@ -0,0 +1,8 @@
command check {
perm utils.check;
[string:player] {
run checkCommand player;
help Get info on a player;
}
}

View File

@@ -22,8 +22,10 @@ import org.json.simple.parser.JSONParser;
import com.nemez.cmdmgr.Command;
import com.nemez.cmdmgr.Command.AsyncType;
import com.nemez.cmdmgr.CommandManager;
import com.redstoner.annotations.Commands;
import com.redstoner.annotations.Version;
import com.redstoner.coremods.moduleLoader.ModuleLoader;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.Main;
import com.redstoner.misc.mysql.JSONManager;
import com.redstoner.misc.mysql.MysqlHandler;
@@ -35,7 +37,8 @@ import com.redstoner.modules.Module;
import net.nemez.chatapi.click.Message;
@Version(major = 4, minor = 0, revision = 3, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Check implements Module, Listener
{
MysqlTable table;
@@ -241,19 +244,4 @@ public class Check implements Module, Listener
e.printStackTrace();
}
}
// @noformat
@Override
public String getCommandString()
{
return "command check {\n" +
" perm utils.check;\n" +
" \n" +
" [string:player] {\n" +
" run checkCommand player;\n" +
" help Get info on a player;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,13 @@
command clear{
[empty] {
help Clears your inventory;
type player;
perm utils.clear;
run clear;
}
[string:player] {
help Clears someone elses inventory;
perm utils.admin.clear;
run clearother player;
}
}

View File

@@ -11,8 +11,8 @@ import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Clear implements Module
{
@Command(hook = "clear")
@@ -41,24 +41,4 @@ public class Clear implements Module
}
return true;
}
// @noformat
@Override
public String getCommandString()
{
return "command clear{\n" +
" [empty] {\n" +
" help Clears your inventory;\n" +
" type player;\n" +
" perm utils.clear;\n" +
" run clear;\n" +
" }\n" +
" [string:player] {\n" +
" help Clears someone elses inventory;\n" +
" perm utils.admin.clear;\n" +
" run clearother player;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,12 @@
command cycle {
on {
help Turns on cycle;
type player;
run cycle_on;
}
off {
help Turns off cycle;
type player;
run cycle_off;
}
}

View File

@@ -22,9 +22,9 @@ import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Cycle implements Module, Listener
{
private File cycleFile = new File(Main.plugin.getDataFolder(), "cycle.json");
@@ -139,23 +139,4 @@ public class Cycle implements Module, Listener
result[i + offset] = items2[i];
return result;
}
// @noformat
@Override
public String getCommandString()
{
return "command cycle {\n" +
" on {\n" +
" help Turns on cycle;\n" +
" type player;\n" +
" run cycle_on;\n" +
" }\n" +
" off {\n" +
" help Turns off cycle;\n" +
" type player;\n" +
" run cycle_off;\n" +
" }\n" +
"}";
}
// format
}

View File

@@ -0,0 +1,15 @@
command damnspam {
perm utils.damnspam;
[double:seconds] {
run damnspamSingle seconds;
help Set single input cooldown for button or lever.;
type player;
}
[double:secondsOff] [double:secondsOn] {
run damnspamDouble secondsOff secondsOn;
help Set input cooldown after it's been turned off and turned on (for lever only).;
type player;
}
}

View File

@@ -37,9 +37,9 @@ import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.Main;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class DamnSpam implements Module, Listener
{
File configFile = new File(Main.plugin.getDataFolder(), "DamnSpam.json");
@@ -346,26 +346,4 @@ public class DamnSpam implements Module, Listener
}
}
}
// @noformat
@Override
public String getCommandString()
{
return "command damnspam {\n" +
" perm utils.damnspam;\n" +
" \n" +
" [double:seconds] {\n" +
" run damnspamSingle seconds;\n" +
" help Set single input cooldown for button or lever.;\n" +
" type player;\n" +
" }\n" +
" \n" +
" [double:secondsOff] [double:secondsOn] {\n" +
" run damnspamDouble secondsOff secondsOn;\n" +
" help Set input cooldown after it's been turned off and turned on (for lever only).;\n" +
" type player;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -18,26 +18,21 @@ import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import com.nemez.cmdmgr.Command;
import com.nemez.cmdmgr.CommandManager;
import com.redstoner.annotations.AutoRegisterListener;
import com.redstoner.annotations.Commands;
import com.redstoner.annotations.Version;
import com.redstoner.coremods.moduleLoader.ModuleLoader;
import com.redstoner.misc.Main;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.Utils;
import com.redstoner.modules.CoreModule;
import com.redstoner.modules.Module;
import com.redstoner.modules.datamanager.DataManager;
@AutoRegisterListener
@Version(major = 3, minor = 0, revision = 1, compatible = 3)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
public class Friends implements CoreModule
{
@Override
public void postEnable()
{
CommandManager.registerCommand(getClass().getResourceAsStream("Friends.cmd"), this, Main.plugin);
}
{
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerJoin(PlayerJoinEvent e)
{
@@ -48,14 +43,14 @@ public class Friends implements CoreModule
Player p = Bukkit.getPlayer(uuid);
if (p != null && p.canSee(e.getPlayer()))
{
Utils.sendMessage(p, null, "Your friend &e" + e.getPlayer().getDisplayName() + "&7 just joined!", '&');
getLogger().message(p, "Your friend &e" + e.getPlayer().getDisplayName() + "&7 just joined!");
p.playSound(p.getLocation(), Sound.ENTITY_CHICKEN_EGG, 1, 1);
}
}
JSONArray notifications = (JSONArray) DataManager.getOrDefault(e.getPlayer(), "scheduled_notifications",
new JSONArray());
for (Object obj : notifications)
Utils.sendMessage(e.getPlayer(), null, (String) obj, '&');
getLogger().message(e.getPlayer(), (String) obj);
}
@EventHandler(priority = EventPriority.MONITOR)
@@ -68,7 +63,7 @@ public class Friends implements CoreModule
Player p = Bukkit.getPlayer(uuid);
if (p != null && p.canSee(e.getPlayer()))
{
Utils.sendMessage(p, null, "Your friend &e" + e.getPlayer().getDisplayName() + "&7 just left!", '&');
getLogger().message(p, "Your friend &e" + e.getPlayer().getDisplayName() + "&7 just left!");
p.playSound(p.getLocation(), Sound.ENTITY_CHICKEN_EGG, 1, 1);
}
}
@@ -80,7 +75,7 @@ public class Friends implements CoreModule
{
if (target.equalsIgnoreCase("CONSOLE"))
{
Utils.sendErrorMessage(sender, null, "You can't add console to your friends!");
getLogger().message(sender, true, "You can't add console to your friends!");
return true;
}
OfflinePlayer p = Bukkit.getPlayer(target);
@@ -88,13 +83,13 @@ public class Friends implements CoreModule
p = Bukkit.getOfflinePlayer(target);
if (p == null)
{
Utils.sendErrorMessage(sender, null, "That player couldn't be found!");
getLogger().message(sender, true, "That player couldn't be found!");
return true;
}
JSONArray friends = ((JSONArray) DataManager.getOrDefault(sender, "friends", new JSONArray()));
if (friends.contains(p.getUniqueId().toString()))
{
Utils.sendErrorMessage(sender, null, "You are already friends with this person!");
getLogger().message(sender, true, "You are already friends with this person!");
return true;
}
friends.add(p.getUniqueId().toString());
@@ -103,10 +98,10 @@ public class Friends implements CoreModule
new JSONArray()));
friended_by.add(getID(sender));
DataManager.save(p.getUniqueId().toString());
Utils.sendMessage(sender, null, "You are now friends with &e" + p.getName() + "&7!", '&');
getLogger().message(sender, "You are now friends with &e" + p.getName() + "&7!");
if (p instanceof Player)
{
Utils.sendMessage((Player) p, null, "&e" + Utils.getName(sender) + "&7 added you as a friend!", '&');
getLogger().message((Player) p, "&e" + Utils.getName(sender) + "&7 added you as a friend!");
}
else
{
@@ -125,7 +120,7 @@ public class Friends implements CoreModule
{
if (target.equalsIgnoreCase("CONSOLE"))
{
Utils.sendErrorMessage(sender, null, "You can't add console to your friends!");
getLogger().message(sender, true, "You can't add console to your friends!");
return true;
}
OfflinePlayer p = Bukkit.getPlayer(target);
@@ -133,22 +128,22 @@ public class Friends implements CoreModule
p = Bukkit.getOfflinePlayer(target);
if (p == null)
{
Utils.sendErrorMessage(sender, null, "That player couldn't be found!");
getLogger().message(sender, true, "That player couldn't be found!");
return true;
}
JSONArray friends = ((JSONArray) DataManager.getOrDefault(sender, "groups." + group, new JSONArray()));
if (friends.contains(p.getUniqueId().toString()))
{
Utils.sendErrorMessage(sender, null, "This person already is part of that friendsgroup!");
getLogger().message(sender, true, "This person already is part of that friendsgroup!");
return true;
}
friends.add(p.getUniqueId().toString());
DataManager.save(sender);
Utils.sendMessage(sender, null, "&e" + p.getName() + "&7 is now part of the group &e" + group + "&7!", '&');
getLogger().message(sender, "&e" + p.getName() + "&7 is now part of the group &e" + group + "&7!");
if (p instanceof Player)
{
Utils.sendMessage((Player) p, null,
"&e" + Utils.getName(sender) + " &7added you to their friendsgroup &e" + group + "&7!", '&');
getLogger().message((Player) p,
"&e" + Utils.getName(sender) + " &7added you to their friendsgroup &e" + group + "&7!");
}
else
{
@@ -168,7 +163,7 @@ public class Friends implements CoreModule
{
if (target.equalsIgnoreCase("CONSOLE"))
{
Utils.sendErrorMessage(sender, null, "You can't add console to your friends!");
getLogger().message(sender, true, "You can't add console to your friends!");
return true;
}
OfflinePlayer p = Bukkit.getPlayer(target);
@@ -176,13 +171,13 @@ public class Friends implements CoreModule
p = Bukkit.getOfflinePlayer(target);
if (p == null)
{
Utils.sendErrorMessage(sender, null, "That player couldn't be found!");
getLogger().message(sender, true, "That player couldn't be found!");
return true;
}
JSONArray friends = ((JSONArray) DataManager.getOrDefault(sender, "friends", new JSONArray()));
if (friends.contains(p.getUniqueId().toString()))
{
Utils.sendErrorMessage(sender, null, "You are already friends with this person!");
getLogger().message(sender, true, "You are already friends with this person!");
return true;
}
friends.remove(p.getUniqueId().toString());
@@ -191,10 +186,10 @@ public class Friends implements CoreModule
new JSONArray()));
friended_by.remove(getID(sender));
DataManager.save(p.getUniqueId().toString());
Utils.sendMessage(sender, null, "You are now friends with &e" + p.getName() + "&7!", '&');
getLogger().message(sender, "You are now friends with &e" + p.getName() + "&7!");
if (p instanceof Player)
{
Utils.sendMessage((Player) p, null, "&e" + Utils.getName(sender) + "&7 added you as a friend!", '&');
getLogger().message((Player) p, "&e" + Utils.getName(sender) + "&7 added you as a friend!");
}
else
{
@@ -213,7 +208,7 @@ public class Friends implements CoreModule
{
if (target.equalsIgnoreCase("CONSOLE"))
{
Utils.sendErrorMessage(sender, null, "You can't add console to your friends!");
getLogger().message(sender, true, "You can't add console to your friends!");
return true;
}
OfflinePlayer p = Bukkit.getPlayer(target);
@@ -221,22 +216,22 @@ public class Friends implements CoreModule
p = Bukkit.getOfflinePlayer(target);
if (p == null)
{
Utils.sendErrorMessage(sender, null, "That player couldn't be found!");
getLogger().message(sender, true, "That player couldn't be found!");
return true;
}
JSONArray friends = ((JSONArray) DataManager.getOrDefault(sender, "groups." + group, new JSONArray()));
if (friends.contains(p.getUniqueId().toString()))
{
Utils.sendErrorMessage(sender, null, "This person already is part of that friendsgroup!");
getLogger().message(sender, true, "This person already is part of that friendsgroup!");
return true;
}
friends.add(p.getUniqueId().toString());
DataManager.save(sender);
Utils.sendMessage(sender, null, "&e" + p.getName() + "&7 is now part of the group &e" + group + "&7!", '&');
getLogger().message(sender, "&e" + p.getName() + "&7 is now part of the group &e" + group + "&7!");
if (p instanceof Player)
{
Utils.sendMessage((Player) p, null,
"&e" + Utils.getName(sender) + " &7added you to their friendsgroup &e" + group + "&7!", '&');
getLogger().message((Player) p,
"&e" + Utils.getName(sender) + " &7added you to their friendsgroup &e" + group + "&7!");
}
else
{
@@ -257,12 +252,10 @@ public class Friends implements CoreModule
JSONArray friends = (JSONArray) DataManager.getOrDefault(sender, "friends", new JSONArray());
if (friends.size() == 0)
{
Utils.sendErrorMessage(sender, null, "You didn't add anyone to your friendslist yet.");
getLogger().message(sender, true, "You didn't add anyone to your friendslist yet.");
}
else
{
Utils.sendModuleHeader(sender);
Utils.sendMessage(sender, "", "You have a total of &e" + friends.size() + "&7 friends:", '&');
StringBuilder sb = new StringBuilder();
for (Object o : friends.toArray())
{
@@ -274,7 +267,7 @@ public class Friends implements CoreModule
sb.append("&9" + Bukkit.getOfflinePlayer(id).getName() + "&7, ");
}
String out = sb.toString().replaceAll(", $", "");
Utils.sendMessage(sender, "", out, '&');
getLogger().message(sender, "You have a total of &e" + friends.size() + "&7 friends:", out);
}
return true;
}
@@ -285,13 +278,10 @@ public class Friends implements CoreModule
JSONArray friends = (JSONArray) DataManager.getOrDefault(sender, "group." + group, new JSONArray());
if (friends.size() == 0)
{
Utils.sendErrorMessage(sender, null, "You didn't add anyone to this group yet.");
getLogger().message(sender, true, "You didn't add anyone to this group yet.");
}
else
{
Utils.sendModuleHeader(sender);
Utils.sendMessage(sender, "", "You have a total of &e" + friends.size() + "&7 friends added to this group:",
'&');
StringBuilder sb = new StringBuilder();
for (Object o : friends.toArray())
{
@@ -303,7 +293,7 @@ public class Friends implements CoreModule
sb.append("&9" + Bukkit.getOfflinePlayer(id).getName() + "&7, ");
}
String out = sb.toString().replaceAll(", $", "");
Utils.sendMessage(sender, "", out, '&');
getLogger().message(sender, "You have a total of &e" + friends.size() + "&7 friends added to this group:", out);
}
return true;
}
@@ -315,19 +305,18 @@ public class Friends implements CoreModule
Set<?> keys = raw.keySet();
if (keys.size() == 0 || (keys.contains("friends") && keys.size() == 1))
{
Utils.sendErrorMessage(sender, null, "You don't have any custom groups made yet.");
getLogger().message(sender, true, "You don't have any custom groups made yet.");
return true;
}
else
{
Utils.sendModuleHeader(sender);
StringBuilder sb = new StringBuilder();
for (Object o : keys)
{
sb.append("&e" + (String) o + "&7, ");
}
String out = sb.toString().replaceAll(", $", "");
Utils.sendMessage(sender, "", out, '&');
getLogger().message(sender, "", out);
}
return true;
}

View File

@@ -1,50 +0,0 @@
package com.redstoner.modules.illumination;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import com.nemez.cmdmgr.Command;
import com.redstoner.annotations.Commands;
import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
public class Illumination implements Module
{
PotionEffect effect = new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false);
@Command(hook = "illuminate")
public void illuminate(CommandSender sender)
{
Player player = (Player) sender;
if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION))
{
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
getLogger().message(sender, "Night Vision Disabled.");
}
else
{
player.addPotionEffect(effect, true);
getLogger().message(sender, "Night Vision Enabled.");
}
}
// @noformat
@Override
public String getCommandString()
{
return "command nightvision {\n" +
" [empty] {\n" +
" run illuminate;\n" +
" type player;\n" +
" help Gives the player infinte night vision;\n" +
" perm utils.illuminate;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,19 @@
command lc {
perm utils.lagchunks;
list {
run list_cmd;
help re-lists already scanned chunks;
}
[int:amount] {
run scan_cmd amount;
help scans for laggy chunks;
}
tp [int:number] {
run tp number;
help teleports to the specified chunk;
type player;
}
}

View File

@@ -17,8 +17,8 @@ import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class LagChunks implements Module
{
private List<LaggyChunk> laggyChunks = new ArrayList<LaggyChunk>();
@@ -79,31 +79,4 @@ public class LagChunks implements Module
getLogger().message(sender, true, "§4Invalid chunk number! Use §e/lc list §4to show laggy chunks!");
}
}
// @noformat
@Override
public String getCommandString()
{
return "command lc {\n" +
" perm utils.lagchunks;\n" +
" \n" +
" list {\n" +
" run list_cmd;\n" +
" help re-lists already scanned chunks;\n" +
" }\n" +
" \n" +
" [int:amount] {\n" +
" run scan_cmd amount;\n" +
" help scans for laggy chunks;\n" +
" }\n" +
" \n" +
" tp [int:number] {\n" +
" run tp number;\n" +
" help teleports to the specified chunk;\n" +
" type player;\n" +
" }\n" +
"}\n" +
" ";
}
// @format
}

View File

@@ -0,0 +1,49 @@
command register {
perm utils.loginsecurity;
[string:password] {
run register password;
help Protects your account with a password;
type player;
}
}
command login {
perm utils.loginsecurity;
[string:password] {
run login password;
help Logs you in;
type player;
}
}
command cgpass {
perm utils.loginsecurity;
[string:oldPassword] [string:newPassword] {
run cgpass oldPassword newPassword;
help Changes your password to the specified one;
type player;
}
}
command rmpass {
perm utils.loginsecurity;
[string:oldPassword] {
run rmpass oldPassword;
help Removes the password of your account;
type player;
}
}
command rmotherpass {
perm utils.loginsecurity.admin;
[string:playerName] {
run rmotherpass playerName;
help removes the password of another player;
perm utils.loginsecurity.admin;
}
}

View File

@@ -34,9 +34,9 @@ import com.redstoner.misc.mysql.elements.MysqlTable;
import com.redstoner.misc.mysql.types.text.VarChar;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class LoginSecurity implements Module, Listener
{
protected static Map<UUID, Location> loggingIn;
@@ -260,60 +260,4 @@ public class LoginSecurity implements Module, Listener
String toInsert = "$pbkdf2-sha256$200000$" + salt + "$" + hash;
return table.insert(player.getUniqueId().toString(), toInsert);
}
// @noformat
@Override
public String getCommandString()
{
return "command register {\n" +
" perm utils.loginsecurity;\n" +
" \n" +
" [string:password] {\n" +
" run register password;\n" +
" help Protects your account with a password;\n" +
" type player;\n" +
" }\n" +
"}\n" +
"\n" +
"command login {\n" +
" perm utils.loginsecurity;\n" +
" \n" +
" [string:password] {\n" +
" run login password;\n" +
" help Logs you in;\n" +
" type player;\n" +
" }\n" +
"}\n" +
"\n" +
"command cgpass {\n" +
" perm utils.loginsecurity;\n" +
" \n" +
" [string:oldPassword] [string:newPassword] {\n" +
" run cgpass oldPassword newPassword;\n" +
" help Changes your password to the specified one;\n" +
" type player;\n" +
" }\n" +
"}\n" +
"\n" +
"command rmpass {\n" +
" perm utils.loginsecurity;\n" +
" \n" +
" [string:oldPassword] {\n" +
" run rmpass oldPassword;\n" +
" help Removes the password of your account;\n" +
" type player;\n" +
" }\n" +
"}\n" +
"\n" +
"command rmotherpass {\n" +
" perm utils.loginsecurity.admin;\n" +
" \n" +
" [string:playerName] {\n" +
" run rmotherpass playerName;\n" +
" help removes the password of another player;\n" +
" perm utils.loginsecurity.admin;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,16 @@
command mentio {
add [string:trigger] {
help Triggers you when the trigger gets said.;
run addmentio trigger;
}
delete [string:trigger] {
help Deletes a mentio.;
run delmentio trigger;
}
list {
help Lists your mentios.;
run listmentios;
}
perm utils.mentio;
type player;
}

View File

@@ -28,9 +28,9 @@ import com.redstoner.modules.ignore.Ignore;
import net.nemez.chatapi.click.Message;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 3, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Mentio implements Module, Listener
{
private File mentioLocation = new File(Main.plugin.getDataFolder(), "mentio.json");
@@ -177,27 +177,4 @@ public class Mentio implements Module, Listener
{
JsonManager.save(mentios, mentioLocation);
}
// @noformat
@Override
public String getCommandString()
{
return "command mentio {\n" +
" add [string:trigger] {\n" +
" help Triggers you when the trigger gets said.;\n" +
" run addmentio trigger;\n" +
" }\n" +
" delete [string:trigger] {\n" +
" help Deletes a mentio.;\n" +
" run delmentio trigger;\n" +
" }\n" +
" list {\n" +
" help Lists your mentios.;\n" +
" run listmentios;\n" +
" }\n" +
" perm utils.mentio;\n" +
" type player;\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,14 @@
command setmotd {
[string:motd...] {
help Sets the motd. Use --reset to reset to default;
run setmotd motd;
perm utils.setmotd;
}
}
command getmotd {
[empty] {
help Returns the motd;
run getmotd;
perm utils.getmotd;
}
}

View File

@@ -14,9 +14,9 @@ import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Motd implements Module, Listener
{
private String default_motd, motd;
@@ -56,25 +56,4 @@ public class Motd implements Module, Listener
motd = default_motd;
return true;
}
// @noformat
@Override
public String getCommandString()
{
return "command setmotd {\n" +
" [string:motd...] {\n" +
" help Sets the motd. Use --reset to reset to default;\n" +
" run setmotd motd;\n" +
" perm utils.setmotd;" +
" }\n" +
"}\n" +
"command getmotd {\n" +
" [empty] {\n" +
" help Returns the motd;\n" +
" run getmotd;\n" +
" perm utils.getmotd;" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,11 @@
command tab {
sort {
help Resorts the entirety of tab.;
run sort;
}
sort [string:player] {
help Resorts one player.;
run sortspecific player;
}
perm utils.tab.admin;
}

View File

@@ -19,9 +19,9 @@ import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.Main;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 2, compatible = 4)
@Version(major = 4, minor = 1, revision = 2, compatible = 4)
public class Nametags implements Module, Listener
{
@EventHandler
@@ -127,22 +127,4 @@ public class Nametags implements Module, Listener
}
return (prefix - 1) + "_" + teams[teams.length - 1];
}
// @noformat
@Override
public String getCommandString()
{
return "command tab {\n" +
" sort {\n" +
" help Resorts the entirety of tab.;\n" +
" run sort;\n" +
" }\n" +
" sort [string:player] {\n" +
" help Resorts one player.;\n" +
" run sortspecific player;\n" +
" }\n" +
" perm utils.tab.admin;\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,24 @@
command anvil {
[empty] {
run anvil;
type player;
help Opens anvil GUI.;
perm utils.anvil;
}
}
command name {
[string:name...] {
run name name;
type player;
help Names item in hand.;
perm utils.name;
}
}
command lore {
[optional:-a] [string:lore...] {
run lore -a lore;
type player;
help Adds lore to item in hand.;
perm utils.lore;
}
}

View File

@@ -19,8 +19,8 @@ import com.redstoner.modules.Module;
import net.md_5.bungee.api.ChatColor;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Naming implements Module
{
@Command(hook = "anvil")
@@ -72,35 +72,4 @@ public class Naming implements Module
getLogger().message(sender, "Lore set to " + lore);
((Player) sender).updateInventory();
}
// @noformat
@Override
public String getCommandString()
{
return "command anvil {\n" +
" [empty] {\n" +
" run anvil;\n" +
" type player;\n" +
" help Opens anvil GUI.;\n" +
" perm utils.anvil;\n" +
" }\n" +
"}\n" +
"command name {\n" +
" [string:name...] {\n" +
" run name name;\n" +
" type player;\n" +
" help Names item in hand.;\n" +
" perm utils.name;\n" +
" }\n" +
"}\n" +
"command lore {\n" +
" [optional:-a] [string:lore...] {\n" +
" run lore -a lore;\n" +
" type player;\n" +
" help Adds lore to item in hand.;\n" +
" perm utils.lore;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -1,102 +0,0 @@
package com.redstoner.modules.pmtoggle;
import java.util.HashMap;
import java.util.Map.Entry;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import com.nemez.cmdmgr.Command;
import com.nemez.cmdmgr.Command.AsyncType;
import com.redstoner.annotations.AutoRegisterListener;
import com.redstoner.annotations.Commands;
import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
public class Pmtoggle implements Module, Listener
{
HashMap<Player, String> toggles = new HashMap<Player, String>();
@Command(hook = "pmtoggle_off", async = AsyncType.ALWAYS)
public boolean pmtoggle_off(CommandSender sender)
{
Player player = (Player) sender;
if (toggles.remove(player) != null)
getLogger().message(player, "Your pmtoggle was removed!");
else
getLogger().message(player, "You didn't have pmtoggle enabled! Use /pmtoggle <player> to enabled it.");
return true;
}
@Command(hook = "pmtoggle", async = AsyncType.ALWAYS)
public boolean pmtoggle(CommandSender sender, String player)
{
Player p = Bukkit.getPlayer(player);
if (p == null && !player.equals("CONSOLE"))
{
getLogger().message(sender, "§cThat player couldn't be found!");
return true;
}
toggles.put((Player) sender, player);
getLogger().message(sender, "Locked your pmtoggle onto §6" + player + "§7.");
return true;
}
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event)
{
Player player = event.getPlayer();
if (toggles.containsKey(player))
{
Bukkit.dispatchCommand(player, "m " + toggles.get(player) + " " + event.getMessage());
event.setCancelled(true);
}
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event)
{
toggles.remove(event.getPlayer());
String player = event.getPlayer().getName();
if (toggles.containsValue(player))
{
for (Entry<Player, String> entry : toggles.entrySet())
{
if (entry.getValue().equals(player))
{
toggles.remove(player);
getLogger().message(entry.getKey(),
"We removed your pmtoggle for &6" + player + "&7, as they left the game.");
}
}
}
}
// @noformat
@Override
public String getCommandString()
{
return "command pmtoggle {\n" +
" [empty] {\n" +
" help Turns off your toggle.;\n" +
" type player;\n" +
" run pmtoggle_off;\n" +
" }\n" +
" [string:player] {\n" +
" help Turns on your pmtoggle and locks onto <player>.;\n" +
" type player;\n" +
" run pmtoggle player;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,24 @@
command report {
[string:message...] {
type player;
help Report a player or incident;
run report message;
}
}
command rp {
perm utils.report;
open {
help List all open reports;
run report_open;
}
close [int:id] {
help Close a report;
run report_close id;
}
tp [int:id] {
help Teleport to the location of a report;
run report_tp id;
type player;
}
}

View File

@@ -25,8 +25,8 @@ import net.md_5.bungee.api.ChatColor;
/** Report module. Allows reports to be created and handled by staff
*
* @author Redempt */
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Reports implements Module
{
private int task = 0;
@@ -73,16 +73,6 @@ public class Reports implements Module
JsonManager.save(archived, new File(Main.plugin.getDataFolder(), "archived_reports.json"));
}
@Override
public String getCommandString()
{
return "command report {" + "[string:message...] {" + "type player;" + "help Report a player or incident;"
+ "run report message;" + "}" + "}" + "command rp {" + "perm utils.report;" + "open {"
+ "help List all open reports;" + "run report_open;" + "}" + "close [int:id] {" + "help Close a report;"
+ "run report_close id;" + "}" + "tp [int:id] {" + "help Teleport to the location of a report;"
+ "run report_tp id;" + "type player;" + "}" + "}";
}
@Command(hook = "report_tp")
public void tpReport(CommandSender sender, int id)
{

View File

@@ -0,0 +1,47 @@
command lol {
add [string:text...] {
help Lols a text.;
run addlol text;
perm utils.lol.admin;
}
del [int:id] {
help Unlols a lol.;
run dellol id;
perm utils.lol.admin;
}
set [int:id] [string:text...] {
help Relols a lol.;
run setlol id text;
perm utils.lol.admin;
}
id [int:id] {
help Lols specifically.;
run lolid id;
perm utils.lol.id;
}
list [int:page] {
help Shows lols.;
run listlols page;
perm utils.lol.list;
}
list {
help Shows lols.;
run listlolsdef;
perm utils.lol.list;
}
search [flag:-i] [string:text...] {
help Search lols.;
run searchlol -i text;
perm utils.lol.search;
}
match [flag:-i] [string:regex...] {
help Search lols. But better.;
run matchlol -i regex;
perm utils.lol.match;
}
[empty] {
help Lols.;
run saylol;
perm utils.lol;
}
}

View File

@@ -24,8 +24,8 @@ import net.nemez.chatapi.ChatAPI;
import net.nemez.chatapi.click.ClickCallback;
import net.nemez.chatapi.click.Message;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Saylol implements Module
{
private long lastLol = 0;
@@ -297,58 +297,4 @@ public class Saylol implements Module
if (player.hasPermission("utils.lol.id"))
Bukkit.dispatchCommand(player, "lol id " + index);
}
// @noformat
@Override
public String getCommandString()
{
return "command lol {\n" +
" add [string:text...] {\n" +
" help Lols a text.;\n" +
" run addlol text;\n" +
" perm utils.lol.admin;\n" +
" }\n" +
" del [int:id] {\n" +
" help Unlols a lol.;\n" +
" run dellol id;\n" +
" perm utils.lol.admin;\n" +
" }\n" +
" set [int:id] [string:text...] {\n" +
" help Relols a lol.;\n" +
" run setlol id text;\n" +
" perm utils.lol.admin;\n" +
" }\n" +
" id [int:id] {\n" +
" help Lols specifically.;\n" +
" run lolid id;\n" +
" perm utils.lol.id;\n" +
" }\n" +
" list [int:page] {\n" +
" help Shows lols.;\n" +
" run listlols page;\n" +
" perm utils.lol.list;\n" +
" }\n" +
" list {\n" +
" help Shows lols.;\n" +
" run listlolsdef;\n" +
" perm utils.lol.list;\n" +
" }\n" +
" search [flag:-i] [string:text...] {\n" +
" help Search lols.;\n" +
" run searchlol -i text;\n" +
" perm utils.lol.search;\n" +
" }\n" +
" match [flag:-i] [string:regex...] {\n" +
" help Search lols. But better.;\n" +
" run matchlol -i regex;\n" +
" perm utils.lol.match;\n" +
" }\n" +
" [empty] {\n" +
" help Lols.;\n" +
" run saylol;\n" +
" perm utils.lol;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -1,334 +0,0 @@
package com.redstoner.modules.scoreboard;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.misc.Utils;
public class Project
{
private int progress;
private Project parent;
private final String projectID;
private String projectName;
private String displayName;
private UUID owner;
private JSONArray admins, members;
private int localID;
private Location location;
private Scoreboard scoreboard;
ArrayList<Project> subs = new ArrayList<Project>();
private Project(String projectID, Project parent, String name, String displayName, UUID owner, int localID,
Location location, JSONArray admins, JSONArray members)
{
this.parent = parent;
this.projectID = projectID;
this.progress = 0;
this.owner = owner;
this.location = location;
this.projectName = name;
this.localID = localID;
this.displayName = displayName;
this.admins = admins;
this.members = members;
scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
updateScoreboard();
}
private Project(String projectID, Project parent, String name, String displayName, UUID owner, int localID,
Location location)
{
this(projectID, null, name, displayName, owner, localID, location, new JSONArray(), new JSONArray());
}
private Project(Project parent, String name, String displayName, UUID owner, int localID, Location location)
{
this(ProjectManager.getNextID(name), null, name, displayName, owner, localID, location);
}
public Project(String name, String displayName, UUID owner, int localID, Location location)
{
this(null, name, displayName, owner, localID, location);
}
/** This method returns the progress of this project.
*
* @return the progress in percent, as an integer between 0 and 100 (inclusive). */
public int getProgress()
{
return progress;
}
/** This method sets the progress to the given parameter. The value must be between 0 and 100 (inclusive).</br>
* If this project is not a leaf, then only 0 and 100 can be set, recursively overriding the progress of all sub-projects.</br>
* This method will invoke updateProgress().
*
* @param sender The CommandSender responsible for updating the progress.
* @param progress the new progress, 0 ≤ progress ≤ 100. */
public void setProgress(CommandSender sender, int progress)
{
if (progress < 0 || progress > 100)
{
if (sender != null)
Utils.sendErrorMessage(sender, null, "Progress must be between 0% and 100%!");
return;
}
if (subs.size() == 0)
{
if (sender != null)
Utils.sendMessage(sender, null, "Updated the project's progress to &e" + progress + "%&7.", '&');
this.progress = progress;
updateProgress();
}
else
{
if (progress == 100)
{
for (Project project : subs)
{
project.setProgress(sender, progress);
}
updateProgress();
if (sender != null)
Utils.sendMessage(sender, null, "Set the entire branch to done!");
}
if (progress == 0)
{
for (Project project : subs)
{
project.setProgress(null, progress);
}
updateProgress();
if (sender != null)
Utils.sendMessage(sender, null, "Set the entire branch to not done!");
}
else
{
if (sender != null)
{
Utils.sendErrorMessage(sender, null,
"Can not set progress of a non-end project node to anything but 100 or 0!");
Utils.sendErrorMessage(sender, null, "Please update the corresponding sub-project!");
}
}
}
}
/** This method updates the progress on the project, calculating it from the sub-projects if exists and updating the parent as well.</br>
* This will also update the scoreboard. */
public void updateProgress()
{
if (subs.size() != 0)
{}
if (parent != null)
{
parent.updateProgress();
}
updateScoreboard();
}
/** This returns the unique project identifier of this project, consisting of [name]#[ID].
*
* @return the unique identifier. */
public String getUUID()
{
return projectID;
}
/** This method allows access to the parent project.
*
* @return the parent project, or null if this is the root project. */
public Project getParent()
{
return parent;
}
/** Teleports a player to the location assigned with this project. If no location can be found, the parent project's location will be used.</br>
* If at the root Project no valid location was found, the player will not be teleported and an error message will be sent.
*
* @param player the player to be teleported.
* @return true if the teleport was successfull. */
public boolean tp(Player player)
{
if (location == null)
{
if (parent != null)
{
return parent.tp(player);
}
else
{
if (player.getUniqueId().equals(owner))
Utils.sendErrorMessage(player, null,
"No location was assigned with this project! Use &e/project option location set &7(or one of the interactive menus )to define a location!");
else
Utils.sendErrorMessage(player, null,
"No location was assigned with this project! Ask a project administrator to define one!");
return false;
}
}
else
{
player.teleport(location);
Utils.sendMessage(player, null, "Teleported you to the projects location!");
return true;
}
}
/** This method converts a JSONObject representation of a Project back into the original project.</br>
* It will also load all sub-projects recursively, and load complex types back from Strings.
*
* @param project The JSONObject containing the Project.
* @return the project that was represented by the JSONObject. */
public static Project getProject(JSONObject project)
{
ArrayList<Project> subs = new ArrayList<Project>();
for (Object obj : (JSONArray) project.get("subs"))
{
subs.add(Project.getProject((JSONObject) obj));
}
String projectName = (String) project.get("projectName");
String displayName = (String) project.get("displayName");
String projectID = (String) project.get("projectID");
UUID owner = UUID.fromString((String) project.get("owner"));
JSONArray admins = (JSONArray) project.get("admins");
JSONArray members = (JSONArray) project.get("members");
int localID = (int) project.get("localID");
int progress = (int) project.get("progress");
Location location = getStringLocation((String) project.get("location"));
Project result = new Project(projectID, null, projectName, displayName, owner, localID, location, admins,
members);
for (Project sub : subs)
sub.parent = result;
result.progress = progress;
return result;
}
/** This method turns the project into a JSONObject for storing on the file system. It will recursively turn all sub-projects into JSONObjects</br>
* and it will also convert all complex types into Strings.
*
* @return A JSONObject representing the project. */
@SuppressWarnings("unchecked")
public JSONObject toJSONObject()
{
JSONObject project = new JSONObject();
JSONArray subProjects = new JSONArray();
for (Project subProject : subs)
{
subProjects.add(subProject.toJSONObject());
}
project.put("subs", subProjects);
project.put("projectName", this.projectName);
project.put("displayName", this.displayName);
project.put("projectID", this.projectID);
project.put("owner", owner.toString());
project.put("admins", admins);
project.put("members", members);
project.put("localID", localID);
project.put("progress", progress);
project.put("parent", parent.toString());
project.put("location", getLocationString(location));
return project;
}
/** This method converts a location into a String representation ready for storing on the file system.
*
* @param location The location to be turned into a String.
* @return The String representation of the location. */
public static String getLocationString(Location location)
{
UUID worldID = location.getWorld().getUID();
return worldID + ";" + location.getX() + ";" + location.getY() + ";" + location.getZ() + ";" + location.getYaw()
+ ";" + location.getPitch();
}
/** This method converts a String representation of a location back into its original location.
*
* @param location The String representation of the location.
* @return the location described by the String given, or null if the world containing it is gone.
* @throws NumberFormatException when the floats given as coordinates are invalid.
* @throws NumberFormatException when the UUID given as world descriptor is invalid. */
public static Location getStringLocation(String location) throws NumberFormatException, IllegalArgumentException
{
String[] params = location.split(";");
return new Location(Bukkit.getWorld(UUID.fromString(params[0])), Float.parseFloat(params[1]),
Float.parseFloat(params[2]), Float.parseFloat(params[3]), Float.parseFloat(params[4]),
Float.parseFloat(params[5]));
}
/** This method refreshes the scoreboard assigned with the project and will be called internally when any value changes.</br>
* You can call this method at any time before displaying the scoreboard to make sure that the displayed values are accurate. */
public void updateScoreboard()
{
Objective project = scoreboard.registerNewObjective("Project", "dummy");
project.setDisplaySlot(DisplaySlot.SIDEBAR);
if (displayName != null)
project.setDisplayName(displayName);
else
project.setDisplayName(projectName);
Score progress = project.getScore("§aProgress");
progress.setScore(this.progress);
save();
}
private void save()
{
if (parent == null)
JsonManager.save(toJSONObject(),
new File(Main.plugin.getDataFolder(), "scoreboards/projects/" + projectID + ".json"));
else
parent.save();
}
/** This method returns the UUID of the owner of this project.
*
* @return the UUID of the owner, null if the owner is console. */
public UUID getOwner()
{
return owner;
}
/** This method returns how many sub-projects can be created within this project, depending on the permissions of the project owner.</br>
* </br>
* Please note that as of Version 3.0.x, this value is always 5 and not respecting permissions.
*
* @return The maximum amount of sub-projects this project can have. */
public int getMaxSubprojects()
{
return 5;
}
/** This method returns an unmodifiable copy of the sub-projects. If you want to modify the list, use the corresponding add/delete/clear methods</br>
* of the project holding the list. You can still perform actions on all sub-projects as usual.
*
* @return An unmodifiable copy of the sub-projects list. */
public synchronized List<Project> getSubProjects()
{
return Collections.unmodifiableList(subs);
}
/** This method returns the scoreboard generated by the project status.
*
* @return the scoreboard object. */
public Scoreboard getScoreboard()
{
return scoreboard;
}
}

View File

@@ -1,53 +0,0 @@
package com.redstoner.modules.scoreboard;
import java.io.File;
import org.bukkit.command.CommandSender;
import org.json.simple.JSONObject;
import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
public class ProjectManager
{
private static File dataFile = new File(Main.plugin.getDataFolder(), "projectIDs.json");
private static JSONObject IDs;
static
{
IDs = JsonManager.getObject(dataFile);
if (IDs == null)
IDs = new JSONObject();
}
/** This method generates a unique identifier for a project by name.
*
* @param name The name of the project.
* @return The project identifier, as [name]#[ID]. */
@SuppressWarnings("unchecked")
public static String getNextID(String name)
{
Object raw = IDs.get(name);
int i = 1;
if (raw != null)
i = (int) raw + 1;
IDs.put(name, i);
save();
return name + "#" + i;
}
/** Saves the current state into a file. */
private static void save()
{
JsonManager.save(IDs, dataFile);
}
/** This method finds the currently active project by a CommandSender and will return it as part of the tree.
*
* @param sender The sender of whom the project is to be found.
* @return the currently active project of the sender or null, if none are active. */
public static Project getCurrentProject(CommandSender sender)
{
return null;
}
}

View File

@@ -1,147 +0,0 @@
package com.redstoner.modules.scoreboard;
import java.io.File;
import java.util.HashMap;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.json.simple.JSONObject;
import com.nemez.cmdmgr.Command;
import com.nemez.cmdmgr.CommandManager;
import com.redstoner.annotations.AutoRegisterListener;
import com.redstoner.annotations.Version;
import com.redstoner.exceptions.MissingVersionException;
import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.misc.Utils;
import com.redstoner.misc.VersionHelper;
import com.redstoner.modules.Module;
@AutoRegisterListener
@Version(major = 3, minor = 0, revision = 0, compatible = 3)
public class Scoreboards implements Module, Listener
{
final File cmdFile = new File(
new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().getFile()).getParentFile(),
"Scoreboard.cmd");
final File scoreboardsFolder = new File(Main.plugin.getDataFolder(), "scoreboards");
HashMap<CommandSender, JSONObject> playerData = new HashMap<CommandSender, JSONObject>();
@Override
public boolean onEnable()
{
if (!scoreboardsFolder.exists())
scoreboardsFolder.mkdirs();
playerData.put(Bukkit.getConsoleSender(),
JsonManager.getObject(new File(scoreboardsFolder, "scoreboards/players/console.json")));
return true;
}
@Override
public void postEnable()
{
CommandManager.registerCommand(cmdFile, this, Main.plugin);
}
@Override
public void onDisable()
{
save();
for (Player p : Bukkit.getOnlinePlayers())
{
p.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
}
playerData.remove(Bukkit.getConsoleSender());
}
private void save()
{
JsonManager.save(playerData.get(Bukkit.getConsoleSender()),
new File(scoreboardsFolder, "scoreboards/players/console.json"));
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
JSONObject data = JsonManager.getObject(
new File(scoreboardsFolder, "scoreboards/players/" + player.getUniqueId().toString() + ".json"));
if (data == null)
data = new JSONObject();
playerData.put(player, data);
Project currentProject = ProjectManager.getCurrentProject(player);
if (currentProject == null)
return;
else
player.setScoreboard(currentProject.getScoreboard());
}
@EventHandler
public void onPlayerLeave(PlayerQuitEvent event)
{
Player player = event.getPlayer();
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
JsonManager.save(playerData.remove(player),
new File(scoreboardsFolder, "scoreboards/players/" + player.getUniqueId().toString() + ".json"));
}
@Command(hook = "project")
public boolean project(CommandSender sender) throws MissingVersionException
{
Utils.sendMessage(sender, null, "This server is running version" + VersionHelper.getVersion(this.getClass()));
return true;
}
@Command(hook = "create")
public boolean createProject(CommandSender sender, boolean sub, String name)
{
JSONObject data = playerData.get(sender);
if (!sub)
{
int max = Integer.parseInt(getPermissionContent(sender, "utils.scoreboards.projects.amount."));
int amount = 0;
Object raw = data.get("amount");
if (raw != null)
amount = (int) raw;
if (amount >= max)
{
Utils.sendErrorMessage(sender, null, "You have already reached the maximum amount of " + max
+ " projects! Delete an old project before you create a new one!");
return true;
}
}
else
{
Project currentProject = ProjectManager.getCurrentProject(sender);
int max = currentProject.getMaxSubprojects();
int amount = currentProject.getSubProjects().size();
Object raw = data.get("amount");
if (raw != null)
amount = (int) raw;
if (amount >= max)
{
Utils.sendErrorMessage(sender, null, "You have already reached the maximum amount of " + max
+ " projects! Delete an old project before you create a new one!");
return true;
}
}
return true;
}
private static String getPermissionContent(CommandSender sender, String permnode)
{
Set<PermissionAttachmentInfo> perms = sender.getEffectivePermissions();
for (PermissionAttachmentInfo perm : perms)
if (perm.getPermission().toString().startsWith(permnode))
return perm.getPermission().replace(permnode, "");
return null;
}
}

View File

@@ -1,51 +0,0 @@
command project {
[empty] {
help Prints version info.;
run project;
perm utils.scoreboards;
}
create [flag:-s] [string:name] {
help Creates a new Project. The -s flag indicates that you are trying to create a new sub-project instead.;
run create -s name;
perm utils.scoreboards.use;
}
delete {
help Deletes the current project. This will also delete the entire branch attached to it, but no parents.;
run delete;
perm utils.scoreboards.use;
}
explore [string:name] {
help Switches to the specified project. If you have multiple projects with the same name reachable in one step (example: you are in 5x5_top and want to go to 5x5_top_trigger, but you also have a project called trigger) then you need to specify the full path like this: 5x5_top_trigger;
run explore name;
perm utils.scoreboards.use;
}
hide {
help Deselects the current project. Use the &e/project explore &7command to view it again!;
run hide;
}
option {
help Opens an interactive option menu to let you change the projects settings.;
run optionMenu;
perm utils.scoreboards.use;
}
option [string:option] {
help Opens an interactive option menu to let you change the specified setting.;
run optionName name;
perm utils.scoreboards.use;
}
option [string:option] [string:value...] {
help Lets you directly modify the options of a project. If no value is specified, an interactive menu opens.;
run option name value;
perm utils.scoreboards.use;
}
manage {
help Opns an interactive menu that lets you manage the project in its entirety.;
run manage;
perm utils.scoreboards.use;
}
invite [flag:-e] [string:name] {
help Invites a player to the current project and all sub projects. If the -e is set, subprojects will be excluded.;
run invite e name;
perm utils.scoreboards.use;
}
}

View File

@@ -0,0 +1,119 @@
command script_restart {
[string:timeout] [string:name] [string:reason] {
help Prints bukkit restart message;
type console;
run script_restart timeout name reason;
}
}
command script_stop {
[string:timeout] [string:name] [string:reason] {
help Prints bukkit shut down message;
type console;
run script_stop timeout name reason;
}
}
command script_restart_abort {
[empty] {
help Prints the restart abort message;
type console;
run script_restart_abort;
}
}
command script_stop_abort {
[empty] {
help Prints the shut down abort message;
type console;
run script_stop_abort;
}
}
command script_backup_begin {
[empty] {
help Prints the backup started message, saves all worlds and turns off world saving;
type console;
run script_backup_begin;
}
}
command script_backup_end {
[empty] {
help Prints the backup finished message and turns on world saving;
type console;
run script_backup_end;
}
}
command script_backup_error {
[empty] {
help Prints the backup error message and turns on world saving;
type console;
run script_backup_error;
}
}
command script_trim {
[empty] {
help Prints the world trimming started message and starts trimming;
type console;
run script_trim;
}
}
command script_trim_result {
[string:size] [string:data...] {
help Prints the trimming finished message;
type console;
run script_trim_result size data;
}
}
command script_backup_database_begin {
[empty] {
help Prints the database backup started message and admin-chat warning;
type console;
run script_backup_database_begin;
}
}
command script_backup_database_dumps {
[empty] {
help Prints the database dumps cmpression started message;
type console;
run script_backup_database_dumps;
}
}
command script_backup_database_end {
[string:size] {
help Prints the database finished message and backup size in admin-chat;
type console;
run script_backup_database_end size;
}
}
command script_backup_database_error {
[empty] {
help Prints the database backup error message;
type console;
run script_backup_database_error;
}
}
command script_backup_database_abort {
[empty] {
help Prints the database backup abort message;
type console;
run script_backup_database_abort;
}
}
command script_spigot_update {
[empty] {
help Prints the spigot update message;
type console;
run script_spigot_update;
}
}
command script_disk_filled {
[string:percentage] {
help Prints the admin-chat warning for disk is filled;
type console;
run script_disk_filled percentage;
}
}
command script_shutdown {
[string:reason] {
help Saves all worlds, kicks players and shuts down the server;
type console;
run script_shutdown reason;
}
}

View File

@@ -10,8 +10,8 @@ import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.Utils;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Scriptutils implements Module
{
/** Prints Bukkit restart message
@@ -174,130 +174,4 @@ public class Scriptutils implements Module
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "kickall " + reason);
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "stop");
}
// @noformat
@Override
public String getCommandString()
{
return "command script_restart {\n" +
" [string:timeout] [string:name] [string:reason] {\n" +
" help Prints bukkit restart message;\n" +
" type console;\n" +
" run script_restart timeout name reason;\n" +
" }\n" +
"}\n" +
"command script_stop {\n" +
" [string:timeout] [string:name] [string:reason] {\n" +
" help Prints bukkit shut down message;\n" +
" type console;\n" +
" run script_stop timeout name reason;\n" +
" }\n" +
"}\n" +
"command script_restart_abort {\n" +
" [empty] {\n" +
" help Prints the restart abort message;\n" +
" type console;\n" +
" run script_restart_abort;\n" +
" }\n" +
"}\n" +
"command script_stop_abort {\n" +
" [empty] {\n" +
" help Prints the shut down abort message;\n" +
" type console;\n" +
" run script_stop_abort;\n" +
" }\n" +
"}\n" +
"command script_backup_begin {\n" +
" [empty] {\n" +
" help Prints the backup started message, saves all worlds and turns off world saving;\n" +
" type console;\n" +
" run script_backup_begin;\n" +
" }\n" +
"}\n" +
"command script_backup_end {\n" +
" [empty] {\n" +
" help Prints the backup finished message and turns on world saving;\n" +
" type console;\n" +
" run script_backup_end;\n" +
" }\n" +
"}\n" +
"command script_backup_error {\n" +
" [empty] {\n" +
" help Prints the backup error message and turns on world saving;\n" +
" type console;\n" +
" run script_backup_error;\n" +
" }\n" +
"}\n" +
"command script_trim {\n" +
" [empty] {\n" +
" help Prints the world trimming started message and starts trimming;\n" +
" type console;\n" +
" run script_trim;\n" +
" }\n" +
"}\n" +
"command script_trim_result {\n" +
" [string:size] [string:data...] {\n" +
" help Prints the trimming finished message;\n" +
" type console;\n" +
" run script_trim_result size data;\n" +
" }\n" +
"}\n" +
"command script_backup_database_begin {\n" +
" [empty] {\n" +
" help Prints the database backup started message and admin-chat warning;\n" +
" type console;\n" +
" run script_backup_database_begin;\n" +
" }\n" +
"}\n" +
"command script_backup_database_dumps {\n" +
" [empty] {\n" +
" help Prints the database dumps cmpression started message;\n" +
" type console;\n" +
" run script_backup_database_dumps;\n" +
" }\n" +
"}\n" +
"command script_backup_database_end {\n" +
" [string:size] {\n" +
" help Prints the database finished message and backup size in admin-chat;\n" +
" type console;\n" +
" run script_backup_database_end size;\n" +
" }\n" +
"}\n" +
"command script_backup_database_error {\n" +
" [empty] {\n" +
" help Prints the database backup error message;\n" +
" type console;\n" +
" run script_backup_database_error;\n" +
" }\n" +
"}\n" +
"command script_backup_database_abort {\n" +
" [empty] {\n" +
" help Prints the database backup abort message;\n" +
" type console;\n" +
" run script_backup_database_abort;\n" +
" }\n" +
"}\n" +
"command script_spigot_update {\n" +
" [empty] {\n" +
" help Prints the spigot update message;\n" +
" type console;\n" +
" run script_spigot_update;\n" +
" }\n" +
"}\n" +
"command script_disk_filled {\n" +
" [string:percentage] {\n" +
" help Prints the admin-chat warning for disk is filled;\n" +
" type console;\n" +
" run script_disk_filled percentage;\n" +
" }\n" +
"}\n" +
"command script_shutdown {\n" +
" [string:reason] {\n" +
" help Saves all worlds, kicks players and shuts down the server;\n" +
" type console;\n" +
" run script_shutdown reason;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,22 @@
command tag {
add [string:player] [string:tag...] {
help Tags a player.;
run addtag player tag;
perm utils.tag;
}
del [string:player] [int:id] {
help Removes a tag.;
run deltag player id;
perm utils.tag;
}
check [string:player] {
help Lists all tags of a player.;\
run checktag player;
perm utils.tag;
}
[string:player] [string:tag...] {
help Tags a player.;
run addtag player tag;
perm utils.tag;
}
}

View File

@@ -19,8 +19,8 @@ import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
public class Tag implements Module
{
private File tagLocation = new File(Main.plugin.getDataFolder(), "tag.json");
@@ -144,27 +144,4 @@ public class Tag implements Module
JsonManager.save(tags, tagLocation);
}
// @noformat
@Override
public String getCommandString()
{
return "command tag {\n" +
" add [string:player] [string:tag...] {\n" +
" help Tags a player.;\n" +
" run addtag player tag;\n" +
" perm utils.tag;\n" +
" }\n" +
" del [string:player] [int:id] {\n" +
" help Removes a tag.;\n" +
" run deltag player id;\n" +
" perm utils.tag;\n" +
" }\n" +
" check [string:player] {\n" +
" help Lists all tags of a player.;\n" +
" run checktag player;\n" +
" perm utils.tag;\n" +
" }\n" +
"}";
}
// @format
}

View File

@@ -0,0 +1,19 @@
command lct {
perm utils.tilechunks;
list {
run list_cmd;
help re-lists already scanned chunks;
}
[int:amount] {
run scan_cmd amount;
help scans for laggy chunks;
}
tp [int:number] {
run tp number;
help teleports to the specified chunk;
type player;
}
}

View File

@@ -17,8 +17,8 @@ import com.redstoner.annotations.Version;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class TileChunks implements Module
{
private List<LaggyTileChunk> laggyChunks = new ArrayList<>();
@@ -80,31 +80,4 @@ public class TileChunks implements Module
getLogger().message(sender, true, "§4Invalid chunk number! Use §e/lc list §4to show laggy chunks!");
}
}
// @noformat
@Override
public String getCommandString()
{
return "command lct {\n" +
" perm utils.tilechunks;\n" +
" \n" +
" list {\n" +
" run list_cmd;\n" +
" help re-lists already scanned chunks;\n" +
" }\n" +
" \n" +
" [int:amount] {\n" +
" run scan_cmd amount;\n" +
" help scans for laggy chunks;\n" +
" }\n" +
" \n" +
" tp [int:number] {\n" +
" run tp number;\n" +
" help teleports to the specified chunk;\n" +
" type player;\n" +
" }\n" +
"}\n" +
" ";
}
// @format
}

View File

@@ -0,0 +1,15 @@
command warn {
[empty] {
run warn;
help Warns other players about definite lag;
perm utils.warn;
}
}
command warnp {
[empty] {
run warnp;
help Warns other players about possible lag;
perm utils.warn;
}
}

View File

@@ -9,8 +9,8 @@ import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.Utils;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class Warn implements Module
{
@Command(hook = "warn")
@@ -26,26 +26,4 @@ public class Warn implements Module
String name = Utils.getName(sender);
Utils.broadcast(null, "§2Possible lag incoming! - §9" + name, null);
}
// @noformat
@Override
public String getCommandString()
{
return "command warn {\n" +
" [empty] {\n" +
" run warn;\n" +
" help Warns other players about definite lag;\n" +
" perm utils.warn;\n" +
" }\n" +
"}\n" +
"\n" +
"command warnp {\n" +
" [empty] {\n" +
" run warnp;\n" +
" help Warns other players about possible lag;\n" +
" perm utils.warn;\n" +
" }\n" +
"}";
}
//@format
}

View File

@@ -0,0 +1,21 @@
command token {
perm utils.webtoken;
[empty] {
help Displays an already generated token;
type player;
perm utils.webtoken;
run token;
}
}
command gettoken {
perm utils.webtoken;
[string:email...] {
help Generates a token used for website authentication;
type player;
perm utils.webtoken;
run gettoken email;
}
}

View File

@@ -23,8 +23,8 @@ import com.redstoner.misc.mysql.elements.MysqlDatabase;
import com.redstoner.misc.mysql.elements.MysqlTable;
import com.redstoner.modules.Module;
@Commands(CommandHolderType.String)
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Commands(CommandHolderType.File)
@Version(major = 4, minor = 1, revision = 0, compatible = 4)
public class WebToken implements Module
{
private static final int TOKEN_LENGTH = 6;
@@ -222,32 +222,4 @@ public class WebToken implements Module
getLogger().message(player, true, "Hmm... That doesn't look like a valid email!");
}
}
// @noformat
@Override
public String getCommandString()
{
return "command token {\n" +
" perm utils.webtoken;\n" +
" \n" +
" [empty] {\n" +
" help Displays an already generated token;\n" +
" type player;\n" +
" perm utils.webtoken;\n" +
" run token;\n" +
" }\n" +
"}\n" +
"\n" +
"command gettoken {\n" +
" perm utils.webtoken;\n" +
" \n" +
" [string:email...] {\n" +
" help Generates a token used for website authentication;\n" +
" type player;\n" +
" perm utils.webtoken;\n" +
" run gettoken email;\n" +
" }\n" +
"}";
}
// @format
}