Remove old code

This commit is contained in:
Ryder Belserion 2023-02-06 01:56:47 -05:00
parent 11e905f66f
commit f40f8b30a9
No known key found for this signature in database
GPG Key ID: CA602465429CF065
18 changed files with 0 additions and 529 deletions

View File

@ -1,27 +0,0 @@
plugins {
`java-library`
}
repositories {
maven("https://repo.triumphteam.dev/snapshots/")
maven("https://repo.crazycrew.us/libraries/")
maven("https://repo.crazycrew.us/plugins/")
maven("https://libraries.minecraft.net/")
maven("https://jitpack.io/")
mavenCentral()
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(project.extra["java_version"].toString().toInt()))
}
tasks {
compileJava {
options.release.set(project.extra["java_version"].toString().toInt())
}
}

View File

@ -1,7 +0,0 @@
plugins {
id("crazyauctions.common-plugin")
}
dependencies {
compileOnly("com.ryderbelserion.ithildin", "ithildin-core", "0.0.1")
}

View File

@ -1,19 +0,0 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.configuration.Config;
import com.badbones69.crazyauctions.configuration.Locale;
import com.ryderbelserion.ithildin.core.IthildinCore;
public class Builder {
public static void start() {
Config.handle(IthildinCore.api().getDirectory());
Locale.handle(IthildinCore.api().getDirectory().resolve("locale"));
if (Config.VERBOSE) System.out.println("Yay!");
}
public static void stop() {
System.out.println("Testing 123");
}
}

View File

@ -1,34 +0,0 @@
package com.badbones69.crazyauctions.configuration;
import com.ryderbelserion.ithildin.core.configs.AbstractYaml;
import java.nio.file.Path;
public class Config extends AbstractYaml {
private static final Config CONFIG = new Config();
@Key("settings.language-file")
@Comment("""
The language file to use from the locale folder.
Supported languages are English(en).""")
public static String LANGUAGE_FILE = "locale-en.yml";
@Key("settings.verbose")
@Comment("Whether you want to have verbose logging enabled.")
public static boolean VERBOSE = true;
@Key("settings.metrics")
@Comment("Whether you want metrics to be enabled.")
public static boolean METRICS = true;
@Key("settings.updater")
@Comment("""
Sends you update notifications for when an update is available!
You either need crazyauctions.command.admin.help or have /op
""")
public static boolean UPDATER = true;
public static void handle(Path directory) {
CONFIG.handle(directory.resolve("config.yml"), Config.class);
}
}

View File

@ -1,30 +0,0 @@
package com.badbones69.crazyauctions.configuration;
import com.ryderbelserion.ithildin.core.configs.AbstractYaml;
import com.ryderbelserion.ithildin.core.utils.FileUtils;
import java.nio.file.Path;
public class Locale extends AbstractYaml {
private static final Locale LOCALE = new Locale();
@Key("prefix.command")
@Comment("Change how the prefix for commands will look!")
public static String COMMAND_PREFIX = "<gray>[<gradient:#da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>";
@Key("prefix.console")
@Comment("Change how the prefix for console will look!")
public static String CONSOLE_PREFIX = "<gray>[<gradient:#da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>";
@Key("misc.unknown-command")
public static String UNKNOWN_COMMAND = "<red>This command is not known.</red>";
@Key("misc.config-reload")
public static String CONFIG_RELOAD = "<red>You have reloaded the plugin.</red>";
public static void handle(Path directory) {
FileUtils.extract("/locale/", directory, false);
LOCALE.handle(directory.resolve(Config.LANGUAGE_FILE), Locale.class);
}
}

View File

@ -1,93 +0,0 @@
plugins {
id("crazyauctions.paper-plugin")
id("com.modrinth.minotaur") version "2.6.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
`maven-publish`
}
val isBeta: Boolean = extra["isBeta"].toString().toBoolean()
fun getPluginVersion(): String {
return if (isBeta) "${project.version}-BETA" else project.version.toString()
}
fun getPluginVersionType(): String {
return if (isBeta) "beta" else "release"
}
tasks {
shadowJar {
archiveFileName.set("${rootProject.name}-${getPluginVersion()}.jar")
listOf(
"org.bstats",
"dev.triumphteam.cmd"
).forEach {
relocate(it, "${project.group}.plugin.lib.$it")
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name.toLowerCase())
versionName.set("${rootProject.name} ${getPluginVersion()}")
versionNumber.set(getPluginVersion())
versionType.set(getPluginVersionType())
uploadFile.set(shadowJar.get())
autoAddDependsOn.set(true)
gameVersions.addAll(listOf("1.18", "1.18.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3"))
loaders.addAll(listOf("paper", "purpur"))
//<h3>The first release for CrazyAuctions on Modrinth! 🎉🎉🎉🎉🎉<h3><br> If we want a header.
changelog.set("""
<h4>Changes:</h4>
<p>N/A</p>
<h4>Bug Fixes:</h4>
<p>N/A</p>
""".trimIndent())
}
processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name,
"group" to project.group,
"version" to getPluginVersion(),
"description" to project.description,
"website" to "https://modrinth.com/plugin/${rootProject.name.toLowerCase()}"
)
}
}
}
publishing {
val mavenExt: String = if (isBeta) "beta" else "releases"
repositories {
maven("https://repo.crazycrew.us/$mavenExt") {
name = "crazycrew"
//credentials(PasswordCredentials::class)
credentials {
username = System.getenv("REPOSITORY_USERNAME")
password = System.getenv("REPOSITORY_PASSWORD")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = rootProject.name.toLowerCase()
version = getPluginVersion()
from(components["java"])
}
}
}

View File

@ -1,95 +0,0 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.command.PaperConsole;
import com.badbones69.crazyauctions.player.PaperPlayerListener;
import com.badbones69.crazyauctions.player.PaperPlayerRegistry;
import com.ryderbelserion.ithildin.core.Console;
import com.ryderbelserion.ithildin.core.IthildinCore;
import com.ryderbelserion.ithildin.core.utils.LoggerUtils;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Field;
import java.nio.file.Path;
public class CrazyAuctions extends JavaPlugin implements IthildinCore {
private static CrazyAuctions plugin;
private final PaperConsole paperConsole;
private PaperPlayerRegistry paperPlayerRegistry;
public CrazyAuctions() {
super();
try {
Field api = Provider.class.getDeclaredField("api");
api.setAccessible(true);
api.set(null, this);
} catch (Exception exception) {
exception.printStackTrace();
getServer().getPluginManager().disablePlugin(this);
}
plugin = this;
paperConsole = new PaperConsole();
LoggerUtils.setLoggerName(plugin.getName());
Builder.start();
}
@Override
public void onEnable() {
// Do whatever else.
// Register listeners.
PaperPlayerListener paperPlayerListener = new PaperPlayerListener();
getServer().getPluginManager().registerEvents(paperPlayerListener, this);
// Set up registries.
this.paperPlayerRegistry = new PaperPlayerRegistry();
}
@Override
public void onDisable() {
// Stop the plugin.
Builder.stop();
}
@Override
public @NotNull String getCurrentVersion() {
return getDescription().getVersion();
}
@Override
public @NotNull Path getDirectory() {
return getDataFolder().toPath();
}
@Override
public @NotNull Path getStorage() {
return getDirectory().resolve("storage");
}
public @NotNull Path getUserData() {
return getStorage().resolve("userdata");
}
@Override
public @NotNull Console getConsole() {
return this.paperConsole;
}
@Override
public @NotNull PaperPlayerRegistry getPlayerRegistry() {
return this.paperPlayerRegistry;
}
public @NotNull static CrazyAuctions getPlugin() {
return plugin;
}
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.api.economy;
public class Currency {
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.api.support;
public enum PluginSupport {
}

View File

@ -1,45 +0,0 @@
package com.badbones69.crazyauctions.command;
import com.ryderbelserion.ithildin.core.Console;
import net.kyori.adventure.audience.MessageType;
import net.kyori.adventure.identity.Identity;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.ConsoleCommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
public class PaperConsole extends Console {
private final ConsoleCommandSender consoleCommandSender;
public PaperConsole() {
this.consoleCommandSender = Bukkit.getConsoleSender();
}
@Override
public void sendMessage(@NotNull Identity source, @NotNull Component message, @NotNull MessageType type) {
this.consoleCommandSender.sendMessage(source, message, type);
}
@Override
public boolean equals(@Nullable Object instance) {
if (this == instance) return true;
if (instance == null) return false;
if (this.getClass() != instance.getClass()) return false;
PaperConsole other = (PaperConsole) instance;
return getKey() == other.getKey() && this.consoleCommandSender == other.consoleCommandSender;
}
@Override
public int hashCode() {
return Objects.hash(getKey(), this.consoleCommandSender);
}
@Override
public String toString() {
return "PaperConsole{" + "key=" + getKey() + ",console=" + this.consoleCommandSender.getName() + "}";
}
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.command.types;
public class AuctionCommand {
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.guis;
public class AuctionGUI {
}

View File

@ -1,53 +0,0 @@
package com.badbones69.crazyauctions.player;
import com.ryderbelserion.ithildin.core.player.PlayerObject;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
import java.util.UUID;
public class PaperPlayer extends PlayerObject {
private final Player player;
public PaperPlayer(@NotNull Player player) {
super(createKey(player.getUniqueId()));
this.player = player;
}
public Player getPlayer() {
return this.player;
}
@Override
public String getName() {
return this.player.getName();
}
@Override
public UUID getIdentity() {
return this.player.getUniqueId();
}
@Override
public boolean equals(@Nullable Object instance) {
if (this == instance) return true;
if (instance == null) return false;
if (this.getClass() != instance.getClass()) return false;
PaperPlayer other = (PaperPlayer) instance;
return getKey() == other.getKey() && this.player == other.player;
}
@Override
public int hashCode() {
return Objects.hash(getKey(), this.player);
}
@Override
public String toString() {
return "PaperPlayer{" + "key=" + getKey() + ",player=" + getPlayer().getUniqueId() + "}";
}
}

View File

@ -1,35 +0,0 @@
package com.badbones69.crazyauctions.player;
import com.badbones69.crazyauctions.CrazyAuctions;
import com.ryderbelserion.ithildin.core.IthildinCore;
import com.ryderbelserion.ithildin.core.player.PlayerListener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
public class PaperPlayerListener implements PlayerListener, Listener {
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onJoinEvent(PlayerJoinEvent event) {
PaperPlayerRegistry registry = (PaperPlayerRegistry) IthildinCore.api().getPlayerRegistry();
// Add the player to the registry.
String message = "<red> " + event.getPlayer().getName() + "</red> <yellow>has joined.</yellow>";
onConnect(registry.addPlayer(event.getPlayer()), message, "<red>[" + plugin.getName() + "]</red>");
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
PaperPlayerRegistry registry = (PaperPlayerRegistry) IthildinCore.api().getPlayerRegistry();
// Remove the player from the registry.
String message = "<red> " + event.getPlayer().getName() + "</red> <yellow>has left.</yellow>";
onDisconnect(registry.removePlayer(event.getPlayer()), message, "<red>[" + plugin.getName() + "]</red>");
}
}

View File

@ -1,25 +0,0 @@
package com.badbones69.crazyauctions.player;
import com.ryderbelserion.ithildin.core.player.PlayerObject;
import com.ryderbelserion.ithildin.core.player.PlayerRegistry;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class PaperPlayerRegistry extends PlayerRegistry {
@Nullable
public PlayerObject addPlayer(@NotNull Player player) {
return register(new PaperPlayer(player));
}
@Nullable
public PlayerObject removePlayer(@NotNull Player player) {
PlayerObject checkPlayer = get(player.getUniqueId());
return checkPlayer == null ? null : unregister(checkPlayer);
}
public PlayerObject get(@NotNull Player player) {
return get(player.getUniqueId());
}
}

View File

@ -1,26 +0,0 @@
package com.badbones69.crazyauctions.player;
import com.ryderbelserion.ithildin.core.IthildinCore;
import com.ryderbelserion.ithildin.core.Sender;
import com.ryderbelserion.ithildin.core.registry.keys.Key;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public abstract class PaperSender extends Sender {
public PaperSender(@NotNull Key key) {
super(key);
}
public static Sender getSender(CommandSender sender) {
if (sender instanceof Player player) return IthildinCore.api().getPlayerRegistry().get(player.getUniqueId());
return IthildinCore.api().getConsole();
}
public static CommandSender getSender(Sender sender) {
return Bukkit.getConsoleSender();
}
}

View File

@ -1,11 +0,0 @@
settings:
# The language file to use from the locale folder.
# Supported languages are English(en).
language-file: "locale-en.yml"
# Whether you want to have verbose logging enabled.
verbose: true
# Whether you want metrics to be enabled.
metrics: true
# Sends you update notifications for when an update is available!
# You either need crazyauctions.command.admin.help or have /op
updater: true

View File

@ -1,9 +0,0 @@
prefix:
# Change how the prefix for commands will look!
command: '<gray>[<gradient:#da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>'
# Change how the prefix for console will look!
console: '<gray>[<gradient:##da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>'
misc:
unknown-command: '<red>This command is not known.</red>'
config-reload: '<red>You have reloaded the plugin.</red>'