Skip to content

Commit

Permalink
Update for Towny 0.97.2.0 compat.
Browse files Browse the repository at this point in the history
Min Towny version set to 0.97.2.0.
  • Loading branch information
LlmDl committed Sep 25, 2021
1 parent e8adfc6 commit 0e6d8fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
21 changes: 11 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.dynmap</groupId>
<artifactId>Dynmap-Towny</artifactId>
<version>0.87</version>
<version>0.88</version>

<build>
<resources>
Expand All @@ -28,7 +28,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -53,9 +53,9 @@

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -67,15 +67,16 @@
<dependency>
<groupId>com.github.TownyAdvanced</groupId>
<artifactId>Towny</artifactId>
<version>0.97.0.18</version>
<version>0.97.2.0</version>
</dependency>
<dependency>
<groupId>com.github.TownyAdvanced</groupId>
<artifactId>TownyChat</artifactId>
<version>0.85</version>
<groupId>com.github.TownyAdvanced</groupId>
<artifactId>TownyChat</artifactId>
<version>0.90</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
</project>
10 changes: 4 additions & 6 deletions src/main/java/org/dynmap/towny/DynmapTownyPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@
import com.palmergames.bukkit.towny.object.TownBlockType;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.object.TownyWorld;
import com.palmergames.bukkit.towny.war.common.townruin.TownRuinSettings;
import com.palmergames.bukkit.towny.war.common.townruin.TownRuinUtil;
import com.palmergames.bukkit.towny.utils.TownRuinUtil;
import com.palmergames.bukkit.util.Version;
import com.palmergames.bukkit.TownyChat.Chat;
import org.dynmap.towny.events.BuildTownFlagsEvent;
import org.dynmap.towny.events.BuildTownMarkerDescriptionEvent;

public class DynmapTownyPlugin extends JavaPlugin {

private static Version requiredTownyVersion = Version.fromString("0.97.0.18");
private static Version requiredTownyVersion = Version.fromString("0.97.2.0");
private static Logger log;
private static final String DEF_INFOWINDOW = "<div class=\"infowindow\"><span style=\"font-size:120%;\">%regionname% (%nation%)</span><br /> Mayor <span style=\"font-weight:bold;\">%playerowners%</span><br /> Associates <span style=\"font-weight:bold;\">%playermanagers%</span><br/>Flags<br /><span style=\"font-weight:bold;\">%flags%</span></div>";
private static final String NATION_NONE = "_none_";
Expand Down Expand Up @@ -451,8 +450,7 @@ private String formatInfoWindow(Town town, TownBlockType btype) {

String dispNames = "";
for (Resident r: town.getResidents()) {
@SuppressWarnings("deprecation")
Player p = Bukkit.getPlayer(r.getName());
Player p = Bukkit.getPlayer(r.getName());
if(dispNames.length()>0) mgrs += ", ";

if (p == null) {
Expand Down Expand Up @@ -512,7 +510,7 @@ private String formatInfoWindow(Town town, TownBlockType btype) {
if (TownySettings.getBoolean(ConfigNodes.TOWN_RUINING_TOWN_RUINS_ENABLED)) {
String ruinedString = "ruined: " + town.isRuined();
if (town.isRuined())
ruinedString += " (Time left: " + (TownRuinSettings.getTownRuinsMaxDurationHours() - TownRuinUtil.getTimeSinceRuining(town)) + " hours)";
ruinedString += " (Time left: " + (TownySettings.getTownRuinsMaxDurationHours() - TownRuinUtil.getTimeSinceRuining(town)) + " hours)";

flags.add(ruinedString);
}
Expand Down

0 comments on commit 0e6d8fc

Please sign in to comment.