mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 22:21:52 +00:00
- Dynmap added to softdepends list, courtesy of ZombiMigz with PR #31.
- Allow for colouring the alone message. - Adapt to change in Towny 0.96.2.17 Version code. - Build against 0.96.2.17, minimum required Towny version now 0.96.2.17.
This commit is contained in:
1 parent
aab307dd39
commit
b6f81d938c
4 files changed
+28
-8
No files matched your search
@@ -74,7 +74,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.palmergames.bukkit.towny</groupId>
|
<groupId>com.palmergames.bukkit.towny</groupId>
|
||||||
<artifactId>Towny</artifactId>
|
<artifactId>Towny</artifactId>
|
||||||
<version>0.96.2.12</version>
|
<version>0.96.2.17</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -107,6 +107,11 @@
|
|||||||
<version>2.10.4</version>
|
<version>2.10.4</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains</groupId>
|
||||||
|
<artifactId>annotations</artifactId>
|
||||||
|
<version>16.0.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -331,3 +331,6 @@ v0.77:
|
|||||||
- Build against 0.96.2.12, minimum required Towny version now 0.96.2.12.
|
- Build against 0.96.2.12, minimum required Towny version now 0.96.2.12.
|
||||||
v0.78:
|
v0.78:
|
||||||
- Dynmap added to softdepends list, courtesy of ZombiMigz with PR #31.
|
- Dynmap added to softdepends list, courtesy of ZombiMigz with PR #31.
|
||||||
|
- Allow for colouring the alone message.
|
||||||
|
- Adapt to change in Towny 0.96.2.17 Version code.
|
||||||
|
- Build against 0.96.2.17, minimum required Towny version now 0.96.2.17.
|
||||||
@@ -45,7 +45,7 @@ public class Chat extends JavaPlugin {
|
|||||||
private Towny towny = null;
|
private Towny towny = null;
|
||||||
private DynmapAPI dynMap = null;
|
private DynmapAPI dynMap = null;
|
||||||
|
|
||||||
private static String requiredTownyVersion = "0.96.2.12";
|
private static Version requiredTownyVersion = Version.fromString("0.96.2.17");
|
||||||
public static boolean usingPlaceholderAPI = false;
|
public static boolean usingPlaceholderAPI = false;
|
||||||
boolean chatConfigError = false;
|
boolean chatConfigError = false;
|
||||||
boolean channelsConfigError = false;
|
boolean channelsConfigError = false;
|
||||||
@@ -62,7 +62,7 @@ public class Chat extends JavaPlugin {
|
|||||||
loadConfigs();
|
loadConfigs();
|
||||||
|
|
||||||
if (!townyVersionCheck(towny.getDescription().getVersion())) {
|
if (!townyVersionCheck(towny.getDescription().getVersion())) {
|
||||||
getLogger().severe("Towny version does not meet required version: " + requiredTownyVersion);
|
getLogger().severe("Towny version does not meet required version: " + requiredTownyVersion.toString());
|
||||||
this.getServer().getPluginManager().disablePlugin(this);
|
this.getServer().getPluginManager().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@@ -91,10 +91,9 @@ public class Chat extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean townyVersionCheck(String version) {
|
private boolean townyVersionCheck(String version) {
|
||||||
Version ver = new Version(version);
|
Version ver = Version.fromString(version);
|
||||||
Version required = new Version(requiredTownyVersion);
|
|
||||||
|
|
||||||
return ver.compareTo(required) >= 0;
|
return ver.compareTo(requiredTownyVersion) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConfigs() {
|
private void loadConfigs() {
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ package com.palmergames.bukkit.TownyChat.channels;
|
|||||||
|
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.palmergames.bukkit.TownyChat.Chat;
|
import com.palmergames.bukkit.TownyChat.Chat;
|
||||||
|
import com.palmergames.bukkit.TownyChat.HexFormatter;
|
||||||
import com.palmergames.bukkit.TownyChat.TownyChatFormatter;
|
import com.palmergames.bukkit.TownyChat.TownyChatFormatter;
|
||||||
import com.palmergames.bukkit.TownyChat.config.ChatSettings;
|
import com.palmergames.bukkit.TownyChat.config.ChatSettings;
|
||||||
import com.palmergames.bukkit.TownyChat.events.AsyncChatHookEvent;
|
import com.palmergames.bukkit.TownyChat.events.AsyncChatHookEvent;
|
||||||
import com.palmergames.bukkit.TownyChat.listener.LocalTownyChatEvent;
|
import com.palmergames.bukkit.TownyChat.listener.LocalTownyChatEvent;
|
||||||
|
import com.palmergames.bukkit.towny.Towny;
|
||||||
import com.palmergames.bukkit.towny.TownyAPI;
|
import com.palmergames.bukkit.towny.TownyAPI;
|
||||||
import com.palmergames.bukkit.towny.TownyMessaging;
|
import com.palmergames.bukkit.towny.TownyMessaging;
|
||||||
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
||||||
@@ -278,8 +280,19 @@ public class StandardChannel extends Channel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((recipients.size() <= 1) && (ChatSettings.isUsingAloneMessage()))
|
if ((recipients.size() <= 1) && (ChatSettings.isUsingAloneMessage())) {
|
||||||
sender.sendMessage(ChatSettings.getUsingAloneMessageString());
|
|
||||||
|
String aloneMsg;
|
||||||
|
|
||||||
|
if (Towny.is116Plus()) {
|
||||||
|
aloneMsg = HexFormatter.translateHexColors(ChatSettings.getUsingAloneMessageString());
|
||||||
|
} else {
|
||||||
|
aloneMsg = ChatColor.translateAlternateColorCodes('&', ChatSettings.getUsingAloneMessageString());
|
||||||
|
}
|
||||||
|
|
||||||
|
sender.sendMessage(aloneMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return recipients;
|
return recipients;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user