Compare commits
No commits in common. "main" and "0.0.1" have entirely different histories.
216
README.md
216
README.md
|
@ -1,216 +0,0 @@
|
||||||
**This project has been moved to Github.**
|
|
||||||
## https://github.com/xeno-fi/aquamarine
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---------
|
|
||||||
|
|
||||||
|
|
||||||
<div style="text-align: center;">
|
|
||||||
<img src="https://lehtodigital.fi/f/j62zZ" width="400">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
**Aquamarine** is an open source ticket plugin for Spigot servers.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
- 📙 MySQL/MariaDB support (but also flat-file, if you want it simple)
|
|
||||||
- ✅ Simple permissions
|
|
||||||
- 🚫 Configurable limits for open tickets per player or inside a radius
|
|
||||||
- 📝 GUI and commands - easy access for everyone
|
|
||||||
- 💬 Discord webhook support
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
1. [Download](https://git.lehtodigital.fi:2443/xeno-open-source/aquamarine/-/releases) the .jar file
|
|
||||||
2. Move the .jar file to your server's plugins folder
|
|
||||||
3. Restart your server
|
|
||||||
4. Configure the plugin on `plugins/aquamarine/config.yml` (see details further down)
|
|
||||||
5. Restart your server again
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
### Player commands
|
|
||||||
- `/ticket [message]`
|
|
||||||
- Will open a new ticket in the current location
|
|
||||||
- Aliases: `/apupyyntö`, `/avunpyyntö`, `/tiketti`, `/helpop`
|
|
||||||
|
|
||||||
|
|
||||||
- `/tickets`
|
|
||||||
- Shows a list of your recent tickets
|
|
||||||
- Aliases: `/apupyynnöt`, `/avunpyynnöt`, `/tiketit`
|
|
||||||
|
|
||||||
### Staff commands
|
|
||||||
- `/xt`
|
|
||||||
- Lists unresolved (open) tickets
|
|
||||||
- `/xt help`
|
|
||||||
- Shows a help index
|
|
||||||
- `/xt all` and `/xt all [page]`
|
|
||||||
- Lists all tickets (including open and closed tickets)
|
|
||||||
- `/xt player [name]` and `/xt player [name] [page]`
|
|
||||||
- Lists all tickets created by a player
|
|
||||||
- `/xt view [id]`
|
|
||||||
- Shows a certain ticket
|
|
||||||
- `/xt goto [id]`
|
|
||||||
- Teleports you to a certain ticket
|
|
||||||
- `/xt solve [id]` and `/xt solve [id] [comment]`
|
|
||||||
- Solves (closes) a ticket, with or without a comment (visible to the player)
|
|
||||||
|
|
||||||
|
|
||||||
- `/xti`
|
|
||||||
- Shows the ticket GUI
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Permissions
|
|
||||||
- `aquamarine.staff`
|
|
||||||
- Permission to list and solve (close) tickets
|
|
||||||
|
|
||||||
|
|
||||||
- `aquamarine.ticket`
|
|
||||||
- Permission to open new tickets
|
|
||||||
|
|
||||||
|
|
||||||
## Configuring
|
|
||||||
|
|
||||||
**Storage methods** available are
|
|
||||||
- `file` (flat-file as JSON in the plugin folder)
|
|
||||||
- `mysql` (MySQL/MariaDB, configure the connection below), or
|
|
||||||
- `memory` (**not persistent** - will not save anything)
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
storage-method: "file"
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Database connection** - configure your MySQL/MariaDB connection
|
|
||||||
if you use `mysql` as your storage method.
|
|
||||||
Otherwise these settings can be ignored.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
mysql-host: localhost
|
|
||||||
mysql-port: 3306
|
|
||||||
mysql-user: user
|
|
||||||
mysql-pass: pass
|
|
||||||
mysql-db: database
|
|
||||||
mysql-table: aquamarine_tickets
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Max tickets per radius** - this setting will limit the ability to create tickets
|
|
||||||
close to each other (inside a radius). For example, with the settings below,
|
|
||||||
only 3 tickets can be opened simultaneously within a 5 block radius.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
enable-max-per-radius: true
|
|
||||||
check-radius: 5.0
|
|
||||||
max-per-radius: 3
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Max tickets per player** - this setting will limit the player's ability
|
|
||||||
to create tickets while old ones have not been resolved.
|
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
enable-max-per-player: true
|
|
||||||
max-per-player: 3
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Message prefix** - used in the beginning of every system message sent by this plugin
|
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
message-prefix: "&8[&bAquamarine&8] &7"
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Date format** - used when displaying dates and times
|
|
||||||
in the GUI and the chat view of tickets.
|
|
||||||
Uses [SimpleDateFormat](https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html).
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
date-format: "dd.MM.yyyy kk:mm:ss" # (SimpleDateFormat)
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Join announcement** - when a player with admin/moderator permissions joins,
|
|
||||||
they will be notified about unresolved tickets.
|
|
||||||
Set the delay of the announcement in seconds.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
enable-join-announce: true
|
|
||||||
join-announce-delay-seconds: 5
|
|
||||||
```
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
**Discord webhook** - enable this and add a webhook URL to receive
|
|
||||||
announcements about new tickets to your Discord server.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
enable-webhook: false
|
|
||||||
webhook-url: https://example.com/
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## In English?
|
|
||||||
The plugin's built-in language file is written in Finnish.
|
|
||||||
Copy and paste the following to the `lang.yml` file to use the plugin in English:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# Language file for XAquamarine
|
|
||||||
generic-no-permission: "You don't have the permission to do that."
|
|
||||||
generic-not-player: "This command only works for players."
|
|
||||||
generic-invalid-number: "Invalid number: &b$n$"
|
|
||||||
generic-ticket-not-found: "The ticket was not found."
|
|
||||||
generic-invalid-ticket: "Invalid ticket or ticket world. Are all worlds loaded?"
|
|
||||||
generic-invalid-player: "No such player '$player$'. Are you sure that they have played here with that name?"
|
|
||||||
generic-no-tickets: "No tickets were found."
|
|
||||||
generic-previous: "Previous"
|
|
||||||
generic-next: "Next"
|
|
||||||
generic-page: "Page "
|
|
||||||
|
|
||||||
gui-click-teleport: "Left-click to teleport"
|
|
||||||
gui-click-solve: "Right-click to resolve"
|
|
||||||
|
|
||||||
command-ticket-usage: "Usage: &b/$label$ [message]"
|
|
||||||
command-ticket-goto-usage: "Usage: &b/$label$ goto [id]"
|
|
||||||
command-ticket-goto-teleport: "Woosh! And here we are."
|
|
||||||
command-ticket-solve-usage: "Usage: &b/$label$ solve [id] [optional message]"
|
|
||||||
command-ticket-solved: "&b$solver$ &7resolved the ticket &b#$n$&7: &f&o$comment$"
|
|
||||||
command-ticket-view-usage: "Usage: &b/$label$ view [id]"
|
|
||||||
command-ticket-player-usage: "Usage: &b/$label$ player [player] [page]"
|
|
||||||
|
|
||||||
ticket-deny-nearby: "You may not open a new ticket here, as several tickets have already been opened nearby."
|
|
||||||
ticket-deny-player: "You may not open a new ticket, as you already have several unresolved tickets waiting."
|
|
||||||
|
|
||||||
ticket-created: "You opened a new ticket. Number: &b$ticketId$"
|
|
||||||
ticket-created-announcement: "&b$player$ &7opened a new ticket &b#$ticketId$&7:"
|
|
||||||
ticket-join-announcement: "There are &b$ticketCount$ unsolved tickets waiting"
|
|
||||||
|
|
||||||
ticket-preview-teleport: "Teleport"
|
|
||||||
ticket-preview-solve: "Mark as resolved"
|
|
||||||
|
|
||||||
ticket-hover-title: "&bTicket #$ticketId$"
|
|
||||||
ticket-hover-sender: "&7Sent by: &f%s"
|
|
||||||
ticket-hover-timestamp: "&7Timestamp: &f%s"
|
|
||||||
ticket-hover-location: "&7Location: &f%s"
|
|
||||||
|
|
||||||
ticket-hover-solver: "&7Solved by: &f%s"
|
|
||||||
ticket-hover-solved-at: "&7Solved: &f%s"
|
|
||||||
ticket-hover-comment: "&7Comment:"
|
|
||||||
```
|
|
|
@ -24,5 +24,5 @@ permissions:
|
||||||
description: Permission to open new tickets
|
description: Permission to open new tickets
|
||||||
aquamarine.staff:
|
aquamarine.staff:
|
||||||
description: Permission to teleport to tickets and solve them
|
description: Permission to teleport to tickets and solve them
|
||||||
version: 0.1.1
|
version: 0.1.0
|
||||||
main: fi.xeno.aquamarine.XTicketsPlugin
|
main: fi.xeno.aquamarine.XTicketsPlugin
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>fi.xeno</groupId>
|
<groupId>fi.xeno</groupId>
|
||||||
<artifactId>aquamarine</artifactId>
|
<artifactId>aquamarine</artifactId>
|
||||||
<version>0.1.1</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<name>XAquamarine</name>
|
<name>XAquamarine</name>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package fi.xeno.aquamarine;
|
package fi.xeno.aquamarine;
|
||||||
|
|
||||||
import fi.xeno.aquamarine.command.CommandTicket;
|
import fi.xeno.aquamarine.command.CommandTicket;
|
||||||
import fi.xeno.aquamarine.command.CommandTickets;
|
|
||||||
import fi.xeno.aquamarine.command.CommandXt;
|
import fi.xeno.aquamarine.command.CommandXt;
|
||||||
import fi.xeno.aquamarine.command.CommandXti;
|
import fi.xeno.aquamarine.command.CommandXti;
|
||||||
import fi.xeno.aquamarine.sql.XHikariDatabase;
|
import fi.xeno.aquamarine.sql.XHikariDatabase;
|
||||||
|
@ -97,7 +96,6 @@ public class XTicketsPlugin extends JavaPlugin {
|
||||||
Bukkit.getPluginManager().registerEvents(ticketManager, this);
|
Bukkit.getPluginManager().registerEvents(ticketManager, this);
|
||||||
|
|
||||||
registerCommand("ticket", new CommandTicket(this, ticketManager));
|
registerCommand("ticket", new CommandTicket(this, ticketManager));
|
||||||
registerCommand("tickets", new CommandTickets(this, ticketManager));
|
|
||||||
registerCommand("xt", new CommandXt(this, ticketManager));
|
registerCommand("xt", new CommandXt(this, ticketManager));
|
||||||
|
|
||||||
CommandXti ticketGuiCommand = new CommandXti(this, ticketManager);
|
CommandXti ticketGuiCommand = new CommandXti(this, ticketManager);
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
package fi.xeno.aquamarine.command;
|
|
||||||
|
|
||||||
import fi.xeno.aquamarine.AquamarinePermission;
|
|
||||||
import fi.xeno.aquamarine.XTicketManager;
|
|
||||||
import fi.xeno.aquamarine.XTicketsPlugin;
|
|
||||||
import fi.xeno.aquamarine.util.XTicket;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.command.TabExecutor;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.StringJoiner;
|
|
||||||
|
|
||||||
public class CommandTickets implements TabExecutor {
|
|
||||||
|
|
||||||
private final XTicketsPlugin plugin;
|
|
||||||
private final XTicketManager ticketManager;
|
|
||||||
|
|
||||||
public CommandTickets(XTicketsPlugin plugin, XTicketManager ticketManager) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.ticketManager = ticketManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
|
||||||
|
|
||||||
if (!sender.hasPermission(AquamarinePermission.CREATE_TICKET)) {
|
|
||||||
sender.sendMessage(plugin.lang("generic-no-permission"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(sender instanceof Player)) {
|
|
||||||
sender.sendMessage("§cThis command can only be executed by a player.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Player player = (Player)sender;
|
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
|
||||||
|
|
||||||
List<XTicket> tickets = ticketManager.getStorage().getTicketsBySender(player.getUniqueId());
|
|
||||||
|
|
||||||
if (tickets.size() == 0) {
|
|
||||||
plugin.sendPrefixed(plugin.lang("generic-no-tickets"), player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tickets.stream()
|
|
||||||
.filter(xt -> System.currentTimeMillis() - xt.getTimestamp() <= 1000L*60*60*24*14)
|
|
||||||
.forEach(xt -> player.spigot().sendMessage(xt.renderChatPreview(false, true)));
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -158,9 +158,9 @@ public class XTicket {
|
||||||
String solvedString = "";
|
String solvedString = "";
|
||||||
if (this.isSolved) {
|
if (this.isSolved) {
|
||||||
|
|
||||||
solvedString = "\n" + String.format(plugin.lang("ticket-hover-solver"), this.solvedByName) + "\n" +
|
solvedString = String.format(plugin.lang("ticket-hover-solver"), this.solvedByName) + "\n" +
|
||||||
String.format(plugin.lang("ticket-hover-solved-at"), plugin.formatTimestamp(this.timeSolved)) + "\n" +
|
String.format(plugin.lang("ticket-hover-solved-at"), plugin.formatTimestamp(this.timeSolved)) + "\n" +
|
||||||
plugin.lang("ticket-hover-comment") + " §f§o" + XText.wordWrap(this.solveComment, 40);
|
plugin.lang("ticket-hover-comment") + "§f§o" + XText.wordWrap(this.solveComment, 40);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user