Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update min. Towny version to 0.100.4.0 & TR version number to 0.10.0. #151

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.townyadvanced</groupId>
<artifactId>TownyResources</artifactId>
<version>0.9.0</version>
<version>0.10.0</version>
<name>townyresources</name> <!-- Leave lower-cased -->

<properties>
<java.version>17</java.version>
<project.bukkitAPIVersion>1.15</project.bukkitAPIVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<towny.version>0.100.1.0</towny.version>
<towny.version>0.100.4.0</towny.version>
</properties>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.townyadvanced.townyresources;

import com.palmergames.bukkit.towny.Towny;
import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.exceptions.initialization.TownyInitException;
Expand All @@ -10,8 +11,6 @@
import com.palmergames.bukkit.towny.scheduling.impl.BukkitTaskScheduler;
import com.palmergames.bukkit.towny.scheduling.impl.FoliaTaskScheduler;
import com.palmergames.bukkit.util.Colors;
import com.palmergames.bukkit.util.Version;

import io.github.townyadvanced.townyresources.commands.NationCollectAddon;
import io.github.townyadvanced.townyresources.commands.TownResourcesAddon;
import io.github.townyadvanced.townyresources.commands.TownyAdminResourcesAddon;
Expand Down Expand Up @@ -39,7 +38,7 @@ public class TownyResources extends JavaPlugin {

private static TownyResources plugin;
private final TaskScheduler scheduler;
private static Version requiredTownyVersion = Version.fromString("0.99.0.6");
private static String requiredTownyVersion = "0.100.4.0";
private static boolean siegeWarInstalled;
private static boolean dynmapTownyInstalled;
private static boolean mapTownyInstalled;
Expand Down Expand Up @@ -274,13 +273,12 @@ public boolean isMMOItemsInstalled() {
return mmmoItemsInstalled;
}

private String getTownyVersion() {
return Bukkit.getPluginManager().getPlugin("Towny").getDescription().getVersion();
}

private void townyVersionCheck() throws TownyException{
if (!(Version.fromString(getTownyVersion()).compareTo(requiredTownyVersion) >= 0))
throw new TownyException("Towny version does not meet required minimum version: " + requiredTownyVersion.toString());
try {
if (Towny.isTownyVersionSupported(requiredTownyVersion))
return;
} catch (NoSuchMethodError ignored) {}
throw new TownyException("Towny version does not meet required minimum version: " + requiredTownyVersion.toString());
}

private void setupIntegrationsWithOtherPlugins() {
Expand Down