Skip to content

Commit 9d2bba6

Browse files
authored
Merge pull request #210 from AlpsBTE/update/lang
Critical Issue fix + new languages es, hu, nl, ro
2 parents 65b8e25 + 0c5f939 commit 9d2bba6

File tree

20 files changed

+2304
-314
lines changed

20 files changed

+2304
-314
lines changed

build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ tasks.withType<Javadoc> {
7878
}
7979

8080
tasks.shadowJar {
81-
exclude("org/jetbrains/annotations/**")
8281
archiveClassifier = ""
83-
84-
relocationPrefix = "$group.plotsystem.shaded"
82+
relocationPrefix = "com.alpsbte.plotsystem.shaded"
8583
enableAutoRelocation = true
8684
}
8785

gradle/libs.versions.toml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
# This file was generated by the Gradle 'init' task.
21
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
32

43
[versions]
5-
com-alpsbte-alpslib-alpslib-hologram = "1.1.1" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-hologram/
6-
com-alpsbte-alpslib-alpslib-io = "1.2.0" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-io/
7-
com-alpsbte-alpslib-alpslib-utils = "1.3.6" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-utils/
4+
# Dependencies
5+
com-alpsbte-alpslib-alpslib-hologram = "1.1.2" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-hologram/
6+
com-alpsbte-alpslib-alpslib-io = "1.2.3" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-io/
7+
com-alpsbte-alpslib-alpslib-utils = "1.4.1" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-utils/
88
com-alpsbte-canvas = "1.3" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/canvas/
99
com-arcaniax-headdatabase-api = "1.3.2" # https://github.com/Arcaniax-Development/HeadDatabase-API/releases
1010
com-github-decentsoftware-eu-decentholograms = "2.9.9" # https://github.com/DecentSoftware-eu/DecentHolograms/releases
1111
com-github-fierioziy-particlenativeapi-particlenativeapi-plugin = "3.3.2" # https://github.com/Fierioziy/ParticleNativeAPI/releases - we are stuck at v3 for now. Need to migrate some time or remove it
12-
multiverse-core = "5.5.1" # https://github.com/Multiverse/Multiverse-Core/releases
13-
com-sk89q-worldguard-worldguard-bukkit = "7.0.15" # https://maven.enginehub.org/ui/packages/gav:%2F%2Fcom.sk89q.worldguard:worldguard-bukkit?name=com.sk89q.worldguard&type=packages
14-
com-zaxxer-hikaricp = "7.0.2" # https://github.com/brettwooldridge/HikariCP/tags
15-
commons-io-commons-io = "2.20.0" # https://central.sonatype.com/artifact/commons-io/commons-io - provided by Paper
16-
de-oliver-fancynpcs = "2.9.0" # https://repo.fancyinnovations.com/#/releases/de/oliver/FancyNpcs
17-
io-papermc-paper-paper-api = "1.21.11-R0.1-SNAPSHOT"
18-
li-cinnazeyy-langlibs-api = "1.5.1" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/li/cinnazeyy/LangLibs-API/
19-
org-mariadb-jdbc-mariadb-java-client = "3.5.7" # https://central.sonatype.com/artifact/org.mariadb.jdbc/mariadb-java-client
12+
multiverse-core = "5.5.2" # https://repo.onarandombox.com/#/multiverse-releases/org/mvplugins/multiverse/core/multiverse-core
13+
com-sk89q-worldguard-worldguard-bukkit = "7.0.15" # https://maven.enginehub.org/repo/com/sk89q/worldguard/worldguard-bukkit/
14+
com-zaxxer-hikaricp = "6.3.0" # https://github.com/brettwooldridge/HikariCP/tags
15+
commons-io-commons-io = "2.20.0" # Provided by Minecraft (Libs folder)
16+
de-oliver-fancynpcs = "2.9.2" # https://fancyspaces.net/spaces/fancynpcs/maven-repos/fi-releases/de.oliver:FancyNpcs
17+
io-papermc-paper-paper-api = "1.21.11-R0.1-SNAPSHOT" # https://artifactory.papermc.io/ui/native/universe/io/papermc/paper/paper-api/
18+
li-cinnazeyy-langlibs-api = "1.5.2" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/li/cinnazeyy/LangLibs-API/
19+
org-mariadb-jdbc-mariadb-java-client = "3.5.7" # https://central.sonatype.com/artifact/org.mariadb.jdbc/mariadb-java-client
2020
com-intellectualsites-bom-bom-newest = "1.55" # Ref: https://github.com/IntellectualSites/bom
21-
git-version = "4.3.0" # https://github.com/palantir/gradle-git-version/releases
21+
# Plugins
2222
shadow = "9.3.1" # https://github.com/GradleUp/shadow/releases
23+
git-version = "4.3.0" # https://github.com/palantir/gradle-git-version/releases
2324

2425
[libraries]
2526
com-alpsbte-alpslib-alpslib-hologram = { module = "com.alpsbte.alpslib:alpslib-hologram", version.ref = "com-alpsbte-alpslib-alpslib-hologram" }
@@ -41,4 +42,4 @@ com-intellectualsites-bom-bom-newest = { module = "com.intellectualsites.bom:bom
4142

4243
[plugins]
4344
git-version = { id = "com.palantir.git-version", version.ref = "git-version" }
44-
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
45+
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }

pom.xml

Lines changed: 0 additions & 272 deletions
This file was deleted.

src/main/java/com/alpsbte/plotsystem/PlotSystem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,10 @@ public static PlotSystem getPlugin() {
189189
return plugin;
190190
}
191191

192-
public void initDatabase() throws IOException, SQLException, ClassNotFoundException {
193-
DatabaseConnection.initializeDatabase(DatabaseConfigPaths.getConfig(getConfig()), true);
192+
public void initDatabase() throws IOException, SQLException, RuntimeException {
193+
// We currently want to save everything in UTC to have no mismatch, because CURRENT_TIMESTAMP uses UTC + DateTime doesn't support timezones (we would have to use TIMESTAMP)
194+
// These url parameters align behaviour (at least on linux)
195+
DatabaseConnection.initializeDatabase(DatabaseConfigPaths.getConfig(getConfig()), true, "serverTimezone=UTC&forceConnectionTimeZoneToSession=true");
194196
var initScript = CharStreams.toString(Objects.requireNonNull(getTextResource("DATABASE.sql")));
195197
try (var con = DatabaseConnection.getConnection(); var s = con.createStatement()) {
196198
s.execute(initScript);

src/main/java/com/alpsbte/plotsystem/core/EventListener.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
public class EventListener implements Listener {
7777
@EventHandler
78-
public void onPlayerJoinEvent(PlayerJoinEvent event) {
78+
public void onPlayerJoinEvent(@NotNull PlayerJoinEvent event) {
7979
Player player = event.getPlayer();
8080

8181
// Add Items
@@ -141,8 +141,10 @@ public void onPlayerQuitEvent(@NotNull PlayerQuitEvent event) {
141141
plotWorld.unloadWorld(false);
142142
}, 60L);
143143

144-
PlotUtils.plotReminder.get(event.getPlayer().getUniqueId()).cancel();
145-
PlotUtils.plotReminder.remove(event.getPlayer().getUniqueId());
144+
if (PlotUtils.plotReminder.containsKey(event.getPlayer().getUniqueId())) {
145+
PlotUtils.plotReminder.get(event.getPlayer().getUniqueId()).cancel();
146+
PlotUtils.plotReminder.remove(event.getPlayer().getUniqueId());
147+
}
146148
}
147149

148150
@EventHandler

src/main/java/com/alpsbte/plotsystem/core/database/providers/TutorialPlotProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import java.sql.Date;
88
import java.sql.ResultSet;
99
import java.sql.Timestamp;
10-
import java.time.LocalDate;
11-
import java.time.LocalDateTime;
10+
import java.time.Instant;
1211
import java.util.Deque;
1312
import java.util.HashMap;
1413
import java.util.LinkedList;
@@ -65,7 +64,7 @@ public boolean setStageId(int tutorialId, String playerUUID, int stageId) {
6564
String qSetStage = "UPDATE tutorial SET stage_id = ?, last_stage_complete_date = ? WHERE tutorial_id = ? AND uuid = ?;";
6665
return Boolean.TRUE.equals(Utils.handleSqlException(false, () -> SqlHelper.runQuery(qSetStage, ps -> {
6766
ps.setInt(1, stageId);
68-
ps.setObject(2, LocalDate.now());
67+
ps.setTimestamp(2, Timestamp.from(Instant.now()));
6968
ps.setInt(3, tutorialId);
7069
ps.setString(4, playerUUID);
7170
return ps.executeUpdate() > 0;
@@ -76,7 +75,8 @@ public boolean setComplete(int tutorialId, String playerUUID) {
7675
String qSetComplete = "UPDATE tutorial SET is_complete = ?, last_stage_complete_date = ? WHERE tutorial_id = ? AND uuid = ?;";
7776
return Boolean.TRUE.equals(Utils.handleSqlException(false, () -> SqlHelper.runQuery(qSetComplete, ps -> {
7877
ps.setBoolean(1, true);
79-
ps.setObject(2, Timestamp.valueOf(LocalDateTime.now()));
78+
79+
ps.setTimestamp(2, Timestamp.from(Instant.now()));
8080
ps.setInt(3, tutorialId);
8181
ps.setString(4, playerUUID);
8282
return ps.executeUpdate() > 0;

0 commit comments

Comments
 (0)