mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 02:19:05 +00:00
Remove faulty getOfflinePlayer API method and revert PAPI change
Support PAPI 2.10.9 Update plugin version
This commit is contained in:
parent
bfd5e3fa9c
commit
1ffdd26027
@ -1,4 +1,4 @@
|
|||||||
name: VentureChat
|
name: VentureChat
|
||||||
main: mineverse.Aust1n46.chat.bungee.MineverseChatBungee
|
main: mineverse.Aust1n46.chat.bungee.MineverseChatBungee
|
||||||
version: 2.19.2
|
version: 2.19.3
|
||||||
author: Aust1n46
|
author: Aust1n46
|
@ -111,8 +111,6 @@ import com.comphenix.protocol.ProtocolLibrary;
|
|||||||
import com.comphenix.protocol.events.PacketContainer;
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
import com.comphenix.protocol.utility.MinecraftReflection;
|
import com.comphenix.protocol.utility.MinecraftReflection;
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
|
||||||
|
|
||||||
public class MineverseChat extends JavaPlugin implements PluginMessageListener {
|
public class MineverseChat extends JavaPlugin implements PluginMessageListener {
|
||||||
// Listeners --------------------------------
|
// Listeners --------------------------------
|
||||||
private ChatListener chatListener;
|
private ChatListener chatListener;
|
||||||
@ -406,8 +404,6 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
|
|||||||
if(pluginManager.isPluginEnabled("PlaceholderAPI")) {
|
if(pluginManager.isPluginEnabled("PlaceholderAPI")) {
|
||||||
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&e - Enabling PlaceholderAPI Hook"));
|
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&e - Enabling PlaceholderAPI Hook"));
|
||||||
}
|
}
|
||||||
//PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().register(new VentureChatPlaceholders());
|
|
||||||
//Deprecated because reasons...???
|
|
||||||
new VentureChatPlaceholders().register();
|
new VentureChatPlaceholders().register();
|
||||||
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&e - Loading player data"));
|
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&e - Loading player data"));
|
||||||
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
|
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
|
||||||
|
@ -12,7 +12,6 @@ import mineverse.Aust1n46.chat.channel.ChatChannel;
|
|||||||
import mineverse.Aust1n46.chat.json.JsonFormat;
|
import mineverse.Aust1n46.chat.json.JsonFormat;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
//Wrapper class for Player, this class stores additional information along with a players Player pointer.
|
//Wrapper class for Player, this class stores additional information along with a players Player pointer.
|
||||||
@ -329,10 +328,6 @@ public class MineverseChatPlayer {
|
|||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
return this.online ? this.player : null;
|
return this.online ? this.player : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OfflinePlayer getOfflinePlayer() {
|
|
||||||
return Bukkit.getOfflinePlayer(uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPlayed() {
|
public boolean hasPlayed() {
|
||||||
return this.hasPlayed;
|
return this.hasPlayed;
|
||||||
|
@ -323,7 +323,7 @@ public class ChatListener implements Listener {
|
|||||||
chDistance = eventChannel.getDistance();
|
chDistance = eventChannel.getDistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
format = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(mcp.getOfflinePlayer(), Format.FormatStringAll(plugin.getConfig().getConfigurationSection("channels." + eventChannel.getName()).getString("format"))));
|
format = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(mcp.getPlayer(), Format.FormatStringAll(plugin.getConfig().getConfigurationSection("channels." + eventChannel.getName()).getString("format"))));
|
||||||
if(plugin.getConfig().getBoolean("formatcleaner", false)) {
|
if(plugin.getConfig().getBoolean("formatcleaner", false)) {
|
||||||
format = format.replace("[]", " ");
|
format = format.replace("[]", " ");
|
||||||
format = format.replace(" ", " ").replace(" ", " ").replace(" ", " ");
|
format = format.replace(" ", " ").replace(" ", " ").replace(" ", " ");
|
||||||
|
@ -99,26 +99,26 @@ public class Format {
|
|||||||
String hover = "";
|
String hover = "";
|
||||||
if(placeholder.contains(prefix)) {
|
if(placeholder.contains(prefix)) {
|
||||||
action = format.getClickPrefix();
|
action = format.getClickPrefix();
|
||||||
text = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getOfflinePlayer(), format.getClickPrefixText()));
|
text = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getPlayer(), format.getClickPrefixText()));
|
||||||
for(String st : format.getHoverTextPrefix()) {
|
for(String st : format.getHoverTextPrefix()) {
|
||||||
hover += Format.FormatStringAll(st) + "\n";
|
hover += Format.FormatStringAll(st) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(placeholder.contains(nickname)) {
|
if(placeholder.contains(nickname)) {
|
||||||
action = format.getClickName();
|
action = format.getClickName();
|
||||||
text = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getOfflinePlayer(), format.getClickNameText()));
|
text = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getPlayer(), format.getClickNameText()));
|
||||||
for(String st : format.getHoverTextName()) {
|
for(String st : format.getHoverTextName()) {
|
||||||
hover += Format.FormatStringAll(st) + "\n";
|
hover += Format.FormatStringAll(st) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(placeholder.contains(suffix)) {
|
if(placeholder.contains(suffix)) {
|
||||||
action = format.getClickSuffix();
|
action = format.getClickSuffix();
|
||||||
text = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getOfflinePlayer(), format.getClickSuffixText()));
|
text = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getPlayer(), format.getClickSuffixText()));
|
||||||
for(String st : format.getHoverTextSuffix()) {
|
for(String st : format.getHoverTextSuffix()) {
|
||||||
hover += Format.FormatStringAll(st) + "\n";
|
hover += Format.FormatStringAll(st) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hover = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getOfflinePlayer(), hover.substring(0, hover.length() - 1)));
|
hover = Format.FormatStringAll(PlaceholderAPI.setBracketPlaceholders(icp.getPlayer(), hover.substring(0, hover.length() - 1)));
|
||||||
temp += convertToJsonColors(lastCode + placeholder, ",\"clickEvent\":{\"action\":\"" + action + "\",\"value\":\"" + text + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[" + convertToJsonColors(hover) + "]}}") + ",";
|
temp += convertToJsonColors(lastCode + placeholder, ",\"clickEvent\":{\"action\":\"" + action + "\",\"value\":\"" + text + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[" + convertToJsonColors(hover) + "]}}") + ",";
|
||||||
lastCode = getLastCode(lastCode + placeholder);
|
lastCode = getLastCode(lastCode + placeholder);
|
||||||
remaining = remaining.substring(indexEnd);
|
remaining = remaining.substring(indexEnd);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: VentureChat
|
name: VentureChat
|
||||||
version: 2.19.2
|
version: 2.19.3
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
main: mineverse.Aust1n46.chat.MineverseChat
|
main: mineverse.Aust1n46.chat.MineverseChat
|
||||||
depend: [Vault, ProtocolLib, PlaceholderAPI]
|
depend: [Vault, ProtocolLib, PlaceholderAPI]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user