Compare commits

...

4 Commits

Author SHA1 Message Date
Ryder Belserion 1416d1039d
Update things 2024-02-23 20:00:20 -05:00
Ryder Belserion c6d9664fe2
Update crazyauctions 2024-02-23 15:22:13 -05:00
Ryder Belserion e262e0a5e8
refactor: change package domain 2024-02-20 11:30:05 -05:00
Ryder Belserion 5746be3075
Update run files 2024-02-20 11:29:51 -05:00
24 changed files with 88 additions and 66 deletions

View File

@ -75,7 +75,7 @@ public class Config implements SettingsHolder {
"| Text File Based Storage",
" |» JSON (.json files) *NOT IMPLEMENTED*"
})
public static final Property<StorageType> storage_type = newBeanProperty(StorageType.class, "root.database.storage-method", StorageType.H2);
public static final Property<StorageType> storage_type = newBeanProperty(StorageType.class, "root.database.storage-method", StorageType.SQLITE);
@Comment("The prefix used in commands")
public static final Property<String> command_prefix = newProperty("root.command_prefix", " <dark_gray>[<dark_red>Crazy<blue>Auctions<dark_gray>]: <reset>");

View File

@ -27,6 +27,8 @@ cluster_api = { module = "com.ryderbelserion.cluster:api", version.ref = "cluste
jorel_bukkit = { module = "dev.jorel:commandapi-bukkit-shade", version = "9.4.0-SNAPSHOT" }
triumph_cmds = { module = "dev.triumphteam:triumph-cmd-bukkit", version = "2.0.0-ALPHA-9" }
config_me = { module = "ch.jalu:configme", version = "1.4.1" }
hikari = { module = "com.zaxxer:HikariCP", version = "5.1.0" }

View File

@ -13,6 +13,8 @@ dependencies {
implementation(libs.bstats)
compileOnly(libs.vault)
compileOnly(fileTree("libs").include("*.jar"))
}

View File

@ -72,6 +72,9 @@ collisions:
fix-climbing-bypassing-cramming-rule: false
max-entity-collisions: 8
only-players-collide: false
command-blocks:
force-follow-perm-level: true
permissions-level: 2
entities:
armor-stands:
do-collision-entity-lookups: true

View File

@ -1,5 +1,5 @@
#Minecraft server properties
#Thu Dec 14 21:57:20 EST 2023
#Tue Feb 20 11:29:33 EST 2024
enable-jmx-monitoring=false
rcon.port=25575
level-seed=

View File

@ -1,13 +1,13 @@
package us.crazycrew.crazyauctions;
package com.ryderbelserion.crazyauctions;
import com.badbones69.crazyauctions.common.config.types.Config;
import com.ryderbelserion.crazyauctions.api.PaperAbstractPlugin;
import com.ryderbelserion.crazyauctions.api.database.Storage;
import com.ryderbelserion.crazyauctions.api.database.StorageFactory;
import com.ryderbelserion.crazyauctions.commands.CommandManager;
import com.ryderbelserion.cluster.ClusterFactory;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazyauctions.api.PaperAbstractPlugin;
import us.crazycrew.crazyauctions.api.database.Storage;
import us.crazycrew.crazyauctions.api.database.StorageFactory;
import us.crazycrew.crazyauctions.commands.CommandManager;
public class CrazyAuctions extends JavaPlugin {
@ -43,6 +43,9 @@ public class CrazyAuctions extends JavaPlugin {
// Load storage factory.
StorageFactory storageFactory = new StorageFactory();
this.storage = storageFactory.getInstance();
// Enable commands.
this.commandManager.enable();
}
@Override

View File

@ -1,4 +1,4 @@
package us.crazycrew.crazyauctions.api;
package com.ryderbelserion.crazyauctions.api;
import ch.jalu.configme.SettingsManager;
import com.badbones69.crazyauctions.common.config.ConfigFactory;

View File

@ -1,4 +1,4 @@
package us.crazycrew.crazyauctions.api.builders;
package com.ryderbelserion.crazyauctions.api.builders;
import com.ryderbelserion.cluster.utils.AdvUtils;
import org.bukkit.entity.Player;
@ -6,7 +6,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazyauctions.CrazyAuctions;
import com.ryderbelserion.crazyauctions.CrazyAuctions;
@SuppressWarnings("ALL")
public abstract class InventoryBuilder implements InventoryHolder {
@ -59,7 +59,7 @@ public abstract class InventoryBuilder implements InventoryHolder {
return this.player;
}
public InventoryView getInventoryView() {
public InventoryView getView() {
return getPlayer().getOpenInventory();
}

View File

@ -1,6 +1,6 @@
package us.crazycrew.crazyauctions.api.database;
package com.ryderbelserion.crazyauctions.api.database;
import us.crazycrew.crazyauctions.api.database.impl.StorageImpl;
import com.ryderbelserion.crazyauctions.api.database.impl.StorageImpl;
import java.sql.SQLException;
public class Storage {

View File

@ -1,12 +1,13 @@
package us.crazycrew.crazyauctions.api.database;
package com.ryderbelserion.crazyauctions.api.database;
import com.badbones69.crazyauctions.common.api.CrazyAuctionsPlugin;
import com.badbones69.crazyauctions.common.config.types.Config;
import com.badbones69.crazyauctions.common.enums.storage.StorageType;
import us.crazycrew.crazyauctions.CrazyAuctions;
import us.crazycrew.crazyauctions.api.database.impl.StorageImpl;
import us.crazycrew.crazyauctions.api.database.impl.sql.SqlStorage;
import us.crazycrew.crazyauctions.api.database.impl.sql.file.types.SqliteConnection;
import com.ryderbelserion.crazyauctions.api.database.impl.StorageImpl;
import com.ryderbelserion.crazyauctions.api.database.impl.sql.file.types.SqliteConnection;
import com.ryderbelserion.crazyauctions.CrazyAuctions;
import com.ryderbelserion.crazyauctions.api.database.impl.sql.SqlStorage;
import java.io.File;
public class StorageFactory {
@ -15,7 +16,6 @@ public class StorageFactory {
Storage storage;
storage = new Storage(create(CrazyAuctionsPlugin.get().getConfig().getProperty(Config.storage_type)));
storage.init();
return storage;

View File

@ -1,7 +1,6 @@
package us.crazycrew.crazyauctions.api.database.impl;
package com.ryderbelserion.crazyauctions.api.database.impl;
import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;
public interface StorageImpl {

View File

@ -1,7 +1,8 @@
package us.crazycrew.crazyauctions.api.database.impl.sql;
package com.ryderbelserion.crazyauctions.api.database.impl.sql;
import com.ryderbelserion.crazyauctions.api.database.impl.StorageImpl;
import com.ryderbelserion.crazyauctions.api.database.impl.sql.file.ConnectionImpl;
import us.crazycrew.crazyauctions.api.database.impl.StorageImpl;
import us.crazycrew.crazyauctions.api.database.impl.sql.file.ConnectionImpl;
import java.io.File;
import java.sql.SQLException;

View File

@ -1,6 +1,6 @@
package us.crazycrew.crazyauctions.api.database.impl.sql.file;
package com.ryderbelserion.crazyauctions.api.database.impl.sql.file;
import us.crazycrew.crazyauctions.api.database.impl.StorageImpl;
import com.ryderbelserion.crazyauctions.api.database.impl.StorageImpl;
import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;

View File

@ -1,6 +1,7 @@
package us.crazycrew.crazyauctions.api.database.impl.sql.file.types;
package com.ryderbelserion.crazyauctions.api.database.impl.sql.file.types;
import com.ryderbelserion.crazyauctions.api.database.impl.sql.file.ConnectionImpl;
import us.crazycrew.crazyauctions.api.database.impl.sql.file.ConnectionImpl;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;

View File

@ -1,4 +1,4 @@
package us.crazycrew.crazyauctions.api.interfaces;
package com.ryderbelserion.crazyauctions.api.interfaces;
public interface UserFactory {

View File

@ -1,6 +1,6 @@
package us.crazycrew.crazyauctions.api.users;
package com.ryderbelserion.crazyauctions.api.users;
import us.crazycrew.crazyauctions.api.interfaces.UserFactory;
import com.ryderbelserion.crazyauctions.api.interfaces.UserFactory;
public class UserManager implements UserFactory {

View File

@ -1,12 +1,12 @@
package us.crazycrew.crazyauctions.bootstrap;
package com.ryderbelserion.crazyauctions.bootstrap;
import io.papermc.paper.plugin.bootstrap.BootstrapContext;
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
import io.papermc.paper.plugin.bootstrap.PluginProviderContext;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazyauctions.CrazyAuctions;
import us.crazycrew.crazyauctions.api.PaperAbstractPlugin;
import com.ryderbelserion.crazyauctions.CrazyAuctions;
import com.ryderbelserion.crazyauctions.api.PaperAbstractPlugin;
public class CrazyLoader implements PluginBootstrap {
@ -15,6 +15,7 @@ public class CrazyLoader implements PluginBootstrap {
@Override
public void bootstrap(@NotNull BootstrapContext context) {
this.plugin = new PaperAbstractPlugin(context.getDataDirectory().toFile());
this.plugin.init();
}
@Override

View File

@ -1,13 +1,21 @@
package us.crazycrew.crazyauctions.commands;
package com.ryderbelserion.crazyauctions.commands;
import com.badbones69.crazyauctions.common.api.CrazyAuctionsPlugin;
import com.badbones69.crazyauctions.common.config.types.Config;
import com.ryderbelserion.cluster.utils.AdvUtils;
import com.ryderbelserion.crazyauctions.commands.engine.CommandContext;
import com.ryderbelserion.crazyauctions.commands.engine.CommandEngine;
import com.ryderbelserion.crazyauctions.commands.subs.HelpCommand;
import com.ryderbelserion.crazyauctions.commands.subs.ReloadCommand;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.CommandAPIBukkitConfig;
import dev.jorel.commandapi.CommandAPICommand;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazyauctions.CrazyAuctions;
import us.crazycrew.crazyauctions.commands.engine.CommandEngine;
import java.util.*;
import com.ryderbelserion.crazyauctions.CrazyAuctions;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class CommandManager {
@ -22,7 +30,7 @@ public class CommandManager {
public void load() {
// Create command config.
CommandAPIBukkitConfig config = new CommandAPIBukkitConfig(this.plugin);
config.shouldHookPaperReload(true).silentLogs(!CrazyAuctionsPlugin.get().getConfig().getProperty(Config.verbose_logging)).setNamespace("crazycrates");
config.shouldHookPaperReload(true).silentLogs(CrazyAuctionsPlugin.get().getConfig().getProperty(Config.verbose_logging)).usePluginNamespace();
// Load command api.
CommandAPI.onLoad(config);
@ -33,8 +41,8 @@ public class CommandManager {
CommandAPI.onEnable();
// Create default command.
/*CommandAPICommand command = new CommandAPICommand("crazyauctions")
.withAliases("ca", "ah")
CommandAPICommand command = new CommandAPICommand("ca")
.withAliases("ah")
.withPermission("crazyauctions.help")
.executes((sender, args) -> {
CommandContext context = new CommandContext(sender, args);
@ -44,8 +52,7 @@ public class CommandManager {
return;
}
AuctionHouseMenu auctions = new AuctionHouseMenu(context.getPlayer(), 54, AuctionsFactory.getAuctions().getProperty(GuiConfig.inventory_name));
auctions.open();
sender.sendMessage("This is the base command.");
});
// Bind subcommand to the object above.
@ -55,7 +62,7 @@ public class CommandManager {
).forEach(this::addCommand);
// Register it all.
command.register();*/
command.register();
}
public void addCommand(CommandEngine command) {

View File

@ -1,4 +1,4 @@
package us.crazycrew.crazyauctions.commands.engine;
package com.ryderbelserion.crazyauctions.commands.engine;
import com.ryderbelserion.cluster.contexts.PlayerContext;
import dev.jorel.commandapi.executors.CommandArguments;

View File

@ -1,8 +1,8 @@
package us.crazycrew.crazyauctions.commands.engine;
package com.ryderbelserion.crazyauctions.commands.engine;
import dev.jorel.commandapi.CommandAPICommand;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazyauctions.CrazyAuctions;
import com.ryderbelserion.crazyauctions.CrazyAuctions;
public abstract class CommandEngine {

View File

@ -1,20 +1,23 @@
package us.crazycrew.crazyauctions.commands.engine;
package com.ryderbelserion.crazyauctions.commands.engine;
import com.badbones69.crazyauctions.common.api.CrazyAuctionsPlugin;
import com.badbones69.crazyauctions.common.config.ConfigFactory;
import com.badbones69.crazyauctions.common.api.interfaces.AbstractPlugin;
import com.badbones69.crazyauctions.common.config.types.Locale;
import com.badbones69.crazyauctions.common.enums.Messages;
import com.ryderbelserion.cluster.api.builder.ComponentBuilder;
import com.ryderbelserion.cluster.api.builder.FancyComponentBuilder;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazyauctions.CrazyAuctions;
import com.ryderbelserion.crazyauctions.CrazyAuctions;
import java.util.HashMap;
import java.util.Map;
public class CommandHelpEntry {
@NotNull
private final AbstractPlugin instance = CrazyAuctionsPlugin.get();
@NotNull
private final CrazyAuctions plugin = CrazyAuctions.get();
@ -89,6 +92,7 @@ public class CommandHelpEntry {
context.reply(commandBuilder.build());
ComponentBuilder builder = new ComponentBuilder();
FancyComponentBuilder fancy = builder.getFancyComponentBuilder();
if (this.page > 1) {
int number = this.page-1;
@ -98,9 +102,8 @@ public class CommandHelpEntry {
builder.setMessage(footer.replaceAll("\\{page}", newPage));
builder.getFancyComponentBuilder().hover(CrazyAuctionsPlugin.get().getLocale().getProperty(Locale.back_button), CrazyAuctionsPlugin.get().getLocale().getProperty(Locale.navigation_text).replaceAll("\\{type}", "back"));
builder.getFancyComponentBuilder().click(ClickEvent.Action.RUN_COMMAND, usage);
fancy.hover(CrazyAuctionsPlugin.get().getLocale().getProperty(Locale.back_button), this.instance.getLocale().getProperty(Locale.navigation_text).replaceAll("\\{type}", "back"));
fancy.click(ClickEvent.Action.RUN_COMMAND, usage);
} else if (this.page < this.plugin.getCommandManager().getClasses().size()) {
int number = this.page+1;
@ -109,9 +112,9 @@ public class CommandHelpEntry {
builder.setMessage(footer.replaceAll("\\{page}", newPage));
builder.getFancyComponentBuilder().hover(CrazyAuctionsPlugin.get().getLocale().getProperty(Locale.next_button), CrazyAuctionsPlugin.get().getLocale().getProperty(Locale.navigation_text).replaceAll("\\{type}", "next"));
fancy.hover(this.instance.getLocale().getProperty(Locale.next_button), this.instance.getLocale().getProperty(Locale.navigation_text).replaceAll("\\{type}", "next"));
builder.getFancyComponentBuilder().click(ClickEvent.Action.RUN_COMMAND, usage);
fancy.click(ClickEvent.Action.RUN_COMMAND, usage);
}
footerComponent = builder.build();
@ -136,8 +139,8 @@ public class CommandHelpEntry {
}
public void setPage(int page, int perPage) {
this.setPerPage(perPage);
this.setPage(page);
setPerPage(perPage);
setPage(page);
}
public int getPage() {

View File

@ -1,9 +1,9 @@
package us.crazycrew.crazyauctions.commands.subs;
package com.ryderbelserion.crazyauctions.commands.subs;
import com.ryderbelserion.crazyauctions.commands.engine.CommandContext;
import com.ryderbelserion.crazyauctions.commands.engine.CommandEngine;
import com.ryderbelserion.crazyauctions.commands.engine.CommandHelpEntry;
import dev.jorel.commandapi.CommandAPICommand;
import us.crazycrew.crazyauctions.commands.engine.CommandContext;
import us.crazycrew.crazyauctions.commands.engine.CommandEngine;
import us.crazycrew.crazyauctions.commands.engine.CommandHelpEntry;
public class HelpCommand extends CommandEngine {

View File

@ -1,9 +1,9 @@
package us.crazycrew.crazyauctions.commands.subs;
package com.ryderbelserion.crazyauctions.commands.subs;
import com.badbones69.crazyauctions.common.enums.Messages;
import com.ryderbelserion.crazyauctions.commands.engine.CommandContext;
import dev.jorel.commandapi.CommandAPICommand;
import us.crazycrew.crazyauctions.commands.engine.CommandContext;
import us.crazycrew.crazyauctions.commands.engine.CommandEngine;
import com.ryderbelserion.crazyauctions.commands.engine.CommandEngine;
public class ReloadCommand extends CommandEngine {

View File

@ -1,4 +1,4 @@
package us.crazycrew.crazyauctions.menus;
package com.ryderbelserion.crazyauctions.menus;
import com.ryderbelserion.cluster.api.builders.InventoryBuilder;
import com.ryderbelserion.cluster.items.ItemBuilder;