Format and remove publishing

This commit is contained in:
Telesphoreo 2022-05-16 21:54:39 -05:00
parent ea62ebcf8f
commit 0a0a070d7f
No known key found for this signature in database
GPG Key ID: 5ACFFC4682CF849B
20 changed files with 68 additions and 109 deletions

View File

@ -61,44 +61,4 @@ shadowJar {
archiveBaseName.set("BukkitTelnet")
archiveVersion.set("")
archiveClassifier.set("")
}
publishing {
def config = configurations.getByName("library")
publications {
maven(MavenPublication) {
groupId = 'me.totalfreedom'
artifactId = 'BukkitTelnet'
version = rootProject.version
pom.withXml {
def dependenciesNode = asNode().appendNode("dependencies")
config.getAllDependencies().each { dependency ->
dependenciesNode.appendNode("dependency").with {
it.appendNode("groupId", dependency.group)
it.appendNode("artifactId", dependency.name)
it.appendNode("version", dependency.version)
it.appendNode("scope", "provided")
}
}
configurations.getByName("compileOnly").getAllDependencies().each { dependency ->
dependenciesNode.appendNode("dependency").with {
it.appendNode("groupId", dependency.group)
it.appendNode("artifactId", dependency.name)
it.appendNode("version", dependency.version)
it.appendNode("scope", "provided")
}
}
artifacts = [shadowJar]
}
}
}
repositories {
maven {
url = uri("https://nexus.telesphoreo.me/repository/totalfreedom/")
credentials {
username = System.getenv("plexUser")
password = System.getenv("plexPassword")
}
}
}
}

View File

View File

@ -1,2 +0,0 @@
jdk:
- openjdk17

View File

@ -1,10 +1,6 @@
package dev.plex;
import java.util.UUID;
public interface PermissionHandler
{
boolean hasPermission(String username, String permission);
}

View File

@ -21,6 +21,7 @@ public class BukkitTelnet extends JavaPlugin
public Permission permissions;
public PermissionHandler handler;
@Override
public void onLoad()
{
@ -66,7 +67,8 @@ public class BukkitTelnet extends JavaPlugin
TelnetLogger.info(plugin.getName() + " disabled");
}
private boolean setupPermissions() {
private boolean setupPermissions()
{
if (!getServer().getPluginManager().isPluginEnabled("Vault"))
{
return false;

View File

@ -8,6 +8,6 @@ public class PermissionHandlerImpl implements PermissionHandler
@Override
public boolean hasPermission(String username, String permission)
{
return BukkitTelnet.getPlugin().permissions.has((World) null, username, permission);
return BukkitTelnet.getPlugin().permissions.has((World)null, username, permission);
}
}

View File

@ -1,5 +1,8 @@
package me.totalfreedom.bukkittelnet;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;
import me.totalfreedom.bukkittelnet.api.TelnetRequestDataTagsEvent;
import me.totalfreedom.bukkittelnet.api.TelnetRequestUsageEvent;
import org.apache.commons.lang.StringUtils;
@ -15,10 +18,6 @@ import org.bukkit.scheduler.BukkitTask;
import org.json.JSONArray;
import org.json.JSONObject;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;
public class PlayerEventListener implements Listener
{
private final BukkitTelnet plugin;

View File

@ -1,14 +1,18 @@
package me.totalfreedom.bukkittelnet;
import me.totalfreedom.bukkittelnet.session.ClientSession;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import me.totalfreedom.bukkittelnet.session.ClientSession;
public class SocketListener extends Thread
{

View File

@ -1,11 +1,10 @@
package me.totalfreedom.bukkittelnet;
import me.totalfreedom.bukkittelnet.thirdparty.YamlConfig;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import me.totalfreedom.bukkittelnet.thirdparty.YamlConfig;
public class TelnetConfigLoader
{

View File

@ -1,13 +1,5 @@
package me.totalfreedom.bukkittelnet;
import me.totalfreedom.bukkittelnet.session.ClientSession;
import me.totalfreedom.bukkittelnet.session.FilterMode;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.Logger;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.Property;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
@ -15,6 +7,13 @@ import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import me.totalfreedom.bukkittelnet.session.ClientSession;
import me.totalfreedom.bukkittelnet.session.FilterMode;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.Logger;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.Property;
public class TelnetLogAppender extends AbstractAppender
{
@ -114,12 +113,12 @@ public class TelnetLogAppender extends AbstractAppender
public void attach()
{
((Logger) LogManager.getRootLogger()).addAppender(this);
((Logger)LogManager.getRootLogger()).addAppender(this);
}
public void deattach()
{
((Logger) LogManager.getRootLogger()).removeAppender(this);
((Logger)LogManager.getRootLogger()).removeAppender(this);
}
}

View File

@ -1,8 +1,7 @@
package me.totalfreedom.bukkittelnet;
import org.apache.commons.lang.exception.ExceptionUtils;
import java.util.logging.Logger;
import org.apache.commons.lang.exception.ExceptionUtils;
public final class TelnetLogger
{
@ -50,7 +49,7 @@ public final class TelnetLogger
if (message instanceof Throwable)
{
line = ExceptionUtils.getStackTrace((Throwable) message);
line = ExceptionUtils.getStackTrace((Throwable)message);
}
else
{
@ -66,7 +65,7 @@ public final class TelnetLogger
if (message instanceof Throwable)
{
line = ExceptionUtils.getStackTrace((Throwable) message);
line = ExceptionUtils.getStackTrace((Throwable)message);
}
else
{

View File

@ -1,15 +1,14 @@
package me.totalfreedom.bukkittelnet;
import lombok.Getter;
import me.totalfreedom.bukkittelnet.TelnetConfigLoader.TelnetConfig;
import me.totalfreedom.bukkittelnet.api.Server;
import me.totalfreedom.bukkittelnet.session.ClientSession;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.util.List;
import lombok.Getter;
import me.totalfreedom.bukkittelnet.TelnetConfigLoader.TelnetConfig;
import me.totalfreedom.bukkittelnet.api.Server;
import me.totalfreedom.bukkittelnet.session.ClientSession;
public class TelnetServer implements Server
{

View File

@ -1,11 +1,10 @@
package me.totalfreedom.bukkittelnet.api;
import java.util.List;
import me.totalfreedom.bukkittelnet.SocketListener;
import me.totalfreedom.bukkittelnet.TelnetConfigLoader.TelnetConfig;
import me.totalfreedom.bukkittelnet.session.ClientSession;
import java.util.List;
public interface Server
{

View File

@ -2,7 +2,6 @@ package me.totalfreedom.bukkittelnet.api;
import me.totalfreedom.bukkittelnet.session.SessionCommandSender;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

View File

@ -1,13 +1,12 @@
package me.totalfreedom.bukkittelnet.api;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import java.util.HashMap;
import java.util.Map;
public class TelnetRequestDataTagsEvent extends Event
{

View File

@ -2,6 +2,16 @@ package me.totalfreedom.bukkittelnet.session;
//import dev.plex.SimulatedPlayer;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.net.SocketException;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import me.totalfreedom.bukkittelnet.TelnetLogger;
import me.totalfreedom.bukkittelnet.TelnetServer;
import me.totalfreedom.bukkittelnet.Util;
@ -12,13 +22,6 @@ import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.*;
import java.net.Socket;
import java.net.SocketException;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
public final class ClientSession extends Thread
{

View File

@ -2,6 +2,8 @@ package me.totalfreedom.bukkittelnet.session;
//import dev.plex.SimulatedPlayer;
import java.util.Set;
import java.util.UUID;
import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.bukkittelnet.BukkitTelnet;
@ -16,9 +18,6 @@ import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Set;
import java.util.UUID;
@Getter
@Setter
public class SessionCommandSender implements CommandSender

View File

@ -1,12 +1,18 @@
package me.totalfreedom.bukkittelnet.thirdparty;
import org.bukkit.plugin.Plugin;
import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import org.bukkit.plugin.Plugin;
/**
* Represents all File-related utilities.
@ -17,7 +23,7 @@ public class FileUtils
/**
* Downloads a file from the specified URIL and saves it at the specified location.
*
* @param url The URL from where to download the file from.
* @param url The URL from where to download the file from.
* @param output The file where the file will be stored.
* @throws MalformedURLException
* @throws IOException
@ -35,7 +41,7 @@ public class FileUtils
* Saves a raw Object to a file.
*
* @param object The object to save.
* @param file The file where the object will be stored.
* @param file The file where the object will be stored.
* @throws IOException
*/
public static void saveObject(Object object, File file) throws IOException
@ -74,7 +80,7 @@ public class FileUtils
* Returns a file at located at the Plugins Data folder.
*
* @param plugin The plugin to use
* @param name The name of the file.
* @param name The name of the file.
* @return The requested file.
*/
public static File getPluginFile(Plugin plugin, String name)
@ -135,7 +141,7 @@ public class FileUtils
/**
* Write the specified InputStream to a file.
*
* @param in The InputStream from which to read.
* @param in The InputStream from which to read.
* @param file The File to write to.
* @throws IOException
*/

View File

@ -1,13 +1,12 @@
package me.totalfreedom.bukkittelnet.thirdparty;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.logging.log4j.core.util.IOUtils;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.logging.log4j.core.util.IOUtils;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
/**
* Represents a definable YAML configuration.
@ -31,8 +30,8 @@ public class YamlConfig extends YamlConfiguration
* config.load();
* </pre></p>
*
* @param plugin The plugin to which the config belongs.
* @param fileName The filename of the config file.
* @param plugin The plugin to which the config belongs.
* @param fileName The filename of the config file.
* @param copyDefaults If the defaults should be copied and/loaded from a config in the plugin jar-file.
*/
public YamlConfig(Plugin plugin, String fileName, boolean copyDefaults)
@ -50,8 +49,8 @@ public class YamlConfig extends YamlConfiguration
* config.load();
* </pre></p>
*
* @param plugin The plugin to which the config belongs.
* @param file The file of the config file.
* @param plugin The plugin to which the config belongs.
* @param file The file of the config file.
* @param copyDefaults If the defaults should be copied and/loaded from a config in the plugin jar-file.
*/
public YamlConfig(Plugin plugin, File file, boolean copyDefaults)

View File

@ -1,4 +1,4 @@
# BukkitTelnet v4.6.1 Configuration File
# BukkitTelnet v4.8 Configuration File
# Address to listen on, leave blank for all
address: ''