Skip to content

Commit

Permalink
chore: setup stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rooooose-b committed Jan 21, 2024
1 parent 712aa1b commit 39f11ac
Show file tree
Hide file tree
Showing 26 changed files with 104 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @GITHUB_USERNAME
* @rooooose-b
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

10 changes: 0 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
GITHUB_CONTACT_EMAIL.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
Expand Down
10 changes: 3 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ plugins {
idea
}

group = "io.github.ExampleUser"
version = "1.0.5"
group = "io.github.Alathra"
version = "1.0.0"
description = ""
val mainPackage = "${project.group}.${rootProject.name}"

Expand Down Expand Up @@ -78,10 +78,6 @@ dependencies {
}

tasks {
// NOTE: Use when developing plugins using Mojang mappings
// assemble {
// dependsOn(reobfJar)
// }

build {
dependsOn(shadowJar)
Expand Down Expand Up @@ -154,7 +150,7 @@ bukkit { // Options: https://github.com/Minecrell/plugin-yml#bukkit
prefix = project.name
version = "${project.version}"
description = "${project.description}"
authors = listOf("GITHUB_USERNAME")
authors = listOf("rooooose-b, ShermansWorld")
contributors = listOf()
apiVersion = "1.19"

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0")
}

rootProject.name = "ExamplePlugin"
rootProject.name = "AlathraSkills"
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package io.github.ExampleUser.ExamplePlugin;
package io.github.Alathra.AlathraSkills;

import com.github.milkdrinkers.colorparser.ColorParser;
import io.github.ExampleUser.ExamplePlugin.command.CommandHandler;
import io.github.ExampleUser.ExamplePlugin.config.ConfigHandler;
import io.github.ExampleUser.ExamplePlugin.db.DatabaseHandler;
import io.github.ExampleUser.ExamplePlugin.hooks.VaultHook;
import io.github.ExampleUser.ExamplePlugin.listener.ListenerHandler;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
import io.github.Alathra.AlathraSkills.command.CommandHandler;
import io.github.Alathra.AlathraSkills.config.ConfigHandler;
import io.github.Alathra.AlathraSkills.db.DatabaseHandler;
import io.github.Alathra.AlathraSkills.hooks.VaultHook;
import io.github.Alathra.AlathraSkills.listener.ListenerHandler;
import io.github.Alathra.AlathraSkills.utility.Logger;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

public class ExamplePlugin extends JavaPlugin {
private static ExamplePlugin instance;
public class AlathraSkills extends JavaPlugin {
private static AlathraSkills instance;
private ConfigHandler configHandler;
private DatabaseHandler databaseHandler;
private CommandHandler commandHandler;
private ListenerHandler listenerHandler;
private static VaultHook vaultHook;

public static ExamplePlugin getInstance() {
public static AlathraSkills getInstance() {
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin;
package io.github.Alathra.AlathraSkills;

/**
* Implemented in classes that should support being reloaded IE executing the methods during runtime after startup.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package io.github.ExampleUser.ExamplePlugin.command;
package io.github.Alathra.AlathraSkills.command;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.Reloadable;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.CommandAPIBukkitConfig;

/**
* A class to handle registration of commands.
*/
public class CommandHandler implements Reloadable {
private final ExamplePlugin plugin;
private final AlathraSkills plugin;

public CommandHandler(ExamplePlugin plugin) {
public CommandHandler(AlathraSkills plugin) {
this.plugin = plugin;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.command;
package io.github.Alathra.AlathraSkills.command;

import com.github.milkdrinkers.colorparser.ColorParser;
import dev.jorel.commandapi.CommandAPICommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.config;
package io.github.Alathra.AlathraSkills.config;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.Reloadable;
import com.github.milkdrinkers.Crate.Config;

import javax.inject.Singleton;
Expand All @@ -11,15 +11,15 @@
*/
@Singleton
public class ConfigHandler implements Reloadable {
private final ExamplePlugin plugin;
private final AlathraSkills plugin;
private Config cfg;

/**
* Instantiates a new Config handler.
*
* @param plugin the plugin instance
*/
public ConfigHandler(ExamplePlugin plugin) {
public ConfigHandler(AlathraSkills plugin) {
this.plugin = plugin;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.ExampleUser.ExamplePlugin.db;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.ExampleUser.ExamplePlugin.db.flyway.DatabaseMigrationException;
import io.github.ExampleUser.ExamplePlugin.db.flyway.DatabaseMigrationHandler;
import io.github.ExampleUser.ExamplePlugin.db.jooq.JooqContext;
import io.github.ExampleUser.ExamplePlugin.utility.Cfg;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
package io.github.Alathra.AlathraSkills.db;

import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.Reloadable;
import io.github.Alathra.AlathraSkills.db.flyway.DatabaseMigrationException;
import io.github.Alathra.AlathraSkills.db.flyway.DatabaseMigrationHandler;
import io.github.Alathra.AlathraSkills.db.jooq.JooqContext;
import io.github.Alathra.AlathraSkills.utility.Cfg;
import io.github.Alathra.AlathraSkills.utility.Logger;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.jetbrains.annotations.NotNull;
Expand All @@ -22,7 +22,7 @@
*/
@Singleton
public class DatabaseHandler implements Reloadable {
private final ExamplePlugin plugin;
private final AlathraSkills plugin;
private boolean isConnected = false;
private HikariDataSource hikariDataSource;
private DatabaseType database;
Expand All @@ -33,7 +33,7 @@ public class DatabaseHandler implements Reloadable {
*
* @param plugin the plugin instance
*/
public DatabaseHandler(ExamplePlugin plugin) {
public DatabaseHandler(AlathraSkills plugin) {
this.plugin = plugin;
}

Expand Down Expand Up @@ -261,7 +261,7 @@ private void openConnection() {
hikariConfig.setMaximumPoolSize(poolSize);
hikariConfig.setMinimumIdle(poolSize);

hikariConfig.setPoolName("%s-hikari".formatted(ExamplePlugin.getInstance().getName()));
hikariConfig.setPoolName("%s-hikari".formatted(AlathraSkills.getInstance().getName()));
hikariConfig.setAutoCommit(true);
hikariConfig.setTransactionIsolation("TRANSACTION_REPEATABLE_READ");
hikariConfig.setIsolateInternalQueries(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.db;
package io.github.Alathra.AlathraSkills.db;

import io.github.ExampleUser.ExamplePlugin.utility.DB;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
import io.github.Alathra.AlathraSkills.utility.DB;
import io.github.Alathra.AlathraSkills.utility.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jooq.DSLContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.db;
package io.github.Alathra.AlathraSkills.db;

import com.mysql.cj.jdbc.MysqlDataSource;
import org.h2.jdbcx.JdbcDataSource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway;
package io.github.Alathra.AlathraSkills.db.flyway;

public class DatabaseMigrationException extends Exception {
public DatabaseMigrationException(Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway;
package io.github.Alathra.AlathraSkills.db.flyway;

import io.github.ExampleUser.ExamplePlugin.db.DatabaseType;
import io.github.ExampleUser.ExamplePlugin.db.flyway.migration.V3__Example;
import io.github.Alathra.AlathraSkills.db.DatabaseType;
import io.github.Alathra.AlathraSkills.db.flyway.migration.V3__Example;
import com.github.milkdrinkers.Crate.Config;
import org.flywaydb.core.Flyway;
import org.flywaydb.core.api.ClassProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway;
package io.github.Alathra.AlathraSkills.db.flyway;

import org.flywaydb.core.api.ClassProvider;
import org.flywaydb.core.api.migration.JavaMigration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway.migration;
package io.github.Alathra.AlathraSkills.db.flyway.migration;

import io.github.ExampleUser.ExamplePlugin.utility.DB;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
import io.github.Alathra.AlathraSkills.utility.DB;
import io.github.Alathra.AlathraSkills.utility.Logger;
import org.flywaydb.core.api.migration.BaseJavaMigration;
import org.flywaydb.core.api.migration.Context;
import org.jooq.DSLContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.ExampleUser.ExamplePlugin.db.jooq;
package io.github.Alathra.AlathraSkills.db.jooq;

import io.github.ExampleUser.ExamplePlugin.utility.Cfg;
import io.github.Alathra.AlathraSkills.utility.Cfg;
import org.jooq.*;
import org.jooq.conf.*;
import org.jooq.exception.DataAccessException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.hooks;
package io.github.Alathra.AlathraSkills.hooks;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.Reloadable;
import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
Expand All @@ -13,7 +13,7 @@
* A hook to interface with the <a href="https://github.com/MilkBowl/VaultAPI">Vault API</a>.
*/
public class VaultHook implements Reloadable {
private final ExamplePlugin plugin;
private final AlathraSkills plugin;
private @Nullable RegisteredServiceProvider<Economy> rspEconomy;
private @Nullable RegisteredServiceProvider<Permission> rspPermissions;
private @Nullable RegisteredServiceProvider<Chat> rspChat;
Expand All @@ -23,7 +23,7 @@ public class VaultHook implements Reloadable {
*
* @param plugin the plugin instance
*/
public VaultHook(ExamplePlugin plugin) {
public VaultHook(AlathraSkills plugin) {
this.plugin = plugin;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package io.github.ExampleUser.ExamplePlugin.listener;
package io.github.Alathra.AlathraSkills.listener;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.Reloadable;

/**
* A class to handle registration of event listeners.
*/
public class ListenerHandler implements Reloadable {
private final ExamplePlugin plugin;
private final AlathraSkills plugin;

public ListenerHandler(ExamplePlugin plugin) {
public ListenerHandler(AlathraSkills plugin) {
this.plugin = plugin;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.listener;
package io.github.Alathra.AlathraSkills.listener;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.hooks.VaultHook;
import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
Expand All @@ -10,11 +11,11 @@
import org.bukkit.plugin.RegisteredServiceProvider;

/**
* Event Listener for the Vault Hook {@link io.github.ExampleUser.ExamplePlugin.hooks.VaultHook}.
* Event Listener for the Vault Hook {@link VaultHook}.
*/
public class VaultListener implements Listener {
/**
* Update the Vault hooks RegisteredServiceProviders in {@link io.github.ExampleUser.ExamplePlugin.hooks.VaultHook}. <br></br>This ensures the Vault hook is lazily loaded and working properly, even on reloads.
* Update the Vault hooks RegisteredServiceProviders in {@link VaultHook}. <br></br>This ensures the Vault hook is lazily loaded and working properly, even on reloads.
*
* @param e event
*/
Expand All @@ -24,11 +25,11 @@ public void onServiceRegisterEvent(ServiceRegisterEvent e) {
RegisteredServiceProvider<?> rsp = e.getProvider();
Object rspProvider = rsp.getProvider();
if (rspProvider instanceof Economy) {
ExamplePlugin.getVaultHook().setEconomy((RegisteredServiceProvider<Economy>) rsp);
AlathraSkills.getVaultHook().setEconomy((RegisteredServiceProvider<Economy>) rsp);
} else if (rspProvider instanceof Permission) {
ExamplePlugin.getVaultHook().setPermissions((RegisteredServiceProvider<Permission>) rsp);
AlathraSkills.getVaultHook().setPermissions((RegisteredServiceProvider<Permission>) rsp);
} else if (rspProvider instanceof Chat) {
ExamplePlugin.getVaultHook().setChat((RegisteredServiceProvider<Chat>) rsp);
AlathraSkills.getVaultHook().setChat((RegisteredServiceProvider<Chat>) rsp);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.utility;
package io.github.Alathra.AlathraSkills.utility;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.config.ConfigHandler;
import io.github.Alathra.AlathraSkills.AlathraSkills;
import io.github.Alathra.AlathraSkills.config.ConfigHandler;
import com.github.milkdrinkers.Crate.Config;
import org.jetbrains.annotations.NotNull;

Expand All @@ -14,6 +14,6 @@ public abstract class Cfg {
*/
@NotNull
public static Config get() {
return ExamplePlugin.getInstance().getConfigHandler().getConfig();
return AlathraSkills.getInstance().getConfigHandler().getConfig();
}
}
Loading

0 comments on commit 39f11ac

Please sign in to comment.