Skip to content

Commit

Permalink
- Update min. Towny version to 0.99.0.0.
Browse files Browse the repository at this point in the history
  - Update EssentialsX maven details.
  - Translate spy message colour codes.
    - Closes TownyAdvanced/Towny#6634
  • Loading branch information
LlmDl committed Apr 27, 2023
1 parent fe47196 commit bf5ba6f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
22 changes: 14 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.palmergames.bukkit</groupId>
<artifactId>TownyChat</artifactId>
<packaging>jar</packaging>
<version>0.103</version>
<version>0.104</version>

<licenses>
<license>
Expand All @@ -26,7 +26,7 @@
<java.version>17</java.version>
<project.bukkitAPIVersion>1.16</project.bukkitAPIVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<towny.version>0.98.5.0</towny.version>
<towny.version>0.99.0.0</towny.version>
</properties>

<!-- For use with GitHub Package Registry -->
Expand All @@ -50,8 +50,8 @@
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>ess-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url>
<id>essentials-releases</id>
<url>https://repo.essentialsx.net/releases/</url>
</repository>
<repository>
<id>dynmap-repo</id>
Expand All @@ -75,20 +75,26 @@
<dependency>
<groupId>com.github.TownyAdvanced</groupId>
<artifactId>Towny</artifactId>
<version>0.98.5.0</version>
<version>0.99.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<groupId>net.essentialsx</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.18.2</version>
<version>2.19.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>us.dynmap</groupId>
Expand Down
7 changes: 6 additions & 1 deletion resources/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,9 @@ v0.102:
v0.103:
- New Config Option: allow_exclamation_point_to_shout
- Default: true
- If true players that say !somewords will have their message sent to a global type channel with unlimited range (usually your general chat.)
- If true players that say !somewords will have their message sent to a global type channel with unlimited range (usually your general chat.)
v0.104:
- Update min. Towny version to 0.99.0.0.
- Update EssentialsX maven details.
- Translate spy message colour codes.
- Closes https://github.com/TownyAdvanced/Towny/issues/6634
2 changes: 1 addition & 1 deletion src/com/palmergames/bukkit/TownyChat/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Chat extends JavaPlugin {
private DynmapAPI dynMap = null;
private Essentials essentials = null;

private static Version requiredTownyVersion = Version.fromString("0.98.5.0");
private static Version requiredTownyVersion = Version.fromString("0.99.0.0");
public static boolean usingPlaceholderAPI = false;
public static boolean usingEssentialsDiscord = false;
boolean chatConfigError = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,11 @@ private void sendSpyMessage(AsyncPlayerChatEvent event, channelTypes type) {
String format = formatSpyMessage(type, event.getPlayer());
if (format == null) return;

String message = Colors.translateColorCodes(event.getMessage());
// Remove spies who've already seen the message naturally.
spies.stream()
.filter(spy -> !recipients.contains(spy))
.forEach(spy -> spy.sendMessage(format + event.getMessage()));
.forEach(spy -> spy.sendMessage(format + message));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import com.palmergames.bukkit.TownyChat.channels.StandardChannel;
import com.palmergames.bukkit.TownyChat.channels.channelTypes;
import org.bukkit.Bukkit;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.reader.UnicodeReader;

import java.io.BufferedReader;
Expand Down Expand Up @@ -183,7 +183,7 @@ public static Map<String, Object> getMap(String filepath, String resource) {

f = new File(filepath);

Yaml yamlChannels = new Yaml(new SafeConstructor());
Yaml yamlChannels = new Yaml(new LoaderOptions());
Object channelsRootDataNode;

try (FileInputStream fileInputStream = new FileInputStream(f)) {
Expand Down

0 comments on commit bf5ba6f

Please sign in to comment.