Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
37db515726 | |||
|
6c412f5360 | ||
0fcf436dbf | |||
1762afce07 | |||
9916040c63 | |||
1b589759fb | |||
6ee14b4782 | |||
|
2d916c7e0c | ||
8567e6b3b2 | |||
b64c1e7c59 | |||
1b12c2728b | |||
eb7fd03650 |
37
.gitea/ISSUE_TEMPLATE/bug_report.md
Normal file
37
.gitea/ISSUE_TEMPLATE/bug_report.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels:
|
||||||
|
- "bug report"
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Description of issue:**
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Plugin Version (using`/t2c info`):**
|
||||||
|
|
||||||
|
**Server Type (Spigot/Paperspigot/etc):**
|
||||||
|
|
||||||
|
**Server Version (using `/ver`):**
|
||||||
|
|
||||||
|
**Relevant plugins (Delete if this isn't needed):**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**ERROR (DELETE IF YOU HAVE NO ERROR):**
|
||||||
|
```
|
||||||
|
######################
|
||||||
|
## REPLACE WITH ERROR ##
|
||||||
|
######################
|
||||||
|
```
|
||||||
|
|
||||||
|
**CONFIG SECTION (DELETE IF NOT RELEVANT):**
|
||||||
|
```
|
||||||
|
#######################################
|
||||||
|
## REPLACE WITH RELEVANT CONFIG SECTION ##
|
||||||
|
#######################################
|
||||||
|
```
|
21
.gitea/ISSUE_TEMPLATE/feature_request.md
Normal file
21
.gitea/ISSUE_TEMPLATE/feature_request.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea/improvement
|
||||||
|
title: ''
|
||||||
|
labels:
|
||||||
|
- "feature request"
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Description of feature request:**
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Plugin Version (using`/t2c info`):**
|
||||||
|
|
||||||
|
**Server Type (Spigot/Paperspigot/etc):**
|
||||||
|
|
||||||
|
**Server Version (using `/ver`):**
|
||||||
|
|
||||||
|
**Relevant plugins (Delete if this isn't needed):**
|
22
.gitea/ISSUE_TEMPLATE/question.md
Normal file
22
.gitea/ISSUE_TEMPLATE/question.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Question
|
||||||
|
about: Ask a question or get advice
|
||||||
|
title: ''
|
||||||
|
labels:
|
||||||
|
- question
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Share your question here:**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Plugin Version (using`/t2c info`):**
|
||||||
|
|
||||||
|
**Server Type (Spigot/Paperspigot/etc):**
|
||||||
|
|
||||||
|
**Server Version (using `/ver`):**
|
||||||
|
|
||||||
|
**Relevant plugins (Delete if this isn't needed):**
|
||||||
|
|
||||||
|
---
|
17
pom.xml
17
pom.xml
@@ -6,9 +6,10 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>13.6</version>
|
<version>14.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
|
||||||
<name>T2CodeLib</name>
|
<name>T2CodeLib</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -106,7 +107,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.19.2-R0.1-SNAPSHOT</version>
|
<version>1.19.3-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- repo.t2code / T2Code -->
|
<!-- repo.t2code / T2Code -->
|
||||||
@@ -133,33 +134,33 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
<version>2.11.1</version>
|
<version>2.11.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- votingplugin -->
|
<!-- votingplugin -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.bencodez</groupId>
|
<groupId>com.bencodez</groupId>
|
||||||
<artifactId>votingplugin</artifactId>
|
<artifactId>votingplugin</artifactId>
|
||||||
<version>LATEST</version>
|
<version>6.10.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--Kyori MiniMessage-->
|
<!--Kyori MiniMessage-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
<artifactId>adventure-text-minimessage</artifactId>
|
||||||
<version>4.11.0</version>
|
<version>4.12.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-platform-bukkit</artifactId>
|
<artifactId>adventure-platform-bukkit</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.2.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-platform-bungeecord</artifactId>
|
<artifactId>adventure-platform-bungeecord</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.2.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
||||||
@@ -180,7 +181,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpmime</artifactId>
|
<artifactId>httpmime</artifactId>
|
||||||
<version>4.5.13</version>
|
<version>4.5.14</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@@ -0,0 +1,99 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.api.bungeePlayers;
|
||||||
|
|
||||||
|
import net.md_5.bungee.BungeeCord;
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||||
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
|
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.T2CodeBMain;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2CbungeePlayersEnum;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class T2CBbungeePlayers implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onJoin(PostLoginEvent e) {
|
||||||
|
sendToSpigotPlayer(e.getPlayer().getName(), T2CbungeePlayersEnum.JOIN, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onDisconnect(PlayerDisconnectEvent e) {
|
||||||
|
sendToSpigotPlayer(e.getPlayer().getName(), T2CbungeePlayersEnum.QUIT, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendToSpigotPlayer(String name, T2CbungeePlayersEnum value, String uuid) {
|
||||||
|
switch (value) {
|
||||||
|
case JOIN:
|
||||||
|
case QUIT:
|
||||||
|
sendToSpigotPlayerExecute(name, value, uuid);
|
||||||
|
break;
|
||||||
|
case GIVEALL:
|
||||||
|
StringBuilder input = new StringBuilder();
|
||||||
|
for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
|
||||||
|
input.append(player.getName()).append(";");
|
||||||
|
}
|
||||||
|
sendToSpigotPlayerExecute(input.toString(), T2CbungeePlayersEnum.GIVEALL, uuid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sendToSpigotPlayerExecute(String name, T2CbungeePlayersEnum value, String uuid) {
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
output.writeUTF(value.name());
|
||||||
|
output.writeUTF(name);
|
||||||
|
output.writeUTF(uuid);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Logger.getLogger(e.getMessage());
|
||||||
|
}
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received channel: t2c:bonlp");
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received subChannel: " + value.name());
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received input: " + name);
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received input2/uuid: " + uuid);
|
||||||
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
|
server.sendData("t2c:bonlp", stream.toByteArray());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendToSpigotDeleteAll() {
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
output.writeUTF(T2CbungeePlayersEnum.CLEAR.name());
|
||||||
|
output.writeUTF("");
|
||||||
|
output.writeUTF("");
|
||||||
|
} catch (IOException e) {
|
||||||
|
Logger.getLogger(e.getMessage());
|
||||||
|
}
|
||||||
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
|
server.sendData("t2c:bonlp", stream.toByteArray());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPluginMessage(PluginMessageEvent event) {
|
||||||
|
if (event.getTag().equalsIgnoreCase("t2c:bonlp")) {
|
||||||
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
|
event.setCancelled(true);
|
||||||
|
try {
|
||||||
|
T2CbungeePlayersEnum subChannel = T2CbungeePlayersEnum.valueOf(stream.readUTF());
|
||||||
|
String input = stream.readUTF();
|
||||||
|
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received channel: " + event.getTag());
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received subChannel: " + subChannel.name());
|
||||||
|
T2CBsend.debug(T2CodeBMain.getPlugin(), "PluginMessage received input/uuid: " + input);
|
||||||
|
|
||||||
|
sendToSpigotPlayer("", subChannel, input);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -11,13 +11,13 @@ import java.util.logging.Level;
|
|||||||
|
|
||||||
public class T2CBsend {
|
public class T2CBsend {
|
||||||
public static void console(String msg) {
|
public static void console(String msg) {
|
||||||
if (T2CodeBMain.getMmIsLoad()) {
|
if (T2CodeBMain.getMmIsLoad() && T2CodeBMain.getMmIsLoad()) {
|
||||||
T2CBminiMessage.sendConsoleMiniMessage(msg);
|
T2CBminiMessage.sendConsoleMiniMessage(msg);
|
||||||
} else ProxyServer.getInstance().getConsole().sendMessage(msg);
|
} else ProxyServer.getInstance().getConsole().sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void player(ProxiedPlayer player, String msg) {
|
public static void player(ProxiedPlayer player, String msg) {
|
||||||
if (T2CodeBMain.getMmIsLoad()) {
|
if (T2CodeBMain.getMmIsLoad()&& T2CodeBMain.getMmIsLoad()) {
|
||||||
T2CBminiMessage.sendPlayerMiniMessage(msg, player);
|
T2CBminiMessage.sendPlayerMiniMessage(msg, player);
|
||||||
} else player.sendMessage(msg);
|
} else player.sendMessage(msg);
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public class T2CBsend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void sender(CommandSender sender, String msg) {
|
public static void sender(CommandSender sender, String msg) {
|
||||||
if (T2CodeBMain.getMmIsLoad()) {
|
if (T2CodeBMain.getMmIsLoad()&& T2CodeBMain.getMmIsLoad()) {
|
||||||
T2CBminiMessage.sendSenderMiniMessage(msg, sender);
|
T2CBminiMessage.sendSenderMiniMessage(msg, sender);
|
||||||
} else sender.sendMessage(msg);
|
} else sender.sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
|||||||
import net.t2code.t2codelib.BUNGEE.api.update.T2CBupdateAPI;
|
import net.t2code.t2codelib.BUNGEE.api.update.T2CBupdateAPI;
|
||||||
import net.t2code.t2codelib.BUNGEE.system.bstats.T2CBmetrics;
|
import net.t2code.t2codelib.BUNGEE.system.bstats.T2CBmetrics;
|
||||||
import net.t2code.t2codelib.BUNGEE.system.config.T2CBlibConfig;
|
import net.t2code.t2codelib.BUNGEE.system.config.T2CBlibConfig;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.bungeePlayers.T2CBbungeePlayers;
|
||||||
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.T2CplmsgBcmd;
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.T2CplmsgBcmd;
|
||||||
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.autoResponse.T2CapiAutoResponse;
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.autoResponse.T2CapiAutoResponse;
|
||||||
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.commandgui.T2CapiCGUI;
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.commandgui.T2CapiCGUI;
|
||||||
@@ -39,8 +40,12 @@ public class T2CBload {
|
|||||||
plugin.getProxy().registerChannel("t2c:bcmd");
|
plugin.getProxy().registerChannel("t2c:bcmd");
|
||||||
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CplmsgBcmd());
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CplmsgBcmd());
|
||||||
|
|
||||||
|
plugin.getProxy().registerChannel("t2c:bonlp");
|
||||||
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CBbungeePlayers());
|
||||||
|
T2CBbungeePlayers.sendToSpigotDeleteAll();
|
||||||
|
|
||||||
if (T2CBlibConfig.getApiCommandGUIEnable()) {
|
if (T2CBlibConfig.getApiCommandGUIEnable()) {
|
||||||
plugin.getProxy().registerChannel("t2c:cgui");
|
plugin.getProxy().registerChannel("t2c:cguiopl");
|
||||||
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CapiCGUI());
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CapiCGUI());
|
||||||
T2CapiCGUI.sendToSpigotDeleteAll();
|
T2CapiCGUI.sendToSpigotDeleteAll();
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
package net.t2code.t2codelib.BUNGEE.system;
|
package net.t2code.t2codelib.BUNGEE.system;
|
||||||
|
|
||||||
import lombok.NonNull;
|
|
||||||
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
|
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.bungeePlayers.T2CBbungeePlayers;
|
||||||
import net.t2code.t2codelib.Util;
|
import net.t2code.t2codelib.Util;
|
||||||
|
|
||||||
public class T2CodeBMain extends Plugin {
|
public class T2CodeBMain extends Plugin {
|
||||||
@@ -37,7 +37,9 @@ public class T2CodeBMain extends Plugin {
|
|||||||
autor = plugin.getDescription().getAuthor();
|
autor = plugin.getDescription().getAuthor();
|
||||||
try {
|
try {
|
||||||
adventure = BungeeAudiences.create(this);
|
adventure = BungeeAudiences.create(this);
|
||||||
|
T2CBsend.info(this,"Adventure load!");
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
|
T2CBsend.error(this,"Adventure can not be load!");
|
||||||
mmIsLoad = false;
|
mmIsLoad = false;
|
||||||
}
|
}
|
||||||
T2CBload.onLoad(plugin, Util.getPrefix(), autor, orgVersion, Util.getSpigot(), Util.getDiscord(), Util.getSpigotID(), Util.getBstatsID(),Util.getGit());
|
T2CBload.onLoad(plugin, Util.getPrefix(), autor, orgVersion, Util.getSpigot(), Util.getDiscord(), Util.getSpigotID(), Util.getBstatsID(),Util.getGit());
|
||||||
@@ -49,6 +51,7 @@ public class T2CodeBMain extends Plugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// Plugin shutdown logic
|
// Plugin shutdown logic
|
||||||
|
T2CBbungeePlayers.sendToSpigotDeleteAll();
|
||||||
if (mmIsLoad){
|
if (mmIsLoad){
|
||||||
if(adventure != null) {
|
if(adventure != null) {
|
||||||
adventure.close();
|
adventure.close();
|
||||||
|
@@ -0,0 +1,83 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.bungeePlayers;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class T2CbungeePlayers implements PluginMessageListener {
|
||||||
|
@Getter
|
||||||
|
private static List<String> bungeePlayers = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||||
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "stream: " + stream.toString());
|
||||||
|
try {
|
||||||
|
T2CbungeePlayersEnum subChannel = T2CbungeePlayersEnum.valueOf(stream.readUTF());
|
||||||
|
String input = stream.readUTF();
|
||||||
|
String uuid = stream.readUTF();
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage received channel: " + channel);
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage received subChannel: " + subChannel.name());
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage received input: " + input);
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage received input2/uuid: " + uuid);
|
||||||
|
switch (subChannel) {
|
||||||
|
case JOIN:
|
||||||
|
bungeePlayers.add(input);
|
||||||
|
break;
|
||||||
|
case QUIT:
|
||||||
|
bungeePlayers.remove(input);
|
||||||
|
break;
|
||||||
|
case GIVEALL:
|
||||||
|
if (!Util.getServerUUID().toString().equals(uuid)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bungeePlayers.clear();
|
||||||
|
String[] in = input.split(";");
|
||||||
|
bungeePlayers.addAll(Arrays.asList(in));
|
||||||
|
break;
|
||||||
|
case CLEAR:
|
||||||
|
bungeePlayers.clear();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void callAllBungeePlayers() {
|
||||||
|
if (Bukkit.getOnlinePlayers().isEmpty()) {
|
||||||
|
Bukkit.getScheduler().runTaskLaterAsynchronously(T2CodeLibMain.getPlugin(), new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
callAllBungeePlayers();
|
||||||
|
}
|
||||||
|
}, 20L);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
output.writeUTF(T2CbungeePlayersEnum.GIVEALL.name());
|
||||||
|
output.writeUTF(Util.getServerUUID().toString());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
|
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bonlp", stream.toByteArray());
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage received channel: t2c:bonlp");
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage send subChannel: " + T2CbungeePlayersEnum.GIVEALL.name());
|
||||||
|
T2Csend.debug(T2CodeLibMain.getPlugin(), "PluginMessage send output/uuid: " + Util.getServerUUID().toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,8 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.bungeePlayers;
|
||||||
|
|
||||||
|
public enum T2CbungeePlayersEnum {
|
||||||
|
JOIN,
|
||||||
|
QUIT,
|
||||||
|
GIVEALL,
|
||||||
|
CLEAR
|
||||||
|
}
|
@@ -1,24 +1,24 @@
|
|||||||
package net.t2code.t2codelib.SPIGOT.api.commands;
|
package net.t2code.t2codelib.SPIGOT.api.commands;
|
||||||
|
|
||||||
import net.t2code.t2codelib.SPIGOT.system.BCommandSenderReciver;
|
import net.t2code.t2codelib.SPIGOT.system.T2CbungeeCommandSenderReciver;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class T2Ccmd {
|
public class T2Ccmd {
|
||||||
public static void console(String cmd) {
|
public static void console(String cmd) {
|
||||||
if (cmd.contains("!onBungee")){
|
if (cmd.contains("!onBungee")){
|
||||||
BCommandSenderReciver.sendToBungee(null, cmd.replace("!onBungee", ""), true);
|
T2CbungeeCommandSenderReciver.sendToBungee(null, cmd.replace("!onBungee", ""), true);
|
||||||
}else Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd);
|
}else Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void player(Player player, String cmd) {
|
public static void player(Player player, String cmd) {
|
||||||
if (cmd.contains("!asConsole")) {
|
if (cmd.contains("!asConsole")) {
|
||||||
if (cmd.contains("!onBungee")) {
|
if (cmd.contains("!onBungee")) {
|
||||||
BCommandSenderReciver.sendToBungee(player, cmd.replace("!asConsole", "").replace("!onBungee", ""), true);
|
T2CbungeeCommandSenderReciver.sendToBungee(player, cmd.replace("!asConsole", "").replace("!onBungee", ""), true);
|
||||||
} else console(cmd.replace("!asConsole", ""));
|
} else console(cmd.replace("!asConsole", ""));
|
||||||
} else {
|
} else {
|
||||||
if (cmd.contains("!onBungee")) {
|
if (cmd.contains("!onBungee")) {
|
||||||
BCommandSenderReciver.sendToBungee(player, cmd.replace("!onBungee", ""), false);
|
T2CbungeeCommandSenderReciver.sendToBungee(player, cmd.replace("!onBungee", ""), false);
|
||||||
} else player.chat("/" + cmd);
|
} else player.chat("/" + cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,47 @@ public class T2Creplace {
|
|||||||
.replace("[nl]", "\n")));
|
.replace("[nl]", "\n")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Object replaceObject(String prefix, Object object) {
|
||||||
|
if (object instanceof String) {
|
||||||
|
object = replaceLegacyColor((String) object).replace("[prefix]", prefix).replace("[ue]", "ü")
|
||||||
|
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||||
|
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((object instanceof List) || (object instanceof ArrayList)) {
|
||||||
|
List<String> in = (List<String>) object;
|
||||||
|
List<String> output = new ArrayList<>();
|
||||||
|
for (String input : in) {
|
||||||
|
output.add(replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
|
.replace("[nl]", "\n"));
|
||||||
|
}
|
||||||
|
object = output;
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Object replaceObject(String prefix, Player player, Object object) {
|
||||||
|
if (object instanceof String) {
|
||||||
|
object = PlaceholderAPI.setPlaceholders(player, replaceLegacyColor((String) object).replace("[prefix]", prefix).replace("[ue]", "ü")
|
||||||
|
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||||
|
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n"));
|
||||||
|
}
|
||||||
|
if (object instanceof List) {
|
||||||
|
List<String> in = (List<String>) object;
|
||||||
|
List<String> output = new ArrayList<>();
|
||||||
|
for (String input : in) {
|
||||||
|
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
|
.replace("[nl]", "\n")));
|
||||||
|
}
|
||||||
|
object = output;
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<String> replace(String prefix, List<String> Text) {
|
public static List<String> replace(String prefix, List<String> Text) {
|
||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
for (String input : Text) {
|
for (String input : Text) {
|
||||||
@@ -35,7 +76,7 @@ public class T2Creplace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> replace(String prefix, Player player, List<String> Text) {
|
public static List<String> replace(String prefix, Player player, List<String> Text) {
|
||||||
List<String> output = new ArrayList();
|
List<String> output = new ArrayList<>();
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return Collections.singletonList("player is null");
|
return Collections.singletonList("player is null");
|
||||||
}
|
}
|
||||||
@@ -52,7 +93,7 @@ public class T2Creplace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> replacePrice(String prefix, List<String> Text, String price) {
|
public static List<String> replacePrice(String prefix, List<String> Text, String price) {
|
||||||
List<String> rp = new ArrayList();
|
List<String> rp = new ArrayList<>();
|
||||||
for (String s : Text) {
|
for (String s : Text) {
|
||||||
rp.add(replaceLegacyColor(s).replace("[prefix]", prefix)
|
rp.add(replaceLegacyColor(s).replace("[prefix]", prefix)
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
@@ -82,7 +123,7 @@ public class T2Creplace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> replacePrice(String prefix, Player player, List<String> Text, String price) {
|
public static List<String> replacePrice(String prefix, Player player, List<String> Text, String price) {
|
||||||
List<String> rp = new ArrayList();
|
List<String> rp = new ArrayList<>();
|
||||||
for (String s : Text) {
|
for (String s : Text) {
|
||||||
rp.add(replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix)
|
rp.add(replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix)
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
|
@@ -24,6 +24,29 @@ public class T2Csend {
|
|||||||
T2ChoverModule.modulePlayer(msg, player);
|
T2ChoverModule.modulePlayer(msg, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sender(CommandSender sender, String msg) {
|
||||||
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
|
T2ChoverModule.moduleSender(msg, sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void console(Object object) {
|
||||||
|
String msg = String.valueOf(object);
|
||||||
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
|
T2ChoverModule.moduleConsole(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void player(Player player, Object object) {
|
||||||
|
String msg = String.valueOf(object);
|
||||||
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
|
T2ChoverModule.modulePlayer(msg, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sender(CommandSender sender, Object object) {
|
||||||
|
String msg = String.valueOf(object);
|
||||||
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
|
T2ChoverModule.moduleSender(msg, sender);
|
||||||
|
}
|
||||||
|
|
||||||
public static void title(Player player, @Nullable String title, @Nullable String subtitle) {
|
public static void title(Player player, @Nullable String title, @Nullable String subtitle) {
|
||||||
player.sendTitle(title, subtitle);
|
player.sendTitle(title, subtitle);
|
||||||
}
|
}
|
||||||
@@ -32,11 +55,6 @@ public class T2Csend {
|
|||||||
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
|
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sender(CommandSender sender, String msg) {
|
|
||||||
if (msg == null || msg.contains("[empty]")) return;
|
|
||||||
T2ChoverModule.moduleSender(msg, sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(Plugin plugin, String msg) {
|
public static void debug(Plugin plugin, String msg) {
|
||||||
debug(plugin, msg, null);
|
debug(plugin, msg, null);
|
||||||
}
|
}
|
||||||
@@ -44,13 +62,17 @@ public class T2Csend {
|
|||||||
public static void debug(Plugin plugin, String msg, Integer stage) {
|
public static void debug(Plugin plugin, String msg, Integer stage) {
|
||||||
// if (!new File(Main.getPath(), "config.yml").exists()) return;
|
// if (!new File(Main.getPath(), "config.yml").exists()) return;
|
||||||
if (stage == null) {
|
if (stage == null) {
|
||||||
if (plugin.getConfig().getBoolean("Plugin.Debug"))
|
if (plugin.getConfig().getBoolean("Plugin.Debug") || plugin.getConfig().getBoolean("plugin.debug") || plugin.getConfig().getBoolean("Debug") || plugin.getConfig().getBoolean("debug")){
|
||||||
|
info(plugin, "");
|
||||||
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
|
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plugin.getConfig().getInt("Plugin.Debug") >= stage)
|
if (plugin.getConfig().getInt("Plugin.Debug") >= stage || plugin.getConfig().getInt("plugin.debug") >= stage || plugin.getConfig().getInt("Debug") >= stage || plugin.getConfig().getInt("debug") >= stage) {
|
||||||
|
info(plugin, "");
|
||||||
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
|
Bukkit.getConsoleSender().sendMessage(plugin.getDescription().getPrefix() + " §5DEBUG: §6" + msg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void debugmsg(Plugin plugin, String msg) {
|
public static void debugmsg(Plugin plugin, String msg) {
|
||||||
warning(plugin, "");
|
warning(plugin, "");
|
||||||
|
@@ -104,7 +104,7 @@ public class T2Ctemplate {
|
|||||||
String pr = premiumVerified != null ? "<br><dark_red>║</dark_red> <yellow>Premium verified:</yellow> [pr]".replace("[pr]", premiumVerified ? "<dark_green>YES</dark_green>" : "<red>NO</red>") : "";
|
String pr = premiumVerified != null ? "<br><dark_red>║</dark_red> <yellow>Premium verified:</yellow> [pr]".replace("[pr]", premiumVerified ? "<dark_green>YES</dark_green>" : "<red>NO</red>") : "";
|
||||||
|
|
||||||
String stMSG = text == null || text.equals("") ? "" : "<br><dark_red>║</dark_red> " + text + "<br>";
|
String stMSG = text == null || text.equals("") ? "" : "<br><dark_red>║</dark_red> " + text + "<br>";
|
||||||
T2Csend.sender(sender, "<dark_red>╔══════════════════════════════════════</dark_red>"
|
T2Csend.sender(sender, "<dark_red>╔════════════════════════════════</dark_red>"
|
||||||
+ "<br>" + stPlugin
|
+ "<br>" + stPlugin
|
||||||
+ stMSG
|
+ stMSG
|
||||||
+ stVersion
|
+ stVersion
|
||||||
@@ -113,7 +113,7 @@ public class T2Ctemplate {
|
|||||||
+ "<br>" + stStable
|
+ "<br>" + stStable
|
||||||
+ "<br>" + stLink
|
+ "<br>" + stLink
|
||||||
+ pr
|
+ pr
|
||||||
+ "<br><dark_red>╚══════════════════════════════════════</dark_red>");
|
+ "<br><dark_red>╚════════════════════════════════</dark_red>");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendInfo(CommandSender sender, Plugin plugin, int spigotID, String discord, String text) {
|
public static void sendInfo(CommandSender sender, Plugin plugin, int spigotID, String discord, String text) {
|
||||||
|
@@ -24,6 +24,7 @@ public class T2CupdateAPI {
|
|||||||
join(plugin,prefix,perm,player,spigotID,discord);
|
join(plugin,prefix,perm,player,spigotID,discord);
|
||||||
}
|
}
|
||||||
},2*20L);
|
},2*20L);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pluginVersions.get(plugin.getName()).updateCheckOnJoin) {
|
if (!pluginVersions.get(plugin.getName()).updateCheckOnJoin) {
|
||||||
|
@@ -0,0 +1,37 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.yaml;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
|
|
||||||
|
public class T2CLibConfig {
|
||||||
|
public static Boolean getUpdateCheckOnJoin() {
|
||||||
|
return SelectLibConfig.getUpdateCheckOnJoin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getT2cTestDevelopment() {
|
||||||
|
return SelectLibConfig.getT2cTestDevelopment();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getUpdateCheckTimeInterval() {
|
||||||
|
return SelectLibConfig.getUpdateCheckTimeInterval();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSeePreReleaseUpdates() {
|
||||||
|
return SelectLibConfig.getSeePreReleaseUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getDebug() {
|
||||||
|
return SelectLibConfig.getDebug();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getLanguage() {
|
||||||
|
return SelectLibConfig.getLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getBungee() {
|
||||||
|
return SelectLibConfig.getBungee();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getInventoriesCloseByServerStop() {
|
||||||
|
return SelectLibConfig.getInventoriesCloseByServerStop();
|
||||||
|
}
|
||||||
|
}
|
@@ -17,6 +17,11 @@ public class T2Cconfig {
|
|||||||
YamlConfiguration.set(path, value);
|
YamlConfiguration.set(path, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void set(String path, Object value, YamlConfiguration YamlConfiguration) {
|
||||||
|
if (!YamlConfiguration.contains(path)) {
|
||||||
|
YamlConfiguration.set(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void set(String path, YamlConfiguration YamlConfiguration) {
|
public static void set(String path, YamlConfiguration YamlConfiguration) {
|
||||||
YamlConfiguration.set(path, null);
|
YamlConfiguration.set(path, null);
|
||||||
@@ -119,6 +124,10 @@ public class T2Cconfig {
|
|||||||
return T2Creplace.replace(prefix, yamlConfiguration.getString(path));
|
return T2Creplace.replace(prefix, yamlConfiguration.getString(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Object selectObject(String prefix, String path, YamlConfiguration yamlConfiguration) {
|
||||||
|
return T2Creplace.replaceObject(prefix, yamlConfiguration.get(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Integer selectInt(String path, YamlConfiguration yamlConfiguration) {
|
public static Integer selectInt(String path, YamlConfiguration yamlConfiguration) {
|
||||||
return (yamlConfiguration.getInt(path));
|
return (yamlConfiguration.getInt(path));
|
||||||
|
@@ -8,7 +8,7 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class BCommandSenderReciver {
|
public class T2CbungeeCommandSenderReciver {
|
||||||
|
|
||||||
public static void sendToBungee(CommandSender sender, String information, Boolean console) {
|
public static void sendToBungee(CommandSender sender, String information, Boolean console) {
|
||||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
@@ -1,8 +1,10 @@
|
|||||||
package net.t2code.t2codelib.SPIGOT.system;
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2CbungeePlayers;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||||
@@ -33,6 +35,7 @@ public final class T2CodeLibMain extends JavaPlugin {
|
|||||||
private static List<String> autor;
|
private static List<String> autor;
|
||||||
private static String version;
|
private static String version;
|
||||||
|
|
||||||
|
@Getter
|
||||||
private static Boolean mmIsLoad = true;
|
private static Boolean mmIsLoad = true;
|
||||||
private static Boolean load = false;
|
private static Boolean load = false;
|
||||||
|
|
||||||
@@ -48,6 +51,7 @@ public final class T2CodeLibMain extends JavaPlugin {
|
|||||||
mmIsLoad = false;
|
mmIsLoad = false;
|
||||||
}
|
}
|
||||||
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
|
checkIsBungee();
|
||||||
String prefix = Util.getPrefix();
|
String prefix = Util.getPrefix();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -104,11 +108,18 @@ public final class T2CodeLibMain extends JavaPlugin {
|
|||||||
Metrics.Bstats(plugin, Util.getBstatsID());
|
Metrics.Bstats(plugin, Util.getBstatsID());
|
||||||
if (SelectLibConfig.getBungee()) {
|
if (SelectLibConfig.getBungee()) {
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
|
||||||
|
|
||||||
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bonlp");
|
||||||
|
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin, "t2c:bonlp")) {
|
||||||
|
T2Csend.debug(plugin, "registerIncomingPluginChannel §et2c:bonlp");
|
||||||
|
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, "t2c:bonlp", new T2CbungeePlayers());
|
||||||
|
T2CbungeePlayers.callAllBungeePlayers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReportLogStorage.load();
|
ReportLogStorage.load();
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
||||||
checkIsBungee();
|
|
||||||
T2Ctemplate.onLoadFooter(prefix, long_);
|
T2Ctemplate.onLoadFooter(prefix, long_);
|
||||||
load = true;
|
load = true;
|
||||||
}
|
}
|
||||||
|
@@ -2,8 +2,10 @@ package net.t2code.t2codelib.SPIGOT.system.cmd;
|
|||||||
|
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2CbungeePlayers;
|
||||||
import net.t2code.t2codelib.T2CupdateObject;
|
import net.t2code.t2codelib.T2CupdateObject;
|
||||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@@ -40,10 +42,14 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
return false;
|
return false;
|
||||||
case "reloadconfig":
|
case "reloadconfig":
|
||||||
SelectLibConfig.onSelect();
|
SelectLibConfig.onSelect();
|
||||||
|
T2Csend.sender(sender, Util.getPrefix() + " §2Config successfully reloaded");
|
||||||
return false;
|
return false;
|
||||||
case "debug":
|
case "debug":
|
||||||
Commands.debug(sender,args);
|
Commands.debug(sender,args);
|
||||||
return false;
|
return false;
|
||||||
|
case "test":
|
||||||
|
T2Csend.sender(sender, T2CbungeePlayers.getBungeePlayers().toString());
|
||||||
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
T2Csend.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
T2Csend.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||||
|
@@ -132,9 +132,11 @@ public class CreateReportLog {
|
|||||||
|
|
||||||
addFileToZip("", "logs/latest.log", zip, false);
|
addFileToZip("", "logs/latest.log", zip, false);
|
||||||
|
|
||||||
for (String pl : Util.getT2cPlugins()) {
|
// for (String pl : Util.getT2cPlugins()) {
|
||||||
pluginToDebug(pl, zip);
|
// pluginToDebug(pl, zip);
|
||||||
}
|
// }
|
||||||
|
pluginToDebug(zip); //todo überprüfen
|
||||||
|
|
||||||
zip.closeEntry();
|
zip.closeEntry();
|
||||||
zip.close();
|
zip.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -206,6 +208,19 @@ public class CreateReportLog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static void pluginToDebug(ZipOutputStream zip) throws IOException {
|
||||||
|
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()){
|
||||||
|
String plName = plugin.getDescription().getName();
|
||||||
|
if (plName.contains("T2C-") || Util.getT2cPlugins().contains(plName)){
|
||||||
|
File plConfigs = new File(plugin.getDataFolder().getPath());
|
||||||
|
if (plConfigs.exists()) {
|
||||||
|
addFolderToZip("T2Code-Plugins", plugin.getDataFolder().getPath(), zip);
|
||||||
|
}
|
||||||
|
File f = new File(plugin.getClass().getProtectionDomain().getCodeSource().getLocation().getPath());
|
||||||
|
addFileToZip("T2Code-Plugins", f.getPath(), zip, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws IOException {
|
private static void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws IOException {
|
||||||
File folder = new File(srcFolder);
|
File folder = new File(srcFolder);
|
||||||
|
@@ -27,7 +27,7 @@ public class ConfigCreate {
|
|||||||
T2Cconfig.set("Plugin.UpdateCheck.SeePreReleaseUpdates", true, yamlConfiguration);
|
T2Cconfig.set("Plugin.UpdateCheck.SeePreReleaseUpdates", true, yamlConfiguration);
|
||||||
T2Cconfig.set("Plugin.language", "english", yamlConfiguration);
|
T2Cconfig.set("Plugin.language", "english", yamlConfiguration);
|
||||||
|
|
||||||
T2Cconfig.set("BungeeCord.Enable", false, yamlConfiguration);
|
T2Cconfig.set("BungeeCord.Enable", T2CodeLibMain.getIsBungee(), yamlConfiguration);
|
||||||
T2Cconfig.set("Player.Inventories.CloseByServerStop", true, yamlConfiguration);
|
T2Cconfig.set("Player.Inventories.CloseByServerStop", true, yamlConfiguration);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package net.t2code.t2codelib.SPIGOT.system.config.config;
|
package net.t2code.t2codelib.SPIGOT.system.config.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
@@ -7,13 +8,21 @@ import java.io.File;
|
|||||||
|
|
||||||
public class SelectLibConfig {
|
public class SelectLibConfig {
|
||||||
|
|
||||||
|
@Getter
|
||||||
private static Boolean updateCheckOnJoin;
|
private static Boolean updateCheckOnJoin;
|
||||||
|
@Getter
|
||||||
private static Boolean t2cTestDevelopment = false;
|
private static Boolean t2cTestDevelopment = false;
|
||||||
|
@Getter
|
||||||
private static Integer updateCheckTimeInterval;
|
private static Integer updateCheckTimeInterval;
|
||||||
|
@Getter
|
||||||
private static Boolean seePreReleaseUpdates;
|
private static Boolean seePreReleaseUpdates;
|
||||||
|
@Getter
|
||||||
private static Boolean debug;
|
private static Boolean debug;
|
||||||
|
@Getter
|
||||||
private static String language;
|
private static String language;
|
||||||
|
@Getter
|
||||||
private static Boolean bungee;
|
private static Boolean bungee;
|
||||||
|
@Getter
|
||||||
private static Boolean inventoriesCloseByServerStop;
|
private static Boolean inventoriesCloseByServerStop;
|
||||||
|
|
||||||
public static void onSelect() {
|
public static void onSelect() {
|
||||||
@@ -32,37 +41,4 @@ public class SelectLibConfig {
|
|||||||
bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
||||||
inventoriesCloseByServerStop = yamlConfiguration.getBoolean("Player.Inventories.CloseByServerStop");
|
inventoriesCloseByServerStop = yamlConfiguration.getBoolean("Player.Inventories.CloseByServerStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean getUpdateCheckOnJoin() {
|
|
||||||
return updateCheckOnJoin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getT2cTestDevelopment() {
|
|
||||||
return t2cTestDevelopment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getUpdateCheckTimeInterval() {
|
|
||||||
return updateCheckTimeInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getSeePreReleaseUpdates() {
|
|
||||||
return seePreReleaseUpdates;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getDebug() {
|
|
||||||
return debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getLanguage() {
|
|
||||||
return language;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getBungee() {
|
|
||||||
return bungee;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getInventoriesCloseByServerStop() {
|
|
||||||
return inventoriesCloseByServerStop;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,17 @@
|
|||||||
package net.t2code.t2codelib;
|
package net.t2code.t2codelib;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private static final UUID serverUUID = UUID.randomUUID();
|
||||||
|
|
||||||
|
|
||||||
public static String getInfoText() {
|
public static String getInfoText() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -47,7 +54,8 @@ public class Util {
|
|||||||
"LoreEditor",
|
"LoreEditor",
|
||||||
"Booster",
|
"Booster",
|
||||||
"AntiMapCopy",
|
"AntiMapCopy",
|
||||||
"AntiCopy"
|
"AntiCopy",
|
||||||
|
"T2C-LoginPermissionAuth"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user