mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 02:19:05 +00:00
Move commands.
This commit is contained in:
parent
862c673cd8
commit
9e88a9733b
@ -17,44 +17,44 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
import venture.Aust1n46.chat.controllers.commands.Broadcast;
|
import venture.Aust1n46.chat.initators.commands.Broadcast;
|
||||||
import venture.Aust1n46.chat.controllers.commands.BungeeToggle;
|
import venture.Aust1n46.chat.initators.commands.BungeeToggle;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Channel;
|
import venture.Aust1n46.chat.initators.commands.Channel;
|
||||||
import venture.Aust1n46.chat.controllers.commands.ChannelAlias;
|
import venture.Aust1n46.chat.initators.commands.ChannelAlias;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Channelinfo;
|
import venture.Aust1n46.chat.initators.commands.Channelinfo;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Chatinfo;
|
import venture.Aust1n46.chat.initators.commands.Chatinfo;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Chatreload;
|
import venture.Aust1n46.chat.initators.commands.Chatreload;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Chlist;
|
import venture.Aust1n46.chat.initators.commands.Chlist;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Chwho;
|
import venture.Aust1n46.chat.initators.commands.Chwho;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Clearchat;
|
import venture.Aust1n46.chat.initators.commands.Clearchat;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Commandblock;
|
import venture.Aust1n46.chat.initators.commands.Commandblock;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Commandspy;
|
import venture.Aust1n46.chat.initators.commands.Commandspy;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Edit;
|
import venture.Aust1n46.chat.initators.commands.Edit;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Filter;
|
import venture.Aust1n46.chat.initators.commands.Filter;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Force;
|
import venture.Aust1n46.chat.initators.commands.Force;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Forceall;
|
import venture.Aust1n46.chat.initators.commands.Forceall;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Ignore;
|
import venture.Aust1n46.chat.initators.commands.Ignore;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Kickchannel;
|
import venture.Aust1n46.chat.initators.commands.Kickchannel;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Kickchannelall;
|
import venture.Aust1n46.chat.initators.commands.Kickchannelall;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Leave;
|
import venture.Aust1n46.chat.initators.commands.Leave;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Listen;
|
import venture.Aust1n46.chat.initators.commands.Listen;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Me;
|
import venture.Aust1n46.chat.initators.commands.Me;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Message;
|
import venture.Aust1n46.chat.initators.commands.Message;
|
||||||
import venture.Aust1n46.chat.controllers.commands.MessageToggle;
|
import venture.Aust1n46.chat.initators.commands.MessageToggle;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Mute;
|
import venture.Aust1n46.chat.initators.commands.Mute;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Muteall;
|
import venture.Aust1n46.chat.initators.commands.Muteall;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Notifications;
|
import venture.Aust1n46.chat.initators.commands.Notifications;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Party;
|
import venture.Aust1n46.chat.initators.commands.Party;
|
||||||
import venture.Aust1n46.chat.controllers.commands.RangedSpy;
|
import venture.Aust1n46.chat.initators.commands.RangedSpy;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Removemessage;
|
import venture.Aust1n46.chat.initators.commands.Removemessage;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Reply;
|
import venture.Aust1n46.chat.initators.commands.Reply;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Setchannel;
|
import venture.Aust1n46.chat.initators.commands.Setchannel;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Setchannelall;
|
import venture.Aust1n46.chat.initators.commands.Setchannelall;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Spy;
|
import venture.Aust1n46.chat.initators.commands.Spy;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Unmute;
|
import venture.Aust1n46.chat.initators.commands.Unmute;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Unmuteall;
|
import venture.Aust1n46.chat.initators.commands.Unmuteall;
|
||||||
import venture.Aust1n46.chat.controllers.commands.VentureChatGui;
|
import venture.Aust1n46.chat.initators.commands.VentureChatGui;
|
||||||
import venture.Aust1n46.chat.controllers.commands.Venturechat;
|
import venture.Aust1n46.chat.initators.commands.Venturechat;
|
||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.model.ChatChannel;
|
import venture.Aust1n46.chat.model.ChatChannel;
|
||||||
import venture.Aust1n46.chat.service.ConfigService;
|
import venture.Aust1n46.chat.service.ConfigService;
|
||||||
|
@ -21,7 +21,7 @@ import com.google.inject.Singleton;
|
|||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import venture.Aust1n46.chat.api.events.VentureChatEvent;
|
import venture.Aust1n46.chat.api.events.VentureChatEvent;
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
||||||
import venture.Aust1n46.chat.model.ChatChannel;
|
import venture.Aust1n46.chat.model.ChatChannel;
|
||||||
|
@ -21,7 +21,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.model.ChatChannel;
|
import venture.Aust1n46.chat.model.ChatChannel;
|
||||||
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
||||||
|
@ -9,7 +9,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
import venture.Aust1n46.chat.model.SynchronizedVentureChatPlayer;
|
import venture.Aust1n46.chat.model.SynchronizedVentureChatPlayer;
|
||||||
import venture.Aust1n46.chat.model.TemporaryDataInstance;
|
import venture.Aust1n46.chat.model.TemporaryDataInstance;
|
||||||
import venture.Aust1n46.chat.model.VentureChatProxyServer;
|
import venture.Aust1n46.chat.model.VentureChatProxyServer;
|
||||||
|
@ -16,7 +16,7 @@ import com.google.inject.Inject;
|
|||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
import net.md_5.bungee.config.ConfigurationProvider;
|
import net.md_5.bungee.config.ConfigurationProvider;
|
||||||
import net.md_5.bungee.config.YamlConfiguration;
|
import net.md_5.bungee.config.YamlConfiguration;
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
import venture.Aust1n46.chat.model.SynchronizedVentureChatPlayer;
|
import venture.Aust1n46.chat.model.SynchronizedVentureChatPlayer;
|
||||||
import venture.Aust1n46.chat.model.VentureChatProxySource;
|
import venture.Aust1n46.chat.model.VentureChatProxySource;
|
||||||
import venture.Aust1n46.chat.service.proxy.ProxyUuidService;
|
import venture.Aust1n46.chat.service.proxy.ProxyUuidService;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ public class ChannelAlias extends PlayerCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executeCommand(final Player player, final String commandLabel, final String[] args) {
|
protected void executeCommand(final Player player, final String commandLabel, final String[] args) {
|
||||||
VentureChatPlayer mcp = playerApiService.getOnlineMineverseChatPlayer(player);
|
VentureChatPlayer mcp = playerApiService.getOnlineMineverseChatPlayer(player);
|
||||||
for (ChatChannel channel : configService.getChatChannels()) {
|
for (ChatChannel channel : configService.getChatChannels()) {
|
||||||
if (commandLabel.toLowerCase().equals(channel.getAlias())) {
|
if (commandLabel.toLowerCase().equals(channel.getAlias())) {
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import static venture.Aust1n46.chat.utilities.FormatUtils.LINE_LENGTH;
|
import static venture.Aust1n46.chat.utilities.FormatUtils.LINE_LENGTH;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
public class MuteContainer {
|
public class MuteContainer {
|
||||||
private String channel;
|
private String channel;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import static venture.Aust1n46.chat.utilities.FormatUtils.LINE_LENGTH;
|
import static venture.Aust1n46.chat.utilities.FormatUtils.LINE_LENGTH;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -24,7 +24,7 @@ import venture.Aust1n46.chat.model.VentureChatPlayer;
|
|||||||
import venture.Aust1n46.chat.service.ConfigService;
|
import venture.Aust1n46.chat.service.ConfigService;
|
||||||
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
||||||
import venture.Aust1n46.chat.utilities.FormatUtils;
|
import venture.Aust1n46.chat.utilities.FormatUtils;
|
||||||
import venture.Aust1n46.chat.utilities.VersionHandler;
|
import venture.Aust1n46.chat.xcut.VersionService;
|
||||||
|
|
||||||
public class VentureChatGui extends PlayerCommand {
|
public class VentureChatGui extends PlayerCommand {
|
||||||
@Inject
|
@Inject
|
||||||
@ -33,6 +33,8 @@ public class VentureChatGui extends PlayerCommand {
|
|||||||
private VentureChatPlayerApiService playerApiService;
|
private VentureChatPlayerApiService playerApiService;
|
||||||
@Inject
|
@Inject
|
||||||
private ConfigService configService;
|
private ConfigService configService;
|
||||||
|
@Inject
|
||||||
|
private VersionService versionService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public VentureChatGui(String name) {
|
public VentureChatGui(String name) {
|
||||||
@ -80,13 +82,13 @@ public class VentureChatGui extends PlayerCommand {
|
|||||||
Inventory inv = Bukkit.createInventory(null, this.getSlots(), "VentureChat: " + target.getName() + " GUI");
|
Inventory inv = Bukkit.createInventory(null, this.getSlots(), "VentureChat: " + target.getName() + " GUI");
|
||||||
ItemStack close = null;
|
ItemStack close = null;
|
||||||
ItemStack skull = null;
|
ItemStack skull = null;
|
||||||
if (VersionHandler.is1_7()) {
|
if (versionService.is1_7()) {
|
||||||
close = new ItemStack(Material.BEDROCK);
|
close = new ItemStack(Material.BEDROCK);
|
||||||
} else {
|
} else {
|
||||||
close = new ItemStack(Material.BARRIER);
|
close = new ItemStack(Material.BARRIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VersionHandler.is1_7() || VersionHandler.is1_8() || VersionHandler.is1_9() || VersionHandler.is1_10() || VersionHandler.is1_11() || VersionHandler.is1_12()) {
|
if (versionService.is1_7() || versionService.is1_8() || versionService.is1_9() || versionService.is1_10() || versionService.is1_11() || versionService.is1_12()) {
|
||||||
skull = new ItemStack(Material.getMaterial("SKULL_ITEM"));
|
skull = new ItemStack(Material.getMaterial("SKULL_ITEM"));
|
||||||
} else {
|
} else {
|
||||||
skull = new ItemStack(Material.PLAYER_HEAD);
|
skull = new ItemStack(Material.PLAYER_HEAD);
|
||||||
@ -137,13 +139,13 @@ public class VentureChatGui extends PlayerCommand {
|
|||||||
Inventory inv = Bukkit.createInventory(null, this.getSlots(), "VentureChat: Discord_Message GUI");
|
Inventory inv = Bukkit.createInventory(null, this.getSlots(), "VentureChat: Discord_Message GUI");
|
||||||
ItemStack close = null;
|
ItemStack close = null;
|
||||||
ItemStack skull = null;
|
ItemStack skull = null;
|
||||||
if (VersionHandler.is1_7()) {
|
if (versionService.is1_7()) {
|
||||||
close = new ItemStack(Material.BEDROCK);
|
close = new ItemStack(Material.BEDROCK);
|
||||||
} else {
|
} else {
|
||||||
close = new ItemStack(Material.BARRIER);
|
close = new ItemStack(Material.BARRIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VersionHandler.is1_7() || VersionHandler.is1_8() || VersionHandler.is1_9() || VersionHandler.is1_10() || VersionHandler.is1_11() || VersionHandler.is1_12()) {
|
if (versionService.is1_7() || versionService.is1_8() || versionService.is1_9() || versionService.is1_10() || versionService.is1_11() || versionService.is1_12()) {
|
||||||
skull = new ItemStack(Material.getMaterial("SKULL_ITEM"));
|
skull = new ItemStack(Material.getMaterial("SKULL_ITEM"));
|
||||||
} else {
|
} else {
|
||||||
skull = new ItemStack(Material.PLAYER_HEAD);
|
skull = new ItemStack(Material.PLAYER_HEAD);
|
@ -1,4 +1,4 @@
|
|||||||
package venture.Aust1n46.chat.controllers.commands;
|
package venture.Aust1n46.chat.initators.commands;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
@ -25,7 +25,7 @@ import me.clip.placeholderapi.PlaceholderAPI;
|
|||||||
import net.essentialsx.api.v2.services.discord.DiscordService;
|
import net.essentialsx.api.v2.services.discord.DiscordService;
|
||||||
import venture.Aust1n46.chat.api.events.VentureChatEvent;
|
import venture.Aust1n46.chat.api.events.VentureChatEvent;
|
||||||
import venture.Aust1n46.chat.controllers.PluginMessageController;
|
import venture.Aust1n46.chat.controllers.PluginMessageController;
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
||||||
import venture.Aust1n46.chat.model.ChatChannel;
|
import venture.Aust1n46.chat.model.ChatChannel;
|
||||||
|
@ -12,9 +12,9 @@ import com.google.inject.Singleton;
|
|||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.model.ChatMessage;
|
import venture.Aust1n46.chat.model.ChatMessage;
|
||||||
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
||||||
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
|
||||||
import venture.Aust1n46.chat.utilities.VersionHandler;
|
|
||||||
import venture.Aust1n46.chat.service.VentureChatFormatService;
|
import venture.Aust1n46.chat.service.VentureChatFormatService;
|
||||||
|
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
||||||
|
import venture.Aust1n46.chat.xcut.VersionService;
|
||||||
|
|
||||||
//This class listens for chat packets and intercepts them before they are sent to the Player.
|
//This class listens for chat packets and intercepts them before they are sent to the Player.
|
||||||
//The packets are modified to include advanced json formating and the message remover button if the
|
//The packets are modified to include advanced json formating and the message remover button if the
|
||||||
@ -25,6 +25,9 @@ public class PacketListener extends PacketAdapter {
|
|||||||
private VentureChatFormatService formatter;
|
private VentureChatFormatService formatter;
|
||||||
@Inject
|
@Inject
|
||||||
private VentureChatPlayerApiService playerApiService;
|
private VentureChatPlayerApiService playerApiService;
|
||||||
|
@Inject
|
||||||
|
private VersionService versionService;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PacketListener(final VentureChat plugin) {
|
public PacketListener(final VentureChat plugin) {
|
||||||
@ -49,13 +52,13 @@ public class PacketListener extends PacketAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(VersionHandler.is1_7()) {
|
if(versionService.is1_7()) {
|
||||||
packet.getBooleans().getField(0).setAccessible(true);
|
packet.getBooleans().getField(0).setAccessible(true);
|
||||||
if(!((boolean) packet.getBooleans().getField(0).get(packet.getHandle()))) {
|
if(!((boolean) packet.getBooleans().getField(0).get(packet.getHandle()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(VersionHandler.is1_8() || VersionHandler.is1_9() || VersionHandler.is1_10() || VersionHandler.is1_11()) {
|
else if(versionService.is1_8() || versionService.is1_9() || versionService.is1_10() || versionService.is1_11()) {
|
||||||
packet.getBytes().getField(0).setAccessible(true);
|
packet.getBytes().getField(0).setAccessible(true);
|
||||||
if(((Byte) packet.getBytes().getField(0).get(packet.getHandle())).intValue() > 1) {
|
if(((Byte) packet.getBytes().getField(0).get(packet.getHandle())).intValue() > 1) {
|
||||||
return;
|
return;
|
||||||
|
@ -30,12 +30,12 @@ import venture.Aust1n46.chat.model.Alias;
|
|||||||
import venture.Aust1n46.chat.model.ChatChannel;
|
import venture.Aust1n46.chat.model.ChatChannel;
|
||||||
import venture.Aust1n46.chat.model.GuiSlot;
|
import venture.Aust1n46.chat.model.GuiSlot;
|
||||||
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
||||||
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
|
||||||
import venture.Aust1n46.chat.utilities.FormatUtils;
|
|
||||||
import venture.Aust1n46.chat.utilities.VersionHandler;
|
|
||||||
import venture.Aust1n46.chat.service.ConfigService;
|
import venture.Aust1n46.chat.service.ConfigService;
|
||||||
import venture.Aust1n46.chat.service.VentureChatDatabaseService;
|
import venture.Aust1n46.chat.service.VentureChatDatabaseService;
|
||||||
import venture.Aust1n46.chat.service.VentureChatFormatService;
|
import venture.Aust1n46.chat.service.VentureChatFormatService;
|
||||||
|
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
||||||
|
import venture.Aust1n46.chat.utilities.FormatUtils;
|
||||||
|
import venture.Aust1n46.chat.xcut.VersionService;
|
||||||
|
|
||||||
//This class listens for commands (Any chat that begins with a /) to use in the command spy and
|
//This class listens for commands (Any chat that begins with a /) to use in the command spy and
|
||||||
//in the custom commands such as aliases.
|
//in the custom commands such as aliases.
|
||||||
@ -53,6 +53,8 @@ public class PreProcessCommandListener implements CommandExecutor, Listener {
|
|||||||
private VentureChatPlayerApiService playerApiService;
|
private VentureChatPlayerApiService playerApiService;
|
||||||
@Inject
|
@Inject
|
||||||
private ConfigService configService;
|
private ConfigService configService;
|
||||||
|
@Inject
|
||||||
|
private VersionService versionService;
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) throws FileNotFoundException {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) throws FileNotFoundException {
|
||||||
@ -261,7 +263,7 @@ public class PreProcessCommandListener implements CommandExecutor, Listener {
|
|||||||
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
|
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
|
||||||
ChatChannel channel = configService.getChannel(ChatColor.stripColor(skullMeta.getLore().get(0)).replace("Channel: ", ""));
|
ChatChannel channel = configService.getChannel(ChatColor.stripColor(skullMeta.getLore().get(0)).replace("Channel: ", ""));
|
||||||
int hash = Integer.parseInt(ChatColor.stripColor(skullMeta.getLore().get(1).replace("Hash: ", "")));
|
int hash = Integer.parseInt(ChatColor.stripColor(skullMeta.getLore().get(1).replace("Hash: ", "")));
|
||||||
if(VersionHandler.is1_7()) {
|
if(versionService.is1_7()) {
|
||||||
if(item.getType() == Material.BEDROCK) {
|
if(item.getType() == Material.BEDROCK) {
|
||||||
mcp.getPlayer().closeInventory();
|
mcp.getPlayer().closeInventory();
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,13 @@ package venture.Aust1n46.chat.initiators.schedulers;
|
|||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
import venture.Aust1n46.chat.controllers.PluginMessageController;
|
import venture.Aust1n46.chat.controllers.PluginMessageController;
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
||||||
import venture.Aust1n46.chat.model.ChatChannel;
|
import venture.Aust1n46.chat.model.ChatChannel;
|
||||||
@ -26,10 +26,11 @@ public class UnmuteScheduler {
|
|||||||
private VentureChatPlayerApiService playerApiService;
|
private VentureChatPlayerApiService playerApiService;
|
||||||
@Inject
|
@Inject
|
||||||
private ConfigService configService;
|
private ConfigService configService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public void postConstruct() {
|
public void postConstruct() {
|
||||||
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
|
final Server server = plugin.getServer();
|
||||||
|
BukkitScheduler scheduler = server.getScheduler();
|
||||||
scheduler.runTaskTimerAsynchronously(plugin, new Runnable() {
|
scheduler.runTaskTimerAsynchronously(plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -38,7 +39,7 @@ public class UnmuteScheduler {
|
|||||||
Iterator<MuteContainer> iterator = p.getMutes().iterator();
|
Iterator<MuteContainer> iterator = p.getMutes().iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MuteContainer mute = iterator.next();
|
MuteContainer mute = iterator.next();
|
||||||
if(configService.isChannel(mute.getChannel())) {
|
if (configService.isChannel(mute.getChannel())) {
|
||||||
ChatChannel channel = configService.getChannel(mute.getChannel());
|
ChatChannel channel = configService.getChannel(mute.getChannel());
|
||||||
long timemark = mute.getDuration();
|
long timemark = mute.getDuration();
|
||||||
if (timemark == 0) {
|
if (timemark == 0) {
|
||||||
@ -49,10 +50,9 @@ public class UnmuteScheduler {
|
|||||||
}
|
}
|
||||||
if (currentTimeMillis >= timemark) {
|
if (currentTimeMillis >= timemark) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
p.getPlayer().sendMessage(LocalizedMessage.UNMUTE_PLAYER_PLAYER.toString()
|
p.getPlayer().sendMessage(LocalizedMessage.UNMUTE_PLAYER_PLAYER.toString().replace("{player}", p.getName())
|
||||||
.replace("{player}", p.getName()).replace("{channel_color}", channel.getColor())
|
.replace("{channel_color}", channel.getColor()).replace("{channel_name}", mute.getChannel()));
|
||||||
.replace("{channel_name}", mute.getChannel()));
|
if (channel.getBungee()) {
|
||||||
if(channel.getBungee()) {
|
|
||||||
pluginMessageController.synchronize(p, true);
|
pluginMessageController.synchronize(p, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,8 +60,7 @@ public class UnmuteScheduler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (plugin.getConfig().getString("loglevel", "info").equals("trace")) {
|
if (plugin.getConfig().getString("loglevel", "info").equals("trace")) {
|
||||||
Bukkit.getConsoleSender()
|
server.getConsoleSender().sendMessage(FormatUtils.FormatStringAll("&8[&eVentureChat&8]&e - Updating Player Mutes"));
|
||||||
.sendMessage(FormatUtils.FormatStringAll("&8[&eVentureChat&8]&e - Updating Player Mutes"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 0L, 60L); // three second interval
|
}, 0L, 60L); // three second interval
|
||||||
|
@ -2,37 +2,36 @@ package venture.Aust1n46.chat.localization;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.utilities.FormatUtils;
|
import venture.Aust1n46.chat.utilities.FormatUtils;
|
||||||
|
|
||||||
//This class is used to create objects of localization for different languages.
|
|
||||||
public class Localization {
|
public class Localization {
|
||||||
private static final String VERSION = "2.22.4";
|
private static final String VERSION = "2.22.4";
|
||||||
private static FileConfiguration localization;
|
private static FileConfiguration localization;
|
||||||
|
|
||||||
public static void initialize(final VentureChat plugin) {
|
public static void initialize(final VentureChat plugin) {
|
||||||
File localizationFile = new File(plugin.getDataFolder().getAbsolutePath(), "Messages.yml");
|
File localizationFile = new File(plugin.getDataFolder().getAbsolutePath(), "Messages.yml");
|
||||||
if(!localizationFile.isFile()) {
|
if (!localizationFile.isFile()) {
|
||||||
plugin.saveResource("Messages.yml", true);
|
plugin.saveResource("Messages.yml", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
localization = YamlConfiguration.loadConfiguration(localizationFile);
|
localization = YamlConfiguration.loadConfiguration(localizationFile);
|
||||||
|
|
||||||
String fileVersion = localization.getString("Version", "null");
|
String fileVersion = localization.getString("Version", "null");
|
||||||
|
|
||||||
if(!fileVersion.equals(VERSION)) {
|
if (!fileVersion.equals(VERSION)) {
|
||||||
Bukkit.getConsoleSender().sendMessage(FormatUtils.FormatStringAll("&8[&eVentureChat&8]&e - Version Change Detected! Saving Old Messages.yml and Generating Latest File"));
|
plugin.getServer().getConsoleSender()
|
||||||
|
.sendMessage(FormatUtils.FormatStringAll("&8[&eVentureChat&8]&e - Version Change Detected! Saving Old Messages.yml and Generating Latest File"));
|
||||||
localizationFile.renameTo(new File(plugin.getDataFolder().getAbsolutePath(), "Messages_Old_" + fileVersion + ".yml"));
|
localizationFile.renameTo(new File(plugin.getDataFolder().getAbsolutePath(), "Messages_Old_" + fileVersion + ".yml"));
|
||||||
plugin.saveResource("Messages.yml", true);
|
plugin.saveResource("Messages.yml", true);
|
||||||
localization = YamlConfiguration.loadConfiguration(localizationFile);
|
localization = YamlConfiguration.loadConfiguration(localizationFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FileConfiguration getLocalization() {
|
public static FileConfiguration getLocalization() {
|
||||||
return localization;
|
return localization;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
|
|
||||||
public class SynchronizedVentureChatPlayer {
|
public class SynchronizedVentureChatPlayer {
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
@ -13,7 +13,7 @@ import org.bukkit.entity.Player;
|
|||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import venture.Aust1n46.chat.controllers.commands.MuteContainer;
|
import venture.Aust1n46.chat.initators.commands.MuteContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper for {@link Player}
|
* Wrapper for {@link Player}
|
||||||
|
@ -33,7 +33,7 @@ import venture.Aust1n46.chat.model.JsonAttribute;
|
|||||||
import venture.Aust1n46.chat.model.JsonFormat;
|
import venture.Aust1n46.chat.model.JsonFormat;
|
||||||
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
||||||
import venture.Aust1n46.chat.utilities.FormatUtils;
|
import venture.Aust1n46.chat.utilities.FormatUtils;
|
||||||
import venture.Aust1n46.chat.utilities.VersionHandler;
|
import venture.Aust1n46.chat.xcut.VersionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class containing chat formatting methods.
|
* Class containing chat formatting methods.
|
||||||
@ -52,6 +52,8 @@ public class VentureChatFormatService {
|
|||||||
private VentureChatPlayerApiService playerApiService;
|
private VentureChatPlayerApiService playerApiService;
|
||||||
@Inject
|
@Inject
|
||||||
private ConfigService configService;
|
private ConfigService configService;
|
||||||
|
@Inject
|
||||||
|
private VersionService versionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a message to Minecraft JSON formatting while applying the
|
* Converts a message to Minecraft JSON formatting while applying the
|
||||||
@ -451,7 +453,7 @@ public class VentureChatFormatService {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public String toColoredText(Object o, Class<?> c) {
|
public String toColoredText(Object o, Class<?> c) {
|
||||||
if (VersionHandler.is1_7()) {
|
if (versionService.is1_7()) {
|
||||||
return "\"extra\":[{\"text\":\"Hover to see original message is not currently supported in 1.7\",\"color\":\"red\"}]";
|
return "\"extra\":[{\"text\":\"Hover to see original message is not currently supported in 1.7\",\"color\":\"red\"}]";
|
||||||
}
|
}
|
||||||
List<Object> finalList = new ArrayList<>();
|
List<Object> finalList = new ArrayList<>();
|
||||||
@ -461,10 +463,10 @@ public class VentureChatFormatService {
|
|||||||
splitComponents(finalList, o, c);
|
splitComponents(finalList, o, c);
|
||||||
for (Object component : finalList) {
|
for (Object component : finalList) {
|
||||||
try {
|
try {
|
||||||
if (VersionHandler.is1_8() || VersionHandler.is1_9() || VersionHandler.is1_10()
|
if (versionService.is1_8() || versionService.is1_9() || versionService.is1_10()
|
||||||
|| VersionHandler.is1_11() || VersionHandler.is1_12() || VersionHandler.is1_13()
|
|| versionService.is1_11() || versionService.is1_12() || versionService.is1_13()
|
||||||
|| VersionHandler.is1_14() || VersionHandler.is1_15() || VersionHandler.is1_16()
|
|| versionService.is1_14() || versionService.is1_15() || versionService.is1_16()
|
||||||
|| VersionHandler.is1_17()) {
|
|| versionService.is1_17()) {
|
||||||
String text = (String) component.getClass().getMethod("getText").invoke(component);
|
String text = (String) component.getClass().getMethod("getText").invoke(component);
|
||||||
Object chatModifier = component.getClass().getMethod("getChatModifier").invoke(component);
|
Object chatModifier = component.getClass().getMethod("getChatModifier").invoke(component);
|
||||||
Object color = chatModifier.getClass().getMethod("getColor").invoke(chatModifier);
|
Object color = chatModifier.getClass().getMethod("getColor").invoke(chatModifier);
|
||||||
@ -533,12 +535,12 @@ public class VentureChatFormatService {
|
|||||||
try {
|
try {
|
||||||
splitComponents(finalList, o, c);
|
splitComponents(finalList, o, c);
|
||||||
for (Object component : finalList) {
|
for (Object component : finalList) {
|
||||||
if (VersionHandler.is1_7()) {
|
if (versionService.is1_7()) {
|
||||||
stringbuilder.append((String) component.getClass().getMethod("e").invoke(component));
|
stringbuilder.append((String) component.getClass().getMethod("e").invoke(component));
|
||||||
} else if (VersionHandler.is1_8() || VersionHandler.is1_9() || VersionHandler.is1_10()
|
} else if (versionService.is1_8() || versionService.is1_9() || versionService.is1_10()
|
||||||
|| VersionHandler.is1_11() || VersionHandler.is1_12() || VersionHandler.is1_13()
|
|| versionService.is1_11() || versionService.is1_12() || versionService.is1_13()
|
||||||
|| VersionHandler.is1_14() || VersionHandler.is1_15() || VersionHandler.is1_16()
|
|| versionService.is1_14() || versionService.is1_15() || versionService.is1_16()
|
||||||
|| VersionHandler.is1_17()) {
|
|| versionService.is1_17()) {
|
||||||
stringbuilder.append((String) component.getClass().getMethod("getText").invoke(component));
|
stringbuilder.append((String) component.getClass().getMethod("getText").invoke(component));
|
||||||
} else {
|
} else {
|
||||||
stringbuilder.append((String) component.getClass().getMethod("getString").invoke(component));
|
stringbuilder.append((String) component.getClass().getMethod("getString").invoke(component));
|
||||||
@ -551,9 +553,9 @@ public class VentureChatFormatService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void splitComponents(List<Object> finalList, Object o, Class<?> c) throws Exception {
|
private void splitComponents(List<Object> finalList, Object o, Class<?> c) throws Exception {
|
||||||
if (VersionHandler.is1_7() || VersionHandler.is1_8() || VersionHandler.is1_9() || VersionHandler.is1_10()
|
if (versionService.is1_7() || versionService.is1_8() || versionService.is1_9() || versionService.is1_10()
|
||||||
|| VersionHandler.is1_11() || VersionHandler.is1_12() || VersionHandler.is1_13()
|
|| versionService.is1_11() || versionService.is1_12() || versionService.is1_13()
|
||||||
|| (VersionHandler.is1_14() && !VersionHandler.is1_14_4())) {
|
|| (versionService.is1_14() && !versionService.is1_14_4())) {
|
||||||
ArrayList<?> list = (ArrayList<?>) c.getMethod("a").invoke(o, new Object[0]);
|
ArrayList<?> list = (ArrayList<?>) c.getMethod("a").invoke(o, new Object[0]);
|
||||||
for (Object component : list) {
|
for (Object component : list) {
|
||||||
ArrayList<?> innerList = (ArrayList<?>) c.getMethod("a").invoke(component, new Object[0]);
|
ArrayList<?> innerList = (ArrayList<?>) c.getMethod("a").invoke(component, new Object[0]);
|
||||||
@ -563,8 +565,8 @@ public class VentureChatFormatService {
|
|||||||
finalList.add(component);
|
finalList.add(component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (VersionHandler.is1_14_4() || VersionHandler.is1_15() || VersionHandler.is1_16()
|
} else if (versionService.is1_14_4() || versionService.is1_15() || versionService.is1_16()
|
||||||
|| VersionHandler.is1_17()) {
|
|| versionService.is1_17()) {
|
||||||
ArrayList<?> list = (ArrayList<?>) c.getMethod("getSiblings").invoke(o, new Object[0]);
|
ArrayList<?> list = (ArrayList<?>) c.getMethod("getSiblings").invoke(o, new Object[0]);
|
||||||
for (Object component : list) {
|
for (Object component : list) {
|
||||||
ArrayList<?> innerList = (ArrayList<?>) c.getMethod("getSiblings").invoke(component, new Object[0]);
|
ArrayList<?> innerList = (ArrayList<?>) c.getMethod("getSiblings").invoke(component, new Object[0]);
|
||||||
@ -637,7 +639,7 @@ public class VentureChatFormatService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Sound getDefaultMessageSound() {
|
private Sound getDefaultMessageSound() {
|
||||||
if (VersionHandler.is1_7() || VersionHandler.is1_8()) {
|
if (versionService.is1_7() || versionService.is1_8()) {
|
||||||
return Sound.valueOf(DEFAULT_LEGACY_MESSAGE_SOUND);
|
return Sound.valueOf(DEFAULT_LEGACY_MESSAGE_SOUND);
|
||||||
} else {
|
} else {
|
||||||
return Sound.valueOf(DEFAULT_MESSAGE_SOUND);
|
return Sound.valueOf(DEFAULT_MESSAGE_SOUND);
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
package venture.Aust1n46.chat.utilities;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
//This class contains methods for determining what version of Minecraft the server is running.
|
|
||||||
public class VersionHandler {
|
|
||||||
|
|
||||||
public static boolean is1_7() {
|
|
||||||
return Bukkit.getVersion().contains("1.7");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_8() {
|
|
||||||
return Bukkit.getVersion().contains("1.8");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_9() {
|
|
||||||
return Bukkit.getVersion().contains("1.9");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_10() {
|
|
||||||
return Bukkit.getVersion().contains("1.10");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_11() {
|
|
||||||
return Bukkit.getVersion().contains("1.11");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_12() {
|
|
||||||
return Bukkit.getVersion().contains("1.12");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_13() {
|
|
||||||
return Bukkit.getVersion().contains("1.13");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_14() {
|
|
||||||
return Bukkit.getVersion().contains("1.14");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_14_4() {
|
|
||||||
return Bukkit.getVersion().contains("1.14.4");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_15() {
|
|
||||||
return Bukkit.getVersion().contains("1.15");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_16() {
|
|
||||||
return Bukkit.getVersion().contains("1.16");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean is1_17() {
|
|
||||||
return Bukkit.getVersion().contains("1.17");
|
|
||||||
}
|
|
||||||
}
|
|
58
src/main/java/venture/Aust1n46/chat/xcut/VersionService.java
Normal file
58
src/main/java/venture/Aust1n46/chat/xcut/VersionService.java
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
package venture.Aust1n46.chat.xcut;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
|
|
||||||
|
public class VersionService {
|
||||||
|
@Inject
|
||||||
|
private VentureChat plugin;
|
||||||
|
|
||||||
|
public boolean is1_7() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.7");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_8() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.8");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_9() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.9");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_10() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.10");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_11() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.11");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_12() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.12");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_13() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.13");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_14() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.14");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_14_4() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.14.4");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_15() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.15");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_16() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.16");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean is1_17() {
|
||||||
|
return plugin.getServer().getVersion().contains("1.17");
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user