Skip to content

Commit

Permalink
2.0.2 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
LOOHP committed Apr 18, 2020
1 parent f07aa11 commit 32efb50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ public void setMentionSound(Sound sound) {
this.sound = sound;
}

@Deprecated
public void setReciver(Player reciever) {
this.reciever = reciever;
}

private static final HandlerList HANDLERS = new HandlerList();

public HandlerList getHandlers() {
Expand Down
12 changes: 5 additions & 7 deletions src/com/loohp/interactivechat/Modules/MentionDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class MentionDisplay {
public static BaseComponent process(BaseComponent basecomponent, Player beenpinged, Player sender, String messageKey, long unix, boolean async) {
if (InteractiveChat.mentionPair.containsKey(beenpinged.getUniqueId())) {
if (InteractiveChat.mentionPair.get(beenpinged.getUniqueId()).equals(sender.getUniqueId())) {
Player player = beenpinged;
Player reciever = beenpinged;

String title = ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(sender, ConfigManager.getConfig().getString("Chat.MentionedTitle")));
String subtitle = ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(sender, ConfigManager.getConfig().getString("Chat.KnownPlayerMentionSubtitle")));
Expand All @@ -40,23 +40,21 @@ public static BaseComponent process(BaseComponent basecomponent, Player beenping
}

boolean inCooldown = true;
if (InteractiveChat.mentionCooldown.get(player) < unix) {
if (InteractiveChat.mentionCooldown.get(reciever) < unix) {
inCooldown = false;
}
PlayerMentionPlayerEvent mentionEvent = new PlayerMentionPlayerEvent(async, player, sender.getUniqueId(), title, subtitle, sound, inCooldown);
PlayerMentionPlayerEvent mentionEvent = new PlayerMentionPlayerEvent(async, reciever, sender.getUniqueId(), title, subtitle, sound, inCooldown);
Bukkit.getPluginManager().callEvent(mentionEvent);
Player reciever = mentionEvent.getReciver();
InteractiveChat.mentionPair.put(reciever.getUniqueId(), sender.getUniqueId());
if (!mentionEvent.isCancelled()) {

int time = (int) Math.round(ConfigManager.getConfig().getDouble("Chat.MentionedTitleDuration") * 20);
if (InteractiveChat.version.contains("OLD")) {
OldTitleSender.sendTitle(player, title, subtitle, time);
OldTitleSender.sendTitle(reciever, title, subtitle, time);
} else {
reciever.sendTitle(title, subtitle, 10, time, 20);
}
if (sound != null) {
reciever.playSound(player.getLocation(), sound, 3.0F, 1.0F);
reciever.playSound(reciever.getLocation(), sound, 3.0F, 1.0F);
}

List<String> names = new ArrayList<String>();
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: InteractiveChat
author: loohp
version: 2.0.1
version: 2.0.2
main: com.loohp.interactivechat.InteractiveChat
api-version: 1.13
description: Make the chat interactive
Expand Down

0 comments on commit 32efb50

Please sign in to comment.