Skip to content

Commit

Permalink
Update min. Towny version to 0.100.4.0 & TR version number to 0.10.0. (
Browse files Browse the repository at this point in the history
  • Loading branch information
LlmDl authored Sep 24, 2024
1 parent 7ed44a1 commit 6721ff1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
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

0 comments on commit 6721ff1

Please sign in to comment.