Recode Class Names
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package net.t2code.t2codelib.SPIGOT.api.bungeePlayers;
|
||||
|
||||
public enum T2CbungeePlayersEnum {
|
||||
public enum T2C_BngeePlayersEnum {
|
||||
JOIN,
|
||||
QUIT,
|
||||
GIVEALL,
|
@@ -1,36 +1,37 @@
|
||||
package net.t2code.t2codelib.SPIGOT.api.bungeePlayers;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.T2CLibConfig;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.T2C_LibConfig;
|
||||
import net.t2code.t2codelib.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class T2CbungeePlayers implements PluginMessageListener {
|
||||
public class T2C_BungeePlayers implements PluginMessageListener {
|
||||
@Getter
|
||||
private static List<String> bungeePlayers = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||
public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, byte[] message) {
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "stream: " + stream.toString());
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "stream: " + stream.toString());
|
||||
try {
|
||||
T2CbungeePlayersEnum subChannel = T2CbungeePlayersEnum.valueOf(stream.readUTF());
|
||||
T2C_BngeePlayersEnum subChannel = T2C_BngeePlayersEnum.valueOf(stream.readUTF());
|
||||
String input = stream.readUTF();
|
||||
String uuid = stream.readUTF();
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received channel: " + channel);
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received subChannel: " + subChannel.name());
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received input: " + input);
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received input2/uuid: " + uuid);
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received channel: " + channel);
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received subChannel: " + subChannel.name());
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received input: " + input);
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received input2/uuid: " + uuid);
|
||||
switch (subChannel) {
|
||||
case JOIN:
|
||||
bungeePlayers.add(input);
|
||||
@@ -39,7 +40,7 @@ public class T2CbungeePlayers implements PluginMessageListener {
|
||||
bungeePlayers.remove(input);
|
||||
break;
|
||||
case GIVEALL:
|
||||
if (!T2CLibConfig.VALUES.serverUUID.getValue().equals(uuid)) {
|
||||
if (!T2C_LibConfig.VALUES.serverUUID.getValue().equals(uuid)) {
|
||||
return;
|
||||
}
|
||||
bungeePlayers.clear();
|
||||
@@ -51,7 +52,7 @@ public class T2CbungeePlayers implements PluginMessageListener {
|
||||
break;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
T2C_Send.sendException(e, T2CodeLibMain.getPlugin().getLogger());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,17 +69,17 @@ public class T2CbungeePlayers implements PluginMessageListener {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(stream);
|
||||
try {
|
||||
output.writeUTF(T2CbungeePlayersEnum.GIVEALL.name());
|
||||
output.writeUTF(T2CLibConfig.VALUES.serverUUID.getValue().toString());
|
||||
output.writeUTF(T2C_BngeePlayersEnum.GIVEALL.name());
|
||||
output.writeUTF(T2C_LibConfig.VALUES.serverUUID.getValue().toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
T2C_Send.sendException(e, T2CodeLibMain.getPlugin().getLogger());
|
||||
}
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bonlp", stream.toByteArray());
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received channel: t2c:bonlp");
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage send subChannel: " + T2CbungeePlayersEnum.GIVEALL.name());
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage send output/uuid: " + T2CLibConfig.VALUES.serverUUID.getValue().toString());
|
||||
player.sendPluginMessage(T2CodeLibMain.getPlugin(), Util.getPluginChannel_ProxyOnlinePlayers(), stream.toByteArray());
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received channel: " + Util.getPluginChannel_ProxyOnlinePlayers());
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage send subChannel: " + T2C_BngeePlayersEnum.GIVEALL.name());
|
||||
T2C_Debug.debug(T2CodeLibMain.getPlugin(), "PluginMessage send output/uuid: " + T2C_LibConfig.VALUES.serverUUID.getValue().toString());
|
||||
return;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user