- Replace deprecated Essentials call.

This commit is contained in:
Llm Dl committed 2021-04-16 16:44:39 -05:00
1 parent ceef86242e
commit cc12304b2e
3 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<groupId>com.palmergames.bukkit</groupId> <groupId>com.palmergames.bukkit</groupId>
<artifactId>TownyChat</artifactId> <artifactId>TownyChat</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>0.87</version> <version>0.88</version>
<licenses> <licenses>
<license> <license>
+2
View File
@@ -371,3 +371,5 @@ v0.87:
- Fix event firing async. - Fix event firing async.
- Fix ranged global channels' chat being forwarded to dynmap. - Fix ranged global channels' chat being forwarded to dynmap.
- Fix UnsupportedOperationException which was possible when leaving a channel. - Fix UnsupportedOperationException which was possible when leaving a channel.
v0.88:
- Replace deprecated Essentials call.
@@ -244,12 +244,10 @@ public class StandardChannel extends Channel {
* @param list * @param list
* @return Set containing a list of players for this message. * @return Set containing a list of players for this message.
*/ */
@SuppressWarnings("deprecation")
private Set<Player> findRecipients(Player sender, List<Player> list) { private Set<Player> findRecipients(Player sender, List<Player> list) {
Set<Player> recipients = new HashSet<>(); Set<Player> recipients = new HashSet<>();
boolean bEssentials = plugin.getTowny().isEssentials(); boolean bEssentials = plugin.getTowny().isEssentials();
String sendersName = sender.getName();
// Compile the list of recipients // Compile the list of recipients
for (Player test : list) { for (Player test : list) {
@@ -267,10 +265,11 @@ public class StandardChannel extends Channel {
if (bEssentials) { if (bEssentials) {
try { try {
User targetUser = plugin.getTowny().getEssentials().getUser(test); User targetUser = plugin.getTowny().getEssentials().getUser(test);
User senderUser = plugin.getTowny().getEssentials().getUser(sender);
/* /*
* Don't send this message if the user is ignored * Don't send this message if the user is ignored
*/ */
if (targetUser.isIgnoredPlayer(sendersName)) if (targetUser.isIgnoredPlayer(senderUser))
continue; continue;
} catch (TownyException e) { } catch (TownyException e) {
// Failed to fetch user so ignore. // Failed to fetch user so ignore.