3.0.0-SNAPSHOT-#1
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package net.t2code.opsecurity.system;
|
||||
|
||||
import net.t2code.opsecurity.events.Events;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class BungeeSenderReceiver implements PluginMessageListener {
|
||||
|
||||
public static void sendToBungee(String information) {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(stream);
|
||||
try {
|
||||
output.writeUTF(information.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
player.sendPluginMessage(Main.getPlugin(), "t2c:opsec", stream.toByteArray());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||
T2Csend.debug(Main.getPlugin(), "stream: " + stream.toString());
|
||||
try {
|
||||
String subChannel = stream.readUTF();
|
||||
String information = stream.readUTF();
|
||||
if (subChannel.equals("T2Cconsole")) {
|
||||
Events.notifyPlayer(information);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,12 +1,15 @@
|
||||
package net.t2code.opsecurity.system;
|
||||
|
||||
import net.t2code.opsecurity.Util;
|
||||
import net.t2code.opsecurity.command.CmdExecuter;
|
||||
import net.t2code.opsecurity.config.FileSelect;
|
||||
import net.t2code.opsecurity.config.config.Converter;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.opsecurity.events.Events;
|
||||
import net.t2code.opsecurity.events.OpCommand;
|
||||
import net.t2code.opsecurity.events.PlugManCommand;
|
||||
import net.t2code.opsecurity.check.Timer;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginManager;
|
||||
import net.t2code.t2codelib.SPIGOT.api.register.T2Cregister;
|
||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||
|
||||
import java.util.List;
|
||||
@@ -16,25 +19,25 @@ public class Load {
|
||||
|
||||
public static void onLoad(Main plugin, List<String> autor, String version) {
|
||||
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||
if (T2CpluginCheck.opSec()){
|
||||
T2CpluginManager.disable("OPSecurity");
|
||||
T2Csend.warning(plugin,"OPSecurity has been deactivated, because T2C-OPSecurity is a newer version!");
|
||||
}
|
||||
try {
|
||||
Converter.convert();
|
||||
} catch (Exception ex){
|
||||
plugin.getLogger().log(Level.SEVERE,ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
FileSelect.selectConfig();
|
||||
FileSelect.selectLanguage();
|
||||
FileSelect.selectOpWhitelist();
|
||||
FileSelect.selectPermissionWhitelist();
|
||||
|
||||
//plugin.getCommand("t2c-opsecurity").setExecutor(new CmdExecuter());
|
||||
plugin.getCommand("t2c-opsecurity").setExecutor(new CmdExecuter());
|
||||
|
||||
T2Cregister.listener(new OpCommand(), plugin);
|
||||
T2Cregister.listener(new PlugManCommand(), plugin);
|
||||
T2Cregister.listener(new Events(), plugin);
|
||||
|
||||
Timer.refreshTimer();
|
||||
Permissions.register();
|
||||
T2CupdateAPI.onUpdateCheck(plugin, Util.getPrefix(), Util.getSpigotID(), Util.getDiscord());
|
||||
Metrics.Bstats(plugin, Util.getBstatsID());
|
||||
|
@@ -42,7 +42,7 @@ public final class Main extends JavaPlugin {
|
||||
if (t2codeLib) T2Ctemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||
}
|
||||
|
||||
public static Boolean pluginNotFound(String pl, Integer spigotID, String ver) {
|
||||
private static Boolean pluginNotFound(String pl, Integer spigotID, String ver) {
|
||||
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: "
|
||||
|
Reference in New Issue
Block a user