Compare commits

...

45 Commits

Author SHA1 Message Date
songoda-plugins-overview[bot] 89db325408
Updates contents of README.md (#3)
Co-authored-by: songoda-plugins-overview[bot] <111250264+songoda-plugins-overview[bot]@users.noreply.github.com>
2024-04-18 19:20:01 +02:00
craftaro-plugins-overview[bot] 4c2e95b76d
Updates contents of README.md 2024-03-07 20:52:52 +00:00
Christian Koop dc76f7e8e6
Adds plugin logo at docs/Logo.png 2024-03-07 21:41:36 +01:00
craftaro-plugins-overview[bot] 9c011f1ccb
Updates contents of README.md (#2)
Co-authored-by: craftaro-plugins-overview[bot] <111250264+craftaro-plugins-overview[bot]@users.noreply.github.com>
2023-07-20 17:11:14 +02:00
ceze88 e68404aebd Release 2.0.15 2023-04-13 14:29:21 +02:00
ceze88 cee3279061 Updates SongodaCore to v2.6.19 2023-04-13 14:28:57 +02:00
ceze88 fed6c8f56f Release 2.0.15-BETA 2023-03-29 22:18:37 +02:00
ceze88 e76289b1c5 Updates SongodaCore to v2.6.19-DEV 2023-03-29 22:18:17 +02:00
Christian Koop 5cad6c0e0a
Switch LICENSE to CC BY-NC-ND 4.0
Co-authored-by: Eli Rickard <38917063+EliRickard@users.noreply.github.com>
2023-03-29 21:21:14 +02:00
ceze88 bb99fae5c9 Release v2.0.14 2023-01-25 17:11:23 +01:00
Christian Koop aa8fdb19ec
Release v2.0.14-DEV 2023-01-12 20:21:13 +01:00
Christian Koop 1d9e532f2f
Updates SongodaCore to v2.6.18-DEV 2023-01-12 20:20:10 +01:00
ceze88 32ddee809c Bump SongodaCore version to 2.6.17 2022-12-29 18:31:55 +01:00
Christian Koop cb8c50e70f
Merge branch 'development' 2022-09-06 21:23:44 +02:00
Christian Koop 1845b1fce7
Release v2.0.12 2022-09-06 21:23:40 +02:00
Christian Koop cd578df85f
Update `maven-shade-plugin` to v3.3.0 2022-09-06 21:23:32 +02:00
songoda-projects-overview[bot] 546d3e58b8 Bump SongodaCore version to `2.6.16` 2022-09-05 22:18:32 +02:00
songoda-projects-overview[bot] 6a52d7e188 Bump SongodaCore version to `2.6.15-DEV` 2022-08-15 00:49:20 +02:00
ceze88 2b0f1b4b23 Remove deprecated methods, fix MySQL 2022-08-14 11:53:38 +02:00
Christian Koop 4ed9b5e1c5
Merge branch 'development' 2022-07-07 20:47:42 +02:00
Christian Koop 58f76c3342
Release v2.0.11 2022-07-07 20:47:35 +02:00
Christian Koop 5a8ff8dd33
Updates SongodaCore to v2.6.13 2022-07-07 20:47:20 +02:00
Christian Koop 28cdb97301
Merge branch 'development' 2022-03-20 11:32:35 +01:00
Christian Koop 43f94540aa
Release v2.0.10 2022-03-20 11:32:26 +01:00
Christian Koop 3575c508f8
Updates Core to v2.6.12 2022-03-18 21:35:27 +01:00
Christian Koop fc46312f1c
Merge branch 'development' 2022-02-15 21:17:39 +01:00
Christian Koop dd29b7b49b
Release v2.0.9 2022-02-15 21:17:31 +01:00
Christian Koop f8cde33d59
Removes useless dependencies 2022-02-15 21:17:14 +01:00
Christian Koop 008eb27b3a
Merge branch 'development' 2022-01-29 15:06:28 +01:00
Christian Koop 7965ac5865
Version v2.0.8 2022-01-29 15:05:47 +01:00
Christian Koop 5db67e1b1e
Updates SongodaCore to v2.6.11 2022-01-29 15:04:56 +01:00
Christian Koop 7982d7e2f6
Merge branch 'development' 2021-12-09 05:00:28 +01:00
Christian Koop d0c8e50c8e
Version 2.0.7 2021-12-09 04:58:28 +01:00
Christian Koop e0f42f6665
Update SongodaCore from `LATEST` to `2.6.3` (MC 1.18 compatibility) 2021-12-09 04:58:17 +01:00
Christian Koop 714ab2a14b
Replace dependency `spigot` v1.17 with `spigot-api` v1.18 2021-12-02 18:18:24 +01:00
Christian Koop d3c5e09072
Cleanup pom.xml 2021-12-02 18:17:58 +01:00
Christian Koop 74bcd22974
Fixes normal Inventory being opened instead of EnderChest-Inventory
closes #1
2021-11-21 19:29:17 +01:00
Christian Koop 687ba7bb1b
Merge branch 'development' 2021-10-27 20:14:53 +02:00
Christian Koop fb06833b27
Version 2.0.6 2021-10-27 20:13:31 +02:00
Christian Koop ae418a7a73
Fix Pagination in Template GUI [SD-8499] 2021-09-25 13:54:25 +02:00
Brianna fba65a23be Merge branch 'development' 2021-06-13 11:49:14 -05:00
Brianna be8d660cb0 version 2.0.5 2021-06-13 11:49:04 -05:00
Brianna ab4ba023dd 1.17 Support 2021-06-13 11:48:48 -05:00
Brianna 8f74226a87 Merge branch 'development' 2021-01-15 14:53:33 -06:00
Brianna 851e4afb1a version 2.0.4b 2021-01-15 14:53:24 -06:00
10 changed files with 626 additions and 191 deletions

328
LICENSE
View File

@ -1,9 +1,327 @@
Copyright (c) 2018 Brianna OKeefe
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
International Public License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software with minimal restriction, including the rights to use, copy, modify or merge while excluding the rights to publish, (re)distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-NoDerivatives 4.0 International Public
License ("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
The same distribution rights and limitations above shall similarly apply to any and all source code, and other means that can be used to emulate this work.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Section 1 -- Definitions.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
c. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
d. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
e. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
f. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
g. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
h. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce and reproduce, but not Share, Adapted Material
for NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material, You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
For the avoidance of doubt, You do not have permission under
this Public License to Share Adapted Material.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only and provided You do not Share Adapted Material;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================

View File

@ -1 +1,43 @@
ultimatemoderation
<!--suppress HtmlDeprecatedAttribute -->
<div align="center">
<img src="docs/Logo.png" width="128px">
# UltimateModeration
**Take complete control over your server with punishment templates via a simplified yet powerful moderation system**
[![Discord][Discord shield]][Discord invite]
<br>
[![Latest version][Latest version shield]][Plugin page]
[![bStats Servers][bStats shield]][bStats page]
</div>
## Download (Marketplace)
You can visit [our marketplace][Plugin page] to download UltimateModeration as well as take a
look at many other fantastic plugins which are sure to catch your eye.
## Documentation
You can find all the information about UltimateModeration, including dependencies, commands, permissions and incompatible
plugins on [our wiki][Plugin wiki].
Feel free to also contribute to the wiki as a way to help others in the community with using the plugin.
## Support
If you encounter any issues while using the plugin, feel free to contact us on
[our Discord server][Discord invite].
## Suggestions
For suggestions about features you think should be added to the plugin to increase its functionality, feel free to
create a thread over on [our Discord server][Discord invite].
[Plugin page]: https://songoda.com/product/15
[Plugin wiki]: https://songoda.notion.site/UltimateModeration-5864be55f762467a8accedc9368a53a2
[Discord invite]: https://discord.gg/7TXM8xr2Ng
[Discord shield]: https://img.shields.io/discord/1214289374506917889?color=5865F2&label=Discord&logo=discord&logoColor=5865F2
[Latest version shield]: https://img.shields.io/badge/dynamic/xml?style=flat&color=blue&logo=github&logoColor=white&label=Latest&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcraftaro%2FUltimateModeration%2Fmaster%2Fpom.xml&query=%2F*%5Blocal-name()%3D'project'%5D%2F*%5Blocal-name()%3D'version'%5D
[bStats page]: https://bstats.org/plugin/bukkit/UltimateModeration/4346
[bStats shield]: https://img.shields.io/bstats/servers/4346?label=Servers

BIN
docs/Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

76
pom.xml
View File

@ -2,24 +2,29 @@
<groupId>com.songoda</groupId>
<artifactId>UltimateModeration</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>2.0.4</version>
<version>2.0.15</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>UltimateModeration-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
@ -28,6 +33,7 @@
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.directory}/classes/plugin.yml</file>
<replacements>
@ -38,10 +44,11 @@
</replacements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
<executions>
<execution>
<id>shaded</id>
@ -49,17 +56,17 @@
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<includes>
<include>com.songoda:SongodaCore</include>
<include>com.zaxxer:HikariCP</include>
<include>org.slf4j:slf4j-api</include>
<include>org.slf4j:slf4j-nop</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
@ -70,6 +77,7 @@
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>com.songoda.core</pattern>
@ -82,63 +90,51 @@
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>private</id>
<url>http://repo.songoda.com/repository/private/</url>
</repository>
<repository>
<id>public</id>
<id>songoda-public</id>
<url>https://repo.songoda.com/repository/public/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<url>https://jitpack.io/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1</version>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId>
<version>2.6.19</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>abledskyblock</artifactId>
<version>79.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.23.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.25</version>
</dependency>
</dependencies>
</project>

View File

@ -106,8 +106,9 @@ public class UltimateModeration extends SongodaPlugin {
String username = Settings.MYSQL_USERNAME.getString();
String password = Settings.MYSQL_PASSWORD.getString();
boolean useSSL = Settings.MYSQL_USE_SSL.getBoolean();
int poolSize = Settings.MYSQL_POOL_SIZE.getInt();
this.databaseConnector = new MySQLConnector(this, hostname, port, database, username, password, useSSL);
this.databaseConnector = new MySQLConnector(this, hostname, port, database, username, password, useSSL, poolSize);
this.getLogger().info("Data handler connected using MySQL.");
} else {
this.databaseConnector = new SQLiteConnector(this);
@ -150,7 +151,7 @@ public class UltimateModeration extends SongodaPlugin {
@Override
public void onDataLoad() {
getDataManager().queueAsync(() -> {
getDataManager().runAsync(() -> {
// Load data from DB
this.dataManager.getTemplates((templates) -> {
for (Template template : templates) {
@ -169,7 +170,7 @@ public class UltimateModeration extends SongodaPlugin {
for (Ticket ticket : tickets.values())
this.ticketManager.addTicket(ticket);
});
}, "create");
});
}
@Override

View File

@ -13,6 +13,7 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.plugin.Plugin;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
@ -30,36 +31,43 @@ public class DataManager extends DataManagerAbstract {
}
public void createTemplate(Template template) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
String createTemplate = "INSERT INTO " + this.getTablePrefix() + "templates (punishment_type, duration, reason, name, creator) VALUES (?, ?, ?, ?, ?)";
try (PreparedStatement statement = connection.prepareStatement(createTemplate)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String createTemplate = "INSERT INTO " + this.getTablePrefix() + "templates (punishment_type, duration, reason, name, creator) VALUES (?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createTemplate);
statement.setString(1, template.getPunishmentType().name());
statement.setLong(2, template.getDuration());
statement.setString(3, template.getReason());
statement.setString(4, template.getName());
statement.setString(5, template.getCreator().toString());
statement.executeUpdate();
}
int templateId = this.lastInsertedId(connection, "templates");
template.setId(templateId);
}), "create");
int templateId = this.lastInsertedId(connection, "templates");
template.setId(templateId);
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void deleteTemplate(Template template) {
this.async(() -> this.databaseConnector.connect(connection -> {
String deleteTemplate = "DELETE FROM " + this.getTablePrefix() + "templates WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteTemplate)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String deleteTemplate = "DELETE FROM " + this.getTablePrefix() + "templates WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(deleteTemplate);
statement.setLong(1, template.getId());
statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
}
}));
});
}
public void getTemplates(Consumer<List<Template>> callback) {
List<Template> templates = new ArrayList<>();
this.async(() -> this.databaseConnector.connect(connection -> {
try (Statement statement = connection.createStatement()) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
Statement statement = connection.createStatement();
String selectTemplates = "SELECT * FROM " + this.getTablePrefix() + "templates";
ResultSet result = statement.executeQuery(selectTemplates);
while (result.next()) {
@ -73,16 +81,19 @@ public class DataManager extends DataManagerAbstract {
template.setId(id);
templates.add(template);
}
}
this.sync(() -> callback.accept(templates));
}));
this.sync(() -> callback.accept(templates));
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void createAppliedPunishment(AppliedPunishment punishment) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
String createPunishment = "INSERT INTO " + this.getTablePrefix() + "punishments (type, duration, reason, victim, punisher, expiration) VALUES (?, ?, ?, ?, ?, ?)";
try (PreparedStatement statement = connection.prepareStatement(createPunishment)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String createPunishment = "INSERT INTO " + this.getTablePrefix() + "punishments (type, duration, reason, victim, punisher, expiration) VALUES (?, ?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createPunishment);
statement.setString(1, punishment.getPunishmentType().name());
statement.setLong(2, punishment.getDuration());
statement.setString(3, punishment.getReason());
@ -90,27 +101,33 @@ public class DataManager extends DataManagerAbstract {
statement.setString(5, punishment.getPunisher().toString());
statement.setLong(6, punishment.getExpiration());
statement.executeUpdate();
}
int punishmentId = this.lastInsertedId(connection, "punishments");
punishment.setId(punishmentId);
}), "create");
int punishmentId = this.lastInsertedId(connection, "punishments");
punishment.setId(punishmentId);
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void deleteAppliedPunishment(AppliedPunishment punishment) {
this.async(() -> this.databaseConnector.connect(connection -> {
String deletePunishment = "DELETE FROM " + this.getTablePrefix() + "punishments WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(deletePunishment)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String deletePunishment = "DELETE FROM " + this.getTablePrefix() + "punishments WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(deletePunishment);
statement.setLong(1, punishment.getId());
statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
}
}));
});
}
public void updateAppliedPunishment(AppliedPunishment punishment) {
this.async(() -> this.databaseConnector.connect(connection -> {
String updatePunishment = "UPDATE " + this.getTablePrefix() + "punishments set type = ?, duration = ?, reason = ?, victim = ?, punisher = ?, expiration = ? WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(updatePunishment)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String updatePunishment = "UPDATE " + this.getTablePrefix() + "punishments set type = ?, duration = ?, reason = ?, victim = ?, punisher = ?, expiration = ? WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(updatePunishment);
statement.setString(1, punishment.getPunishmentType().name());
statement.setLong(2, punishment.getDuration());
statement.setString(3, punishment.getReason());
@ -119,14 +136,17 @@ public class DataManager extends DataManagerAbstract {
statement.setLong(6, punishment.getExpiration());
statement.setLong(7, punishment.getId());
statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
}
}));
});
}
public void getAppliedPunishments(Consumer<List<AppliedPunishment>> callback) {
List<AppliedPunishment> appliedPunishments = new ArrayList<>();
this.async(() -> this.databaseConnector.connect(connection -> {
try (Statement statement = connection.createStatement()) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
Statement statement = connection.createStatement();
String selectPunishments = "SELECT * FROM " + this.getTablePrefix() + "punishments";
ResultSet result = statement.executeQuery(selectPunishments);
while (result.next()) {
@ -139,42 +159,51 @@ public class DataManager extends DataManagerAbstract {
long expiration = result.getLong("expiration");
appliedPunishments.add(new AppliedPunishment(punishmentType, duration, reason, victim, punisher, expiration, id));
}
}
this.sync(() -> callback.accept(appliedPunishments));
}));
this.sync(() -> callback.accept(appliedPunishments));
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void createNote(PunishmentNote note) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
String createNote = "INSERT INTO " + this.getTablePrefix() + "notes (note, author, subject, creation) VALUES (?, ?, ?, ?)";
try (PreparedStatement statement = connection.prepareStatement(createNote)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String createNote = "INSERT INTO " + this.getTablePrefix() + "notes (note, author, subject, creation) VALUES (?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createNote);
statement.setString(1, note.getNote());
statement.setString(2, note.getAuthor().toString());
statement.setString(3, note.getSubject().toString());
statement.setLong(4, note.getCreationDate());
statement.executeUpdate();
}
int noteId = this.lastInsertedId(connection, "notes");
note.setId(noteId);
}), "create");
int noteId = this.lastInsertedId(connection, "notes");
note.setId(noteId);
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void deleteNote(PunishmentNote note) {
this.async(() -> this.databaseConnector.connect(connection -> {
String deleteNote = "DELETE FROM " + this.getTablePrefix() + "notes WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteNote)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String deleteNote = "DELETE FROM " + this.getTablePrefix() + "notes WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(deleteNote);
statement.setLong(1, note.getId());
statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
}
}));
});
}
public void getNotes(Consumer<List<PunishmentNote>> callback) {
List<PunishmentNote> notes = new ArrayList<>();
this.async(() -> this.databaseConnector.connect(connection -> {
try (Statement statement = connection.createStatement()) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
Statement statement = connection.createStatement();
String getNotes = "SELECT * FROM " + this.getTablePrefix() + "notes";
ResultSet result = statement.executeQuery(getNotes);
while (result.next()) {
@ -185,16 +214,19 @@ public class DataManager extends DataManagerAbstract {
long creation = result.getLong("creation");
notes.add(new PunishmentNote(id, note, author, subject, creation));
}
}
this.sync(() -> callback.accept(notes));
}));
this.sync(() -> callback.accept(notes));
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void createTicket(Ticket ticket) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
String createTicket = "INSERT INTO " + this.getTablePrefix() + "tickets (victim, subject, type, status, world, x, y, z, pitch, yaw) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
try (PreparedStatement statement = connection.prepareStatement(createTicket)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String createTicket = "INSERT INTO " + this.getTablePrefix() + "tickets (victim, subject, type, status, world, x, y, z, pitch, yaw) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createTicket);
statement.setString(1, ticket.getVictim().toString());
statement.setString(2, ticket.getSubject());
statement.setString(3, ticket.getType());
@ -209,36 +241,44 @@ public class DataManager extends DataManagerAbstract {
statement.setFloat(9, location.getPitch());
statement.setFloat(10, location.getYaw());
statement.executeUpdate();
for (TicketResponse response : ticket.getResponses()) {
createTicketResponse(response);
}
int ticketId = this.lastInsertedId(connection, "tickets");
ticket.setId(ticketId);
} catch (Exception ex) {
ex.printStackTrace();
}
for (TicketResponse response : ticket.getResponses())
createTicketResponse(response);
int ticketId = this.lastInsertedId(connection, "tickets");
ticket.setId(ticketId);
}), "create");
});
}
public void deleteTicket(Ticket ticket) {
this.async(() -> this.databaseConnector.connect(connection -> {
String deleteTicket = "DELETE FROM " + this.getTablePrefix() + "tickets WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteTicket)) {
statement.setLong(1, ticket.getId());
statement.executeUpdate();
}
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String deleteTicket = "DELETE FROM " + this.getTablePrefix() + "tickets WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteTicket)) {
statement.setLong(1, ticket.getId());
statement.executeUpdate();
}
String deleteTicketResponses = "DELETE FROM " + this.getTablePrefix() + "ticket_responses WHERE ticket_id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteTicketResponses)) {
statement.setLong(1, ticket.getId());
statement.executeUpdate();
String deleteTicketResponses = "DELETE FROM " + this.getTablePrefix() + "ticket_responses WHERE ticket_id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteTicketResponses)) {
statement.setLong(1, ticket.getId());
statement.executeUpdate();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}));
});
}
public void updateTicket(Ticket ticket) {
this.async(() -> this.databaseConnector.connect(connection -> {
String updateTicket = "UPDATE " + this.getTablePrefix() + "tickets SET victim = ?, subject = ?, type = ?, status = ?, world = ?, x = ?, y = ?, z = ?, pitch = ?, yaw = ? WHERE id = ?";
try (PreparedStatement statement = connection.prepareStatement(updateTicket)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String updateTicket = "UPDATE " + this.getTablePrefix() + "tickets SET victim = ?, subject = ?, type = ?, status = ?, world = ?, x = ?, y = ?, z = ?, pitch = ?, yaw = ? WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(updateTicket);
statement.setString(1, ticket.getVictim().toString());
statement.setString(2, ticket.getSubject());
statement.setString(3, ticket.getType());
@ -254,73 +294,82 @@ public class DataManager extends DataManagerAbstract {
statement.setFloat(10, location.getYaw());
statement.setInt(11, ticket.getId());
statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
}
}));
});
}
public void getTickets(Consumer<Map<Integer, Ticket>> callback) {
Map<Integer, Ticket> tickets = new TreeMap<>();
this.async(() -> this.databaseConnector.connect(connection -> {
try (Statement statement = connection.createStatement()) {
String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "tickets";
ResultSet result = statement.executeQuery(selectTickets);
while (result.next()) {
int id = result.getInt("id");
UUID victim = UUID.fromString(result.getString("victim"));
String subject = result.getString("subject");
String type = result.getString("type");
TicketStatus status = TicketStatus.valueOf(result.getString("status"));
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
try (Statement statement = connection.createStatement()) {
String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "tickets";
ResultSet result = statement.executeQuery(selectTickets);
while (result.next()) {
int id = result.getInt("id");
UUID victim = UUID.fromString(result.getString("victim"));
String subject = result.getString("subject");
String type = result.getString("type");
TicketStatus status = TicketStatus.valueOf(result.getString("status"));
String world = result.getString("world");
double x = result.getDouble("x");
double y = result.getDouble("y");
double z = result.getDouble("z");
float pitch = result.getFloat("pitch");
float yaw = result.getFloat("yaw");
String world = result.getString("world");
double x = result.getDouble("x");
double y = result.getDouble("y");
double z = result.getDouble("z");
float pitch = result.getFloat("pitch");
float yaw = result.getFloat("yaw");
Location location = Bukkit.getWorld(world) == null ? null : new Location(Bukkit.getWorld(world), x, y, z, yaw, pitch);
Location location = Bukkit.getWorld(world) == null ? null : new Location(Bukkit.getWorld(world), x, y, z, yaw, pitch);
Ticket ticket = new Ticket(id, victim, subject, type, status, location);
ticket.setId(id)
;
tickets.put(id, ticket);
Ticket ticket = new Ticket(id, victim, subject, type, status, location);
ticket.setId(id)
;
tickets.put(id, ticket);
}
}
}
try (Statement statement = connection.createStatement()) {
String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "ticket_responses";
ResultSet result = statement.executeQuery(selectTickets);
while (result.next()) {
int id = result.getInt("ticket_id");
try (Statement statement = connection.createStatement()) {
String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "ticket_responses";
ResultSet result = statement.executeQuery(selectTickets);
while (result.next()) {
int id = result.getInt("ticket_id");
Ticket ticket = tickets.get(id);
if (ticket == null) continue;
Ticket ticket = tickets.get(id);
if (ticket == null) continue;
UUID author = UUID.fromString(result.getString("author"));
String message = result.getString("message");
long postedDate = result.getLong("posted_date");
UUID author = UUID.fromString(result.getString("author"));
String message = result.getString("message");
long postedDate = result.getLong("posted_date");
TicketResponse ticketResponse = new TicketResponse(author, message, postedDate);
ticketResponse.setTicketId(id);
TicketResponse ticketResponse = new TicketResponse(author, message, postedDate);
ticketResponse.setTicketId(id);
ticket.addResponse(ticketResponse);
ticket.addResponse(ticketResponse);
}
}
}
this.sync(() -> callback.accept(tickets));
}));
this.sync(() -> callback.accept(tickets));
} catch (Exception ex) {
ex.printStackTrace();
}
});
}
public void createTicketResponse(TicketResponse ticketResponse) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
String createTicketResponse = "INSERT INTO " + this.getTablePrefix() + "ticket_responses (ticket_id, author, message, posted_date) VALUES (?, ?, ?, ?)";
try (PreparedStatement statement = connection.prepareStatement(createTicketResponse)) {
this.runAsync(() -> {
try (Connection connection = this.databaseConnector.getConnection()) {
String createTicketResponse = "INSERT INTO " + this.getTablePrefix() + "ticket_responses (ticket_id, author, message, posted_date) VALUES (?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createTicketResponse);
statement.setInt(1, ticketResponse.getTicketId());
statement.setString(2, ticketResponse.getAuthor().toString());
statement.setString(3, ticketResponse.getMessage());
statement.setLong(4, ticketResponse.getPostedDate());
statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
}
}), "create");
});
}
}

View File

@ -23,6 +23,8 @@ public class TemplateManagerGui extends Gui {
private PunishmentType punishmentType = PunishmentType.ALL;
private final Player player;
private int page = 1;
public TemplateManagerGui(UltimateModeration plugin, Player player) {
super(6);
setDefaultItem(null);
@ -30,24 +32,35 @@ public class TemplateManagerGui extends Gui {
this.player = player;
setTitle(plugin.getLocale().getMessage("gui.templatemanager.title").getMessage());
showPage();
toCurrentPage();
}
protected void showPage() {
if (inventory != null)
private void toPrevPage() {
if (this.page <= 1) {
return;
}
--this.page;
toCurrentPage();
}
private void toNextPage() {
if (findTemplates(this.page + 1, this.punishmentType).size() > 0) {
++this.page;
toCurrentPage();
}
}
private void toCurrentPage() {
if (inventory != null) {
inventory.clear();
}
setActionForRange(0, 53, null);
int numTemplates = plugin.getTemplateManager().getTemplates().size();
this.pages = (int) Math.floor(numTemplates / 28.0);
List<Template> templates = plugin.getTemplateManager().getTemplates().stream().skip((page - 1) * 28).limit(28)
.collect(Collectors.toList());
setNextPage(0, 5, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, plugin.getLocale().getMessage("gui.general.next").getMessage()));
setPrevPage(0, 1, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, plugin.getLocale().getMessage("gui.general.back").getMessage()));
setOnPage((event) -> showPage());
// decorate the edges
ItemStack glass2 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_2.getMaterial(CompatibleMaterial.BLUE_STAINED_GLASS_PANE));
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial(CompatibleMaterial.LIGHT_BLUE_STAINED_GLASS_PANE));
@ -65,27 +78,30 @@ public class TemplateManagerGui extends Gui {
(event) -> {
this.punishmentType = punishmentType.nextFilter();
this.page = 1;
showPage();
toCurrentPage();
});
setButton(5, 4, GuiUtils.createButtonItem(CompatibleMaterial.OAK_DOOR,
plugin.getLocale().getMessage("gui.general.back").getMessage()),
plugin.getLocale().getMessage("gui.general.back").getMessage()),
(event) -> guiManager.showGUI(event.player, new MainGui(plugin, event.player)));
if (player.hasPermission("um.templates.create"))
if (player.hasPermission("um.templates.create")) {
setButton(5, 5, GuiUtils.createButtonItem(CompatibleMaterial.REDSTONE,
plugin.getLocale().getMessage("gui.templatemanager.create").getMessage()),
plugin.getLocale().getMessage("gui.templatemanager.create").getMessage()),
(event) -> guiManager.showGUI(event.player, new PunishGui(plugin, null, null, player)));
}
List<Template> templates = findTemplates(this.page, this.punishmentType);
if (punishmentType != PunishmentType.ALL)
templates.removeIf(template -> template.getPunishmentType() != punishmentType);
int num = 11;
for (Template template : templates) {
if (num == 16 || num == 36)
if (num == 16 || num == 36) {
num = num + 2;
}
setButton(num, GuiUtils.createButtonItem(CompatibleMaterial.MAP, TextUtils.formatText("&6&l" + template.getName()),
plugin.getLocale().getMessage("gui.templatemanager.leftclick").getMessage(),
plugin.getLocale().getMessage("gui.templatemanager.rightclick").getMessage()),
plugin.getLocale().getMessage("gui.templatemanager.leftclick").getMessage(),
plugin.getLocale().getMessage("gui.templatemanager.rightclick").getMessage()),
(event) -> {
if (event.clickType == ClickType.LEFT) {
if (player.hasPermission("um.templates.edit"))
@ -95,11 +111,23 @@ public class TemplateManagerGui extends Gui {
plugin.getTemplateManager().removeTemplate(template);
plugin.getDataManager().deleteTemplate(template);
}
showPage();
toCurrentPage();
}
});
num++;
++num;
}
setButton(0, 3, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, plugin.getLocale().getMessage("gui.general.back").getMessage()), (event) -> toPrevPage());
setButton(0, 5, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, plugin.getLocale().getMessage("gui.general.next").getMessage()), (event) -> toNextPage());
}
private List<Template> findTemplates(int page, PunishmentType punishmentType) {
return plugin.getTemplateManager().getTemplates().stream()
.filter(template -> punishmentType == PunishmentType.ALL || template.getPunishmentType() == punishmentType)
.skip((page - 1) * 28L)
.limit(28)
.collect(Collectors.toList());
}
}

View File

@ -20,6 +20,7 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
// FIXME: Pagination not working (probably in other GUIs too) (copy own one from TemplateManagerGui)
public class TicketManagerGui extends Gui {
private final UltimateModeration plugin;
@ -142,7 +143,6 @@ public class TicketManagerGui extends Gui {
(event) -> guiManager.showGUI(player, new TicketGui(plugin, ticket, toModerate, player)));
num++;
}
}
public static void createNew(Player player, OfflinePlayer toModerate) {

View File

@ -39,7 +39,7 @@ public class ViewEnderChestModeration extends AbstractModeration {
protected boolean runModeration(CommandSender runner, OfflinePlayer toModerate) {
Player toModeratePlayer = (Player) toModerate;
((Player) runner).openInventory(toModeratePlayer.getInventory());
((Player) runner).openInventory(toModeratePlayer.getEnderChest());
return false;
}
}

View File

@ -64,6 +64,7 @@ public class Settings {
public static final ConfigSetting MYSQL_USERNAME = new ConfigSetting(config, "MySQL.Username", "user");
public static final ConfigSetting MYSQL_PASSWORD = new ConfigSetting(config, "MySQL.Password", "pass");
public static final ConfigSetting MYSQL_USE_SSL = new ConfigSetting(config, "MySQL.Use SSL", false);
public static final ConfigSetting MYSQL_POOL_SIZE = new ConfigSetting(config, "MySQL.Pool Size", 3, "Determines the number of connections the pool is using. Increase this value if you are getting timeout errors when more players online.");
public static void setupConfig() {
config.load();