mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-08 03:39:42 +01:00
Fixed in-game links not working in 1.8
This commit is contained in:
parent
a9fa739c2a
commit
912850f1ab
@ -22,6 +22,8 @@ import net.md_5.bungee.api.chat.ComponentBuilder;
|
|||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
import org.apache.commons.text.TextStringBuilder;
|
import org.apache.commons.text.TextStringBuilder;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -133,6 +135,11 @@ class BukkitPartBuilder implements MessageBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CommandSender#spigot#sendMessage(BaseComponent[]) is not supported on 1.8
|
// CommandSender#spigot#sendMessage(BaseComponent[]) is not supported on 1.8
|
||||||
current.sender.sender.sendMessage(BaseComponent.toLegacyText(components.toArray(new BaseComponent[0])));
|
CommandSender commandSender = current.sender.sender;
|
||||||
|
if (commandSender instanceof Player) {
|
||||||
|
((Player) commandSender).spigot().sendMessage(components.toArray(new BaseComponent[0]));
|
||||||
|
} else {
|
||||||
|
commandSender.sendMessage(BaseComponent.toLegacyText(components.toArray(new BaseComponent[0])));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user