mirror of
https://github.com/songoda/UltimateModeration.git
synced 2025-01-31 03:31:27 +01:00
Added a ticket system.
This commit is contained in:
parent
687a107b63
commit
ebedc858bf
@ -13,6 +13,10 @@ import com.songoda.ultimatemoderation.storage.Storage;
|
|||||||
import com.songoda.ultimatemoderation.storage.StorageRow;
|
import com.songoda.ultimatemoderation.storage.StorageRow;
|
||||||
import com.songoda.ultimatemoderation.storage.types.StorageMysql;
|
import com.songoda.ultimatemoderation.storage.types.StorageMysql;
|
||||||
import com.songoda.ultimatemoderation.storage.types.StorageYaml;
|
import com.songoda.ultimatemoderation.storage.types.StorageYaml;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.Ticket;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketManager;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketResponse;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketStatus;
|
||||||
import com.songoda.ultimatemoderation.utils.Methods;
|
import com.songoda.ultimatemoderation.utils.Methods;
|
||||||
import com.songoda.ultimatemoderation.utils.SettingsManager;
|
import com.songoda.ultimatemoderation.utils.SettingsManager;
|
||||||
import com.songoda.ultimatemoderation.utils.gui.AbstractGUI;
|
import com.songoda.ultimatemoderation.utils.gui.AbstractGUI;
|
||||||
@ -28,6 +32,7 @@ public class UltimateModeration extends JavaPlugin {
|
|||||||
private static UltimateModeration INSTANCE;
|
private static UltimateModeration INSTANCE;
|
||||||
private References references;
|
private References references;
|
||||||
|
|
||||||
|
private TicketManager ticketManager;
|
||||||
private TemplateManager templateManager;
|
private TemplateManager templateManager;
|
||||||
private SettingsManager settingsManager;
|
private SettingsManager settingsManager;
|
||||||
private CommandManager commandManager;
|
private CommandManager commandManager;
|
||||||
@ -80,6 +85,7 @@ public class UltimateModeration extends JavaPlugin {
|
|||||||
this.references = new References();
|
this.references = new References();
|
||||||
|
|
||||||
// Setup Managers
|
// Setup Managers
|
||||||
|
this.ticketManager = new TicketManager();
|
||||||
this.templateManager = new TemplateManager();
|
this.templateManager = new TemplateManager();
|
||||||
this.commandManager = new CommandManager(this);
|
this.commandManager = new CommandManager(this);
|
||||||
this.punishmentManager = new PunishmentManager();
|
this.punishmentManager = new PunishmentManager();
|
||||||
@ -88,7 +94,6 @@ public class UltimateModeration extends JavaPlugin {
|
|||||||
this.checkStorage();
|
this.checkStorage();
|
||||||
this.loadFromFile();
|
this.loadFromFile();
|
||||||
|
|
||||||
|
|
||||||
// Register Listeners
|
// Register Listeners
|
||||||
AbstractGUI.initializeListeners(this);
|
AbstractGUI.initializeListeners(this);
|
||||||
Bukkit.getPluginManager().registerEvents(new CommandListener(this), this);
|
Bukkit.getPluginManager().registerEvents(new CommandListener(this), this);
|
||||||
@ -162,6 +167,32 @@ public class UltimateModeration extends JavaPlugin {
|
|||||||
playerPunishData.addNotes(note);
|
playerPunishData.addNotes(note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (storage.containsGroup("tickets")) {
|
||||||
|
for (StorageRow row : storage.getRowsByGroup("tickets")) {
|
||||||
|
|
||||||
|
int id = row.get("id").asInt();
|
||||||
|
Ticket ticket = new Ticket(
|
||||||
|
UUID.fromString(row.get("player").asString()),
|
||||||
|
row.get("subject").asString());
|
||||||
|
ticket.setTicketId(id);
|
||||||
|
ticket.setStatus(TicketStatus.valueOf(row.get("status").asString()));
|
||||||
|
ticketManager.addTicket(ticket, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (storage.containsGroup("ticketresponses")) {
|
||||||
|
for (StorageRow row : storage.getRowsByGroup("ticketresponses")) {
|
||||||
|
int id = row.get("ticketid").asInt();
|
||||||
|
TicketResponse ticketResponse = new TicketResponse(
|
||||||
|
UUID.fromString(row.get("author").asString()),
|
||||||
|
row.get("message").asString(),
|
||||||
|
row.get("posted").asLong());
|
||||||
|
ticketResponse.setTicketId(id);
|
||||||
|
ticketManager.getTicket(id).addResponse(ticketResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
storage.doSave();
|
storage.doSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,4 +232,8 @@ public class UltimateModeration extends JavaPlugin {
|
|||||||
public PunishmentManager getPunishmentManager() {
|
public PunishmentManager getPunishmentManager() {
|
||||||
return punishmentManager;
|
return punishmentManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TicketManager getTicketManager() {
|
||||||
|
return ticketManager;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public class CommandManager implements CommandExecutor {
|
|||||||
instance.getCommand("UnMute").setExecutor(this);
|
instance.getCommand("UnMute").setExecutor(this);
|
||||||
instance.getCommand("Warn").setExecutor(this);
|
instance.getCommand("Warn").setExecutor(this);
|
||||||
instance.getCommand("RunTemplate").setExecutor(this);
|
instance.getCommand("RunTemplate").setExecutor(this);
|
||||||
|
instance.getCommand("Ticket").setExecutor(this);
|
||||||
|
|
||||||
AbstractCommand commandUltimateModeration = addCommand(new CommandUltimateModeration());
|
AbstractCommand commandUltimateModeration = addCommand(new CommandUltimateModeration());
|
||||||
addCommand(new CommandClearChat());
|
addCommand(new CommandClearChat());
|
||||||
@ -60,6 +61,7 @@ public class CommandManager implements CommandExecutor {
|
|||||||
addCommand(new CommandUnMute());
|
addCommand(new CommandUnMute());
|
||||||
addCommand(new CommandWarn());
|
addCommand(new CommandWarn());
|
||||||
addCommand(new CommandRunTemplate());
|
addCommand(new CommandRunTemplate());
|
||||||
|
addCommand(new CommandTicket());
|
||||||
|
|
||||||
addCommand(new CommandSettings(commandUltimateModeration));
|
addCommand(new CommandSettings(commandUltimateModeration));
|
||||||
addCommand(new CommandHelp(commandUltimateModeration));
|
addCommand(new CommandHelp(commandUltimateModeration));
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.songoda.ultimatemoderation.command.commands;
|
||||||
|
|
||||||
|
import com.songoda.ultimatemoderation.UltimateModeration;
|
||||||
|
import com.songoda.ultimatemoderation.command.AbstractCommand;
|
||||||
|
import com.songoda.ultimatemoderation.gui.GUITicketManager;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class CommandTicket extends AbstractCommand {
|
||||||
|
|
||||||
|
public CommandTicket() {
|
||||||
|
super(true, false, "Ticket");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ReturnType runCommand(UltimateModeration instance, CommandSender sender, String... args) {
|
||||||
|
Player senderP = ((Player) sender);
|
||||||
|
|
||||||
|
GUITicketManager.createNew(senderP, senderP);
|
||||||
|
return ReturnType.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> onTab(UltimateModeration instance, CommandSender sender, String... args) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPermissionNode() {
|
||||||
|
return "um.ticket";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSyntax() {
|
||||||
|
return "/ticket";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "Opens the ticket interface.";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -41,7 +41,7 @@ public class GUINotesManager extends AbstractGUI {
|
|||||||
|
|
||||||
createButton(8, Material.OAK_DOOR, plugin.getLocale().getMessage("gui.general.back"));
|
createButton(8, Material.OAK_DOOR, plugin.getLocale().getMessage("gui.general.back"));
|
||||||
|
|
||||||
createButton(6, Material.REDSTONE, plugin.getLocale().getMessage("gui.moderate.create"));
|
createButton(6, Material.REDSTONE, plugin.getLocale().getMessage("gui.notes.create"));
|
||||||
|
|
||||||
for (int i = 0; i < 9; i++)
|
for (int i = 0; i < 9; i++)
|
||||||
createButton(9 + i, Material.GRAY_STAINED_GLASS_PANE, "&1");
|
createButton(9 + i, Material.GRAY_STAINED_GLASS_PANE, "&1");
|
||||||
@ -75,9 +75,9 @@ public class GUINotesManager extends AbstractGUI {
|
|||||||
|
|
||||||
SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");
|
SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");
|
||||||
|
|
||||||
lore.add(plugin.getLocale().getMessage("gui.moderate.createdby", Bukkit.getOfflinePlayer(note.getAuthor()).getName()));
|
lore.add(plugin.getLocale().getMessage("gui.notes.createdby", Bukkit.getOfflinePlayer(note.getAuthor()).getName()));
|
||||||
lore.add(plugin.getLocale().getMessage("gui.moderate.createdon", format.format(new Date(note.getCreationDate()))));
|
lore.add(plugin.getLocale().getMessage("gui.notes.createdon", format.format(new Date(note.getCreationDate()))));
|
||||||
lore.add(plugin.getLocale().getMessage("gui.moderate.remove"));
|
lore.add(plugin.getLocale().getMessage("gui.notes.remove"));
|
||||||
|
|
||||||
createButton(18 + i, Material.MAP, name, lore);
|
createButton(18 + i, Material.MAP, name, lore);
|
||||||
|
|
||||||
@ -94,15 +94,18 @@ public class GUINotesManager extends AbstractGUI {
|
|||||||
@Override
|
@Override
|
||||||
protected void registerClickables() {
|
protected void registerClickables() {
|
||||||
registerClickable(8, ((player1, inventory1, cursor, slot, type) ->
|
registerClickable(8, ((player1, inventory1, cursor, slot, type) ->
|
||||||
new GUIPlayers(plugin, player)));
|
new GUIPlayer(plugin, toModerate, player1)));
|
||||||
|
|
||||||
registerClickable(6, ((player1, inventory1, cursor, slot, type) -> {
|
registerClickable(6, ((player1, inventory1, cursor, slot, type) -> {
|
||||||
player.sendMessage(plugin.getLocale().getMessage("gui.moderate.type"));
|
player.sendMessage(plugin.getLocale().getMessage("gui.notes.type"));
|
||||||
new AbstractChatConfirm(player, event -> {
|
AbstractChatConfirm abstractChatConfirm = new AbstractChatConfirm(player, event -> {
|
||||||
plugin.getPunishmentManager().getPlayer(toModerate).addNotes(new PunishmentNote(event.getMessage(),
|
plugin.getPunishmentManager().getPlayer(toModerate).addNotes(new PunishmentNote(event.getMessage(),
|
||||||
player.getUniqueId(), toModerate.getUniqueId(), System.currentTimeMillis()));
|
player.getUniqueId(), toModerate.getUniqueId(), System.currentTimeMillis()));
|
||||||
constructGUI();
|
constructGUI();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
abstractChatConfirm.setOnClose(() ->
|
||||||
|
init(inventory.getTitle(), inventory.getSize()));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public class GUIPlayer extends AbstractGUI {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.toModerate = toModerate;
|
this.toModerate = toModerate;
|
||||||
|
|
||||||
init(plugin.getLocale().getMessage("gui.player.title", toModerate.getName()), 45);
|
init(plugin.getLocale().getMessage("gui.player.title", toModerate.getName()), 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -34,32 +34,31 @@ public class GUIPlayer extends AbstractGUI {
|
|||||||
createButton(8, Material.OAK_DOOR, plugin.getLocale().getMessage("gui.general.back"));
|
createButton(8, Material.OAK_DOOR, plugin.getLocale().getMessage("gui.general.back"));
|
||||||
|
|
||||||
createButton(28, Material.ANVIL, plugin.getLocale().getMessage("gui.player.punish"));
|
createButton(28, Material.ANVIL, plugin.getLocale().getMessage("gui.player.punish"));
|
||||||
createButton(30, Material.DIAMOND_CHESTPLATE, plugin.getLocale().getMessage("gui.player.moderate"));
|
createButton(30, Material.CHEST, plugin.getLocale().getMessage("gui.player.tickets"));
|
||||||
createButton(32, Material.DIAMOND_SWORD, plugin.getLocale().getMessage("gui.player.punishments"));
|
createButton(32, Material.DIAMOND_SWORD, plugin.getLocale().getMessage("gui.player.punishments"));
|
||||||
createButton(34, Material.MAP, plugin.getLocale().getMessage("gui.player.notes"));
|
createButton(34, Material.MAP, plugin.getLocale().getMessage("gui.player.notes"));
|
||||||
|
createButton(40, Material.DIAMOND_CHESTPLATE, plugin.getLocale().getMessage("gui.player.moderate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerClickables() {
|
protected void registerClickables() {
|
||||||
registerClickable(8, ((player1, inventory1, cursor, slot, type) -> {
|
registerClickable(8, ((player1, inventory1, cursor, slot, type) ->
|
||||||
new GUIPlayers(plugin, player1);
|
new GUIPlayers(plugin, player1)));
|
||||||
}));
|
|
||||||
|
|
||||||
registerClickable(28, ((player1, inventory1, cursor, slot, type) -> {
|
registerClickable(28, ((player1, inventory1, cursor, slot, type) ->
|
||||||
new GUIPunish(plugin, toModerate, null, player1);
|
new GUIPunish(plugin, toModerate, null, player1)));
|
||||||
}));
|
|
||||||
|
|
||||||
registerClickable(30, ((player1, inventory1, cursor, slot, type) -> {
|
registerClickable(30, ((player1, inventory1, cursor, slot, type) ->
|
||||||
new GUIModerate(plugin, toModerate, player1);
|
new GUITicketManager(plugin, toModerate, player1)));
|
||||||
}));
|
|
||||||
|
|
||||||
registerClickable(32, ((player1, inventory1, cursor, slot, type) -> {
|
registerClickable(32, ((player1, inventory1, cursor, slot, type) ->
|
||||||
new GUIPunishments(plugin, toModerate, player1);
|
new GUIPunishments(plugin, toModerate, player1)));
|
||||||
}));
|
|
||||||
|
|
||||||
registerClickable(34, ((player1, inventory1, cursor, slot, type) -> {
|
registerClickable(34, ((player1, inventory1, cursor, slot, type) ->
|
||||||
new GUINotesManager(plugin, toModerate, player1);
|
new GUINotesManager(plugin, toModerate, player1)));
|
||||||
}));
|
|
||||||
|
registerClickable(40, ((player1, inventory1, cursor, slot, type) ->
|
||||||
|
new GUIModerate(plugin, toModerate, player1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,6 +72,7 @@ public class GUIPlayers extends AbstractGUI {
|
|||||||
createButton(48, Material.ARROW, plugin.getLocale().getMessage("gui.general.next"));
|
createButton(48, Material.ARROW, plugin.getLocale().getMessage("gui.general.next"));
|
||||||
|
|
||||||
|
|
||||||
|
createButton(51, Material.CHEST, "&7Tickets");
|
||||||
createButton(52, Material.MAP, plugin.getLocale().getMessage("gui.players.button.templatemanager"));
|
createButton(52, Material.MAP, plugin.getLocale().getMessage("gui.players.button.templatemanager"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,8 +82,11 @@ public class GUIPlayers extends AbstractGUI {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerClickables() {
|
protected void registerClickables() {
|
||||||
registerClickable(52, ((player1, inventory1, cursor, slot, type) ->
|
registerClickable(51, (player1, inventory1, cursor, slot, type) ->
|
||||||
new GUITemplateManager(plugin, player)));
|
new GUITicketManager(plugin, null, player));
|
||||||
|
|
||||||
|
registerClickable(52, (player1, inventory1, cursor, slot, type) ->
|
||||||
|
new GUITemplateManager(plugin, player));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,7 +59,6 @@ public class GUITemplateManager extends AbstractGUI {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
123
src/main/java/com/songoda/ultimatemoderation/gui/GUITicket.java
Normal file
123
src/main/java/com/songoda/ultimatemoderation/gui/GUITicket.java
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
package com.songoda.ultimatemoderation.gui;
|
||||||
|
|
||||||
|
import com.songoda.ultimatemoderation.UltimateModeration;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.Ticket;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketResponse;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketStatus;
|
||||||
|
import com.songoda.ultimatemoderation.utils.AbstractChatConfirm;
|
||||||
|
import com.songoda.ultimatemoderation.utils.gui.AbstractAnvilGUI;
|
||||||
|
import com.songoda.ultimatemoderation.utils.gui.AbstractGUI;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GUITicket extends AbstractGUI {
|
||||||
|
|
||||||
|
private final UltimateModeration plugin;
|
||||||
|
|
||||||
|
private final Ticket ticket;
|
||||||
|
|
||||||
|
private final OfflinePlayer toModerate;
|
||||||
|
|
||||||
|
public GUITicket(UltimateModeration plugin, Ticket ticket, OfflinePlayer toModerate, Player player) {
|
||||||
|
super(player);
|
||||||
|
this.ticket = ticket;
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.toModerate = toModerate;
|
||||||
|
|
||||||
|
init(plugin.getLocale().getMessage("gui.ticket.title", ticket.getTicketId()), 54);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void constructGUI() {
|
||||||
|
inventory.clear();
|
||||||
|
resetClickables();
|
||||||
|
registerClickables();
|
||||||
|
|
||||||
|
createButton(1, Material.ARROW, plugin.getLocale().getMessage("gui.general.previous"));
|
||||||
|
|
||||||
|
createButton(3, Material.ARROW, plugin.getLocale().getMessage("gui.general.next"));
|
||||||
|
|
||||||
|
createButton(8, Material.OAK_DOOR, plugin.getLocale().getMessage("gui.general.back"));
|
||||||
|
|
||||||
|
if (player.hasPermission("um.ticket.openclose"))
|
||||||
|
createButton(5, Material.REDSTONE, "&6" + ticket.getStatus().getStatus());
|
||||||
|
|
||||||
|
createButton(6, Material.REDSTONE, plugin.getLocale().getMessage("gui.ticket.respond"));
|
||||||
|
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
|
createButton(9 + i, Material.GRAY_STAINED_GLASS_PANE, "&1");
|
||||||
|
|
||||||
|
List<TicketResponse> responses = ticket.getResponses();
|
||||||
|
|
||||||
|
for (int i = 0; i < responses.size(); i++) {
|
||||||
|
TicketResponse ticketResponse = responses.get(i);
|
||||||
|
|
||||||
|
String subjectStr = ticketResponse.getMessage();
|
||||||
|
|
||||||
|
ArrayList<String> lore = new ArrayList<>();
|
||||||
|
int lastIndex = 0;
|
||||||
|
for (int n = 0; n < subjectStr.length(); n++) {
|
||||||
|
if (n - lastIndex < 20)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (subjectStr.charAt(n) == ' ') {
|
||||||
|
lore.add("&6" +subjectStr.substring(lastIndex, n).trim());
|
||||||
|
lastIndex = n;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastIndex - subjectStr.length() < 20)
|
||||||
|
lore.add("&6" + subjectStr.substring(lastIndex, subjectStr.length()).trim());
|
||||||
|
|
||||||
|
String name = lore.get(0);
|
||||||
|
lore.remove(0);
|
||||||
|
|
||||||
|
lore.add("");
|
||||||
|
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");
|
||||||
|
|
||||||
|
|
||||||
|
lore.add(plugin.getLocale().getMessage("gui.ticket.postedby", Bukkit.getOfflinePlayer(ticketResponse.getAuthor()).getName() ));
|
||||||
|
lore.add(plugin.getLocale().getMessage("gui.ticket.createdon", format.format(new Date(ticketResponse.getPostedDate()))));
|
||||||
|
|
||||||
|
createButton(18 + i, Material.MAP, name, lore);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerClickables() {
|
||||||
|
if (player.hasPermission("um.ticket.openclose")) {
|
||||||
|
registerClickable(8, ((player1, inventory1, cursor, slot, type) ->
|
||||||
|
new GUITicketManager(plugin, toModerate, player)));
|
||||||
|
}
|
||||||
|
|
||||||
|
registerClickable(5, ((player1, inventory1, cursor, slot, type) -> {
|
||||||
|
ticket.setStatus(ticket.getStatus() == TicketStatus.OPEN ? TicketStatus.CLOSED : TicketStatus.OPEN);
|
||||||
|
constructGUI();
|
||||||
|
}));
|
||||||
|
|
||||||
|
registerClickable(6, ((player1, inventory1, cursor, slot, type) -> {
|
||||||
|
player.sendMessage(plugin.getLocale().getMessage("gui.ticket.what"));
|
||||||
|
AbstractChatConfirm abstractChatConfirm = new AbstractChatConfirm(player, event2 -> {
|
||||||
|
ticket.addResponse(new TicketResponse(player, event2.getMessage(), System.currentTimeMillis()));
|
||||||
|
constructGUI();
|
||||||
|
});
|
||||||
|
|
||||||
|
abstractChatConfirm.setOnClose(() ->
|
||||||
|
init(inventory.getTitle(), inventory.getSize()));
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerOnCloses() {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,156 @@
|
|||||||
|
package com.songoda.ultimatemoderation.gui;
|
||||||
|
|
||||||
|
import com.songoda.ultimatemoderation.UltimateModeration;
|
||||||
|
import com.songoda.ultimatemoderation.punish.PunishmentNote;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.Ticket;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketResponse;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketStatus;
|
||||||
|
import com.songoda.ultimatemoderation.utils.AbstractChatConfirm;
|
||||||
|
import com.songoda.ultimatemoderation.utils.Methods;
|
||||||
|
import com.songoda.ultimatemoderation.utils.gui.AbstractAnvilGUI;
|
||||||
|
import com.songoda.ultimatemoderation.utils.gui.AbstractGUI;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GUITicketManager extends AbstractGUI {
|
||||||
|
|
||||||
|
private final UltimateModeration plugin;
|
||||||
|
|
||||||
|
private final OfflinePlayer toModerate;
|
||||||
|
|
||||||
|
private TicketStatus status = TicketStatus.OPEN;
|
||||||
|
|
||||||
|
public GUITicketManager(UltimateModeration plugin, OfflinePlayer toModerate, Player player) {
|
||||||
|
super(player);
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.toModerate = toModerate;
|
||||||
|
|
||||||
|
init(plugin.getLocale().getMessage(toModerate != null ? "gui.tickets.titlesingle" : "gui.tickets.title", player.getName()), 54);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void constructGUI() {
|
||||||
|
inventory.clear();
|
||||||
|
resetClickables();
|
||||||
|
registerClickables();
|
||||||
|
|
||||||
|
createButton(1, Material.ARROW, plugin.getLocale().getMessage("gui.general.previous"));
|
||||||
|
|
||||||
|
createButton(3 ,Material.DIAMOND_SWORD, Methods.formatText("&6" + status.getStatus()));
|
||||||
|
|
||||||
|
createButton(5, Material.ARROW, plugin.getLocale().getMessage("gui.general.next"));
|
||||||
|
|
||||||
|
if (toModerate != null)
|
||||||
|
createButton(7, Material.REDSTONE, plugin.getLocale().getMessage("gui.tickets.create"));
|
||||||
|
|
||||||
|
if (player.hasPermission("um.ticket"))
|
||||||
|
createButton(8, Material.OAK_DOOR, plugin.getLocale().getMessage("gui.general.back"));
|
||||||
|
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
|
createButton(9 + i, Material.GRAY_STAINED_GLASS_PANE, "&1");
|
||||||
|
|
||||||
|
List<Ticket> tickets = toModerate != null ? plugin.getTicketManager().getTicketsAbout(toModerate, status) : plugin.getTicketManager().getTickets(status);
|
||||||
|
|
||||||
|
for (int i = 0; i < tickets.size(); i++) {
|
||||||
|
Ticket ticket = tickets.get(i);
|
||||||
|
|
||||||
|
String subjectStr = ticket.getSubject();
|
||||||
|
|
||||||
|
ArrayList<String> lore = new ArrayList<>();
|
||||||
|
int lastIndex = 0;
|
||||||
|
for (int n = 0; n < subjectStr.length(); n++) {
|
||||||
|
if (n - lastIndex < 20)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (subjectStr.charAt(n) == ' ') {
|
||||||
|
lore.add("&6" +subjectStr.substring(lastIndex, n).trim());
|
||||||
|
lastIndex = n;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastIndex - subjectStr.length() < 20)
|
||||||
|
lore.add("&6" + subjectStr.substring(lastIndex, subjectStr.length()).trim() + " &7- " + ticket.getTicketId());
|
||||||
|
|
||||||
|
String name = lore.get(0);
|
||||||
|
lore.remove(0);
|
||||||
|
|
||||||
|
lore.add("");
|
||||||
|
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");
|
||||||
|
|
||||||
|
lore.add(plugin.getLocale().getMessage("gui.ticket.status", ticket.getStatus().getStatus()));
|
||||||
|
|
||||||
|
if (toModerate != null)
|
||||||
|
lore.add(plugin.getLocale().getMessage("gui.tickets.player", Bukkit.getOfflinePlayer(ticket.getVictim()).getName()));
|
||||||
|
lore.add(plugin.getLocale().getMessage("gui.ticket.createdon", format.format(new Date(ticket.getCreationDate()))));
|
||||||
|
lore.add(plugin.getLocale().getMessage("gui.tickets.click"));
|
||||||
|
|
||||||
|
createButton(18 + i, Material.MAP, name, lore);
|
||||||
|
|
||||||
|
registerClickable(18 + i, ((player1, inventory1, cursor, slot, type) ->
|
||||||
|
new GUITicket(plugin, ticket, toModerate, player)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerClickables() {
|
||||||
|
if (player.hasPermission("um.ticket")) {
|
||||||
|
registerClickable(8, ((player1, inventory1, cursor, slot, type) -> {
|
||||||
|
if (toModerate == null)
|
||||||
|
new GUIPlayers(plugin, player);
|
||||||
|
else
|
||||||
|
new GUIPlayer(plugin, toModerate, player1);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
registerClickable(3, ((player1, inventory1, cursor, slot, type) -> {
|
||||||
|
this.status = status == TicketStatus.OPEN ? TicketStatus.CLOSED : TicketStatus.OPEN;
|
||||||
|
constructGUI();
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (toModerate != null) {
|
||||||
|
registerClickable(7, ((player1, inventory1, cursor, slot, type) ->
|
||||||
|
createNew(player, toModerate)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void createNew(Player player, OfflinePlayer toModerate) {
|
||||||
|
UltimateModeration plugin = UltimateModeration.getInstance();
|
||||||
|
|
||||||
|
AbstractAnvilGUI gui = new AbstractAnvilGUI(player, event -> {
|
||||||
|
Ticket ticket = new Ticket(toModerate, event.getName());
|
||||||
|
|
||||||
|
player.sendMessage(plugin.getLocale().getMessage("gui.tickets.what"));
|
||||||
|
AbstractChatConfirm abstractChatConfirm = new AbstractChatConfirm(player, event2 -> {
|
||||||
|
plugin.getTicketManager().addTicket(ticket);
|
||||||
|
|
||||||
|
ticket.addResponse(new TicketResponse(player, event2.getMessage(), System.currentTimeMillis()));
|
||||||
|
});
|
||||||
|
|
||||||
|
abstractChatConfirm.setOnClose(() ->
|
||||||
|
new GUITicket(plugin, ticket, toModerate, player));
|
||||||
|
});
|
||||||
|
|
||||||
|
ItemStack item = new ItemStack(Material.PAPER);
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
meta.setDisplayName(plugin.getLocale().getMessage("gui.tickets.subject"));
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
|
||||||
|
gui.setSlot(AbstractAnvilGUI.AnvilSlot.INPUT_LEFT, item);
|
||||||
|
gui.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerOnCloses() {
|
||||||
|
}
|
||||||
|
}
|
@ -5,9 +5,13 @@ import com.songoda.ultimatemoderation.punish.AppliedPunishment;
|
|||||||
import com.songoda.ultimatemoderation.punish.PunishmentNote;
|
import com.songoda.ultimatemoderation.punish.PunishmentNote;
|
||||||
import com.songoda.ultimatemoderation.punish.player.PlayerPunishData;
|
import com.songoda.ultimatemoderation.punish.player.PlayerPunishData;
|
||||||
import com.songoda.ultimatemoderation.punish.template.Template;
|
import com.songoda.ultimatemoderation.punish.template.Template;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.Ticket;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketResponse;
|
||||||
|
import com.songoda.ultimatemoderation.tickets.TicketStatus;
|
||||||
import com.songoda.ultimatemoderation.utils.ConfigWrapper;
|
import com.songoda.ultimatemoderation.utils.ConfigWrapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public abstract class Storage {
|
public abstract class Storage {
|
||||||
|
|
||||||
@ -61,6 +65,20 @@ public abstract class Storage {
|
|||||||
new StorageItem("creation", note.getCreationDate()));
|
new StorageItem("creation", note.getCreationDate()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Ticket ticket : instance.getTicketManager().getTickets()) {
|
||||||
|
prepareSaveItem("tickets", new StorageItem("id", ticket.getTicketId()),
|
||||||
|
new StorageItem("player", ticket.getVictim().toString()),
|
||||||
|
new StorageItem("subject", ticket.getSubject()),
|
||||||
|
new StorageItem("status", ticket.getStatus().toString()));
|
||||||
|
|
||||||
|
for (TicketResponse ticketResponse : ticket.getResponses()) {
|
||||||
|
prepareSaveItem("ticketresponses", new StorageItem("posted", ticketResponse.getPostedDate()),
|
||||||
|
new StorageItem("ticketid", ticket.getTicketId()),
|
||||||
|
new StorageItem("author", ticketResponse.getAuthor().toString()),
|
||||||
|
new StorageItem("message", ticketResponse.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void doSave();
|
public abstract void doSave();
|
||||||
|
@ -58,7 +58,7 @@ public class StorageYaml extends Storage {
|
|||||||
public void prepareSaveItem(String group, StorageItem... items) {
|
public void prepareSaveItem(String group, StorageItem... items) {
|
||||||
for (StorageItem item : items) {
|
for (StorageItem item : items) {
|
||||||
if (item == null || item.asObject() == null) continue;
|
if (item == null || item.asObject() == null) continue;
|
||||||
toSave.put("data." + group + "." + items[0].asString() + "." + item.getKey(), item.asObject());
|
toSave.put("data." + group + "." + items[0].asObject()+ "." + item.getKey(), item.asObject());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.songoda.ultimatemoderation.tickets;
|
||||||
|
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class Ticket {
|
||||||
|
|
||||||
|
private int ticketId;
|
||||||
|
|
||||||
|
private TicketStatus status = TicketStatus.OPEN;
|
||||||
|
|
||||||
|
private final List<TicketResponse> tickets = new ArrayList<>();
|
||||||
|
private final UUID victim;
|
||||||
|
private final String subject;
|
||||||
|
|
||||||
|
public Ticket(OfflinePlayer victim, String subject) {
|
||||||
|
this.victim = victim.getUniqueId();
|
||||||
|
this.subject = subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ticket(UUID victim, String subject) {
|
||||||
|
this.victim = victim;
|
||||||
|
this.subject = subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ticket(OfflinePlayer victim, String subject, TicketResponse response) {
|
||||||
|
this.victim = victim.getUniqueId();
|
||||||
|
this.subject = subject;
|
||||||
|
this.tickets.add(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ticket(UUID victim, String subject, TicketResponse response) {
|
||||||
|
this.victim = victim;
|
||||||
|
this.subject = subject;
|
||||||
|
this.tickets.add(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTicketId() {
|
||||||
|
return ticketId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicketId(int ticketId) {
|
||||||
|
this.ticketId = ticketId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TicketResponse> getResponses() {
|
||||||
|
return new ArrayList<>(tickets);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TicketResponse addResponse(TicketResponse response) {
|
||||||
|
response.setTicketId(ticketId);
|
||||||
|
tickets.add(response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TicketResponse removeResponse(TicketResponse response) {
|
||||||
|
tickets.remove(response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getVictim() {
|
||||||
|
return victim;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubject() {
|
||||||
|
return subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getCreationDate() {
|
||||||
|
return tickets.get(0).getPostedDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TicketStatus getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(TicketStatus status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.songoda.ultimatemoderation.tickets;
|
||||||
|
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class TicketManager {
|
||||||
|
|
||||||
|
private final TreeMap<Integer, Ticket> registeredTickets = new TreeMap<>();
|
||||||
|
|
||||||
|
public Ticket addTicket(Ticket ticket) {
|
||||||
|
int id = registeredTickets.isEmpty() ? 1 : registeredTickets.lastEntry().getValue().getTicketId() + 1;
|
||||||
|
ticket.setTicketId(id);
|
||||||
|
return addTicket(ticket, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ticket addTicket(Ticket ticket, int id) {
|
||||||
|
registeredTickets.put(id, ticket);
|
||||||
|
return ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ticket getTicket(int id) {
|
||||||
|
return registeredTickets.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Ticket> getTickets() {
|
||||||
|
return new ArrayList<>(registeredTickets.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Ticket> getTickets(TicketStatus status) {
|
||||||
|
return registeredTickets.values().stream().filter(ticket -> ticket.getStatus() == status).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Ticket> getTicketsAbout(OfflinePlayer player, TicketStatus status) {
|
||||||
|
return getTicketsAbout(player.getUniqueId(), status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Ticket> getTicketsAbout(UUID player, TicketStatus status) {
|
||||||
|
return registeredTickets.values().stream()
|
||||||
|
.filter(ticket -> ticket.getVictim().equals(player) && ticket.getStatus() == status).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.songoda.ultimatemoderation.tickets;
|
||||||
|
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class TicketResponse {
|
||||||
|
|
||||||
|
private int ticketId;
|
||||||
|
|
||||||
|
private final UUID author;
|
||||||
|
private final String message;
|
||||||
|
private final long posted;
|
||||||
|
|
||||||
|
public TicketResponse(OfflinePlayer author, String message, long posted) {
|
||||||
|
this.author = author.getUniqueId();
|
||||||
|
this.message = message;
|
||||||
|
this.posted = posted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TicketResponse(UUID author, String message, long posted) {
|
||||||
|
this.author = author;
|
||||||
|
this.message = message;
|
||||||
|
this.posted = posted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTicketId() {
|
||||||
|
return ticketId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicketId(int ticketId) {
|
||||||
|
this.ticketId = ticketId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPostedDate() {
|
||||||
|
return posted;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.songoda.ultimatemoderation.tickets;
|
||||||
|
|
||||||
|
public enum TicketStatus {
|
||||||
|
|
||||||
|
OPEN("Open"),
|
||||||
|
CLOSED("Closed");
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
TicketStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
@ -4,10 +4,10 @@ import com.songoda.ultimatemoderation.UltimateModeration;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -18,26 +18,24 @@ public class AbstractChatConfirm implements Listener {
|
|||||||
|
|
||||||
private static final List<UUID> registered = new ArrayList<>();
|
private static final List<UUID> registered = new ArrayList<>();
|
||||||
|
|
||||||
private Inventory inventory;
|
|
||||||
|
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private final ChatConfirmHandler handler;
|
private final ChatConfirmHandler handler;
|
||||||
|
|
||||||
|
private OnClose onClose = null;
|
||||||
|
|
||||||
public AbstractChatConfirm(Player player, ChatConfirmHandler hander) {
|
public AbstractChatConfirm(Player player, ChatConfirmHandler hander) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.handler = hander;
|
this.handler = hander;
|
||||||
this.inventory = player.getOpenInventory() == null ? null : player.getOpenInventory().getTopInventory();
|
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
initializeListeners(UltimateModeration.getInstance());
|
initializeListeners(UltimateModeration.getInstance());
|
||||||
registered.add(player.getUniqueId());
|
registered.add(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean listenersInitialized = false;
|
private Listener listener;
|
||||||
|
|
||||||
public void initializeListeners(JavaPlugin plugin) {
|
public void initializeListeners(JavaPlugin plugin) {
|
||||||
if (listenersInitialized) return;
|
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(new Listener() {
|
this.listener = new Listener() {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChat(AsyncPlayerChatEvent event) {
|
public void onChat(AsyncPlayerChatEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
@ -50,15 +48,15 @@ public class AbstractChatConfirm implements Listener {
|
|||||||
|
|
||||||
handler.onChat(chatConfirmEvent);
|
handler.onChat(chatConfirmEvent);
|
||||||
|
|
||||||
if (inventory != null) player.openInventory(inventory);
|
if (onClose != null) {
|
||||||
|
onClose.onClose();
|
||||||
|
}
|
||||||
|
HandlerList.unregisterAll(listener);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
Bukkit.getPluginManager().registerEvents(listener, UltimateModeration.getInstance());
|
||||||
AbstractChatConfirm.unregister(event.getPlayer());
|
|
||||||
}
|
|
||||||
}, plugin);
|
|
||||||
listenersInitialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isRegistered(Player player) {
|
public static boolean isRegistered(Player player) {
|
||||||
@ -73,6 +71,14 @@ public class AbstractChatConfirm implements Listener {
|
|||||||
void onChat(ChatConfirmEvent event);
|
void onChat(ChatConfirmEvent event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnClose(OnClose onClose) {
|
||||||
|
this.onClose = onClose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnClose {
|
||||||
|
void onClose();
|
||||||
|
}
|
||||||
|
|
||||||
public class ChatConfirmEvent {
|
public class ChatConfirmEvent {
|
||||||
|
|
||||||
private final Player player;
|
private final Player player;
|
||||||
|
@ -81,8 +81,6 @@ gui.templatemanager.create = "&6&lCreate Template"
|
|||||||
gui.templatemanager.leftclick = "&7Left-Click to edit."
|
gui.templatemanager.leftclick = "&7Left-Click to edit."
|
||||||
gui.templatemanager.rightclick = "&7Right-Click to destroy."
|
gui.templatemanager.rightclick = "&7Right-Click to destroy."
|
||||||
|
|
||||||
gui.notes.title = "&8%toModerate% > Notes"
|
|
||||||
|
|
||||||
gui.punishments.title = "&8%toModerate% > Punish"
|
gui.punishments.title = "&8%toModerate% > Punish"
|
||||||
gui.punishments.reason = "&6Reason"
|
gui.punishments.reason = "&6Reason"
|
||||||
gui.punishments.duration = "&6Initial Duration"
|
gui.punishments.duration = "&6Initial Duration"
|
||||||
@ -129,10 +127,29 @@ gui.player.punish = "&6&lPunish"
|
|||||||
gui.player.moderate = "&b&lModerate"
|
gui.player.moderate = "&b&lModerate"
|
||||||
gui.player.punishments = "&c&lPunishments"
|
gui.player.punishments = "&c&lPunishments"
|
||||||
gui.player.notes = "&a&lNotes"
|
gui.player.notes = "&a&lNotes"
|
||||||
|
gui.player.tickets = "&7&lTickets"
|
||||||
|
|
||||||
gui.moderate.title = "&8%toModerate% > Moderate"
|
gui.moderate.title = "&8%toModerate% > Moderate"
|
||||||
gui.moderate.create = "&6Create Note"
|
|
||||||
gui.moderate.remove = "&cClick to remove"
|
gui.notes.title = "&8%tonotes% > Notes"
|
||||||
gui.moderate.type = "Type in your note."
|
gui.notes.create = "&6Create Note"
|
||||||
gui.moderate.createdon = "&7Created on &6%time%&7."
|
gui.notes.remove = "&cClick to remove"
|
||||||
gui.moderate.createdby = "&7Created by &6%player%&7."
|
gui.notes.type = "Type in your note."
|
||||||
|
gui.notes.createdon = "&7Created on &6%time%&7."
|
||||||
|
gui.notes.createdby = "&7Created by &6%player%&7."
|
||||||
|
|
||||||
|
|
||||||
|
gui.tickets.title = "&8Tickets"
|
||||||
|
gui.tickets.titlesingle = "&8%toModerate% > Tickets"
|
||||||
|
gui.tickets.create = "&6Create a ticket"
|
||||||
|
gui.tickets.click = "&6Click to Manage."
|
||||||
|
gui.tickets.player = "&7Player &6%player%&7."
|
||||||
|
gui.tickets.what = "&6What would you like to say in your first ticket post?"
|
||||||
|
gui.tickets.subject = "Ticket Subject"
|
||||||
|
|
||||||
|
gui.ticket.title = "&8Tickets > %id%";
|
||||||
|
gui.ticket.createdon = "&7Created on &6%time%&7."
|
||||||
|
gui.ticket.respond = "&6Respond"
|
||||||
|
gui.ticket.status = "&7Status &6%status%&7."
|
||||||
|
gui.ticket.postedby = "&7Posted by &6%player%&7."
|
||||||
|
gui.ticket.what = "&6What would you like to say?"
|
@ -83,4 +83,8 @@ commands:
|
|||||||
RunTemplate:
|
RunTemplate:
|
||||||
description: RunTemplate
|
description: RunTemplate
|
||||||
defaullt: false
|
defaullt: false
|
||||||
usage: /runtemplate
|
usage: /runtemplate
|
||||||
|
Ticket:
|
||||||
|
description: Ticket
|
||||||
|
defaullt: false
|
||||||
|
usage: /ticket
|
Loading…
Reference in New Issue
Block a user