BLEEDING-EDGE v1.3_01

- Removed some static abuse
 - Moved TimeValues to their own class
 - Renamed package to simplexdev from paldiu
 - Moved interface classes to a respective api package
 - Removed Lisp
This commit is contained in:
Paldiu 2021-02-25 23:35:46 -06:00
parent a06ba4db5d
commit 549187b450
53 changed files with 252 additions and 217 deletions

View File

@ -1,4 +0,0 @@
package io.github.paldiu.simplexcore.concurrent;
public final class TaskFactory {
}

View File

@ -1,96 +0,0 @@
package io.github.paldiu.simplexcore.utils;
import io.github.paldiu.simplexcore.SimplexCorePlugin;
import io.github.paldiu.simplexcore.command.CommandLoader;
import io.github.paldiu.simplexcore.config.Yaml;
import io.github.paldiu.simplexcore.config.YamlFactory;
import io.github.paldiu.simplexcore.plugin.AddonRegistry;
import io.github.paldiu.simplexcore.plugin.DependencyManagement;
import org.bukkit.Server;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
import java.util.logging.Logger;
public final class Constants {
private static final SimplexCorePlugin plugin = JavaPlugin.getPlugin(SimplexCorePlugin.class);
private static final Server server = plugin.getServer();
private static final Logger logger = plugin.getLogger();
private static final PluginManager manager = server.getPluginManager();
private static final BukkitScheduler scheduler = server.getScheduler();
private static final DependencyManagement dpm = new DependencyManagement();
private static final Yaml config = new YamlFactory(plugin).setDefaultPathways();
private static final TimeValues time = new TimeValues();
// Utility class should not be instantiated.
private Constants() {
throw new AssertionError();
}
public static SimplexCorePlugin getPlugin() {
return plugin;
}
public static Server getServer() {
return server;
}
public static Logger getLogger() {
return logger;
}
public static PluginManager getManager() {
return manager;
}
public static BukkitScheduler getScheduler() {
return scheduler;
}
public static synchronized AddonRegistry getRegistry() {
return AddonRegistry.getInstance();
}
public static synchronized CommandLoader getCommandLoader() {
return CommandLoader.getInstance();
}
public static DependencyManagement getDependencyManager() {
return dpm;
}
public static TimeValues getTimeValues() {
return time;
}
public static Yaml getConfig() {
return config;
}
public static class TimeValues {
public long SECOND() {
return 20L;
}
public long MINUTE() {
return 1200L;
}
public long HOUR() {
return 72000L;
}
public long DAY() {
return 1728000L;
}
public long MONTH() {
return 51840000L;
}
public long YEAR() {
return 622080000L;
}
}
}

View File

@ -1,4 +1,6 @@
package io.github.paldiu.simplexcore.ban; package io.github.simplexdev.api;
import io.github.simplexdev.simplexcore.ban.BanType;
import java.util.Date; import java.util.Date;
import java.util.UUID; import java.util.UUID;

View File

@ -1,5 +1,6 @@
package io.github.paldiu.simplexcore.config; package io.github.simplexdev.api;
import io.github.simplexdev.api.func.Path;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import java.util.List; import java.util.List;

View File

@ -1,5 +1,6 @@
package io.github.paldiu.simplexcore.gui; package io.github.simplexdev.api;
import io.github.simplexdev.api.func.Action;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.particle; package io.github.simplexdev.api;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.Particle; import org.bukkit.Particle;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.potion; package io.github.simplexdev.api;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;

View File

@ -1,6 +1,6 @@
package io.github.paldiu.simplexcore.structures; package io.github.simplexdev.api;
import io.github.paldiu.simplexcore.math.Size; import io.github.simplexdev.simplexcore.math.Size;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.World; import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.sign; package io.github.simplexdev.api;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.command; package io.github.simplexdev.api.annotations;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.gui; package io.github.simplexdev.api.func;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.functional; package io.github.simplexdev.api.func;
@FunctionalInterface @FunctionalInterface
public interface Guard { public interface Guard {

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.config; package io.github.simplexdev.api.func;
@FunctionalInterface @FunctionalInterface
public interface Path { public interface Path {

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.functional; package io.github.simplexdev.api.func;
@FunctionalInterface @FunctionalInterface
public interface Validate { public interface Validate {

View File

@ -1,6 +1,6 @@
package io.github.paldiu.simplexcore; package io.github.simplexdev.simplexcore;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
public class CoreState { public class CoreState {
String message; String message;

View File

@ -1,11 +1,12 @@
package io.github.paldiu.simplexcore; package io.github.simplexdev.simplexcore;
import io.github.paldiu.simplexcore.command.defaults.Command_info; import io.github.simplexdev.simplexcore.command.defaults.Command_info;
import io.github.paldiu.simplexcore.concurrent.Announcer; import io.github.simplexdev.simplexcore.concurrent.Announcer;
import io.github.paldiu.simplexcore.listener.DependencyListener; import io.github.simplexdev.simplexcore.listener.DependencyListener;
import io.github.paldiu.simplexcore.listener.SimplexListener; import io.github.simplexdev.simplexcore.listener.SimplexListener;
import io.github.paldiu.simplexcore.plugin.SimplexAddon; import io.github.simplexdev.simplexcore.plugin.SimplexAddon;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import io.github.simplexdev.simplexcore.utils.Instances;
// This comment was added to force a test on Jenkins AutoBuild // This comment was added to force a test on Jenkins AutoBuild
// https://jenkins.coomware.dev/job/SimplexCore // https://jenkins.coomware.dev/job/SimplexCore
@ -13,29 +14,24 @@ public final class SimplexCorePlugin extends SimplexAddon<SimplexCorePlugin> {
protected static boolean debug = false; protected static boolean debug = false;
protected static boolean suspended = false; protected static boolean suspended = false;
public static boolean isDebug() { protected Instances instances;
return debug;
}
public static void setDebug(boolean enable) {
debug = enable;
}
public static boolean isSuspended() {
return suspended;
}
@Override @Override
public SimplexCorePlugin getPlugin() { public SimplexCorePlugin getPlugin() {
return this; return this;
} }
@Override
public void init() {
instances = new Instances();
}
@Override @Override
public void start() { public void start() {
try { try {
Constants.getRegistry().register(this); instances.getRegistry().register(this);
Constants.getCommandLoader().classpath(Command_info.class).load(); instances.getCommandLoader().classpath(Command_info.class).load();
Constants.getConfig().reload(); instances.getConfig().reload();
// //
SimplexListener.register(new DependencyListener(), this); SimplexListener.register(new DependencyListener(), this);
new Announcer(); new Announcer();
@ -52,4 +48,20 @@ public final class SimplexCorePlugin extends SimplexAddon<SimplexCorePlugin> {
public void stop() { public void stop() {
} }
public static boolean isDebug() {
return debug;
}
public static void setDebug(boolean enable) {
debug = enable;
}
public static boolean isSuspended() {
return suspended;
}
public final Instances getInstances() {
return instances;
}
} }

View File

@ -1,10 +1,12 @@
package io.github.paldiu.simplexcore.ban; package io.github.simplexdev.simplexcore.ban;
import io.github.paldiu.simplexcore.chat.Messages; import io.github.simplexdev.api.IBan;
import io.github.paldiu.simplexcore.config.Yaml; import io.github.simplexdev.simplexcore.chat.Messages;
import io.github.paldiu.simplexcore.config.YamlFactory; import io.github.simplexdev.simplexcore.config.Yaml;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.config.YamlFactory;
import io.github.paldiu.simplexcore.utils.Utilities; import io.github.simplexdev.simplexcore.utils.Constants;
import io.github.simplexdev.simplexcore.utils.Utilities;
import io.github.simplexdev.simplexcore.listener.SimplexListener;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -17,8 +19,8 @@ import java.util.Date;
* This class provides a way for you to handle your own banning. * This class provides a way for you to handle your own banning.
* Simply extend this class and create a new instance of the subclass. * Simply extend this class and create a new instance of the subclass.
* Alternatively, you may use {@link BanFactory#create} to create a new Ban instance. * Alternatively, you may use {@link BanFactory#create} to create a new Ban instance.
* Use this in synchrony with {@link io.github.paldiu.simplexcore.listener.SimplexListener} to process bans on player login/join. * Use this in synchrony with {@link SimplexListener} to process bans on player login/join.
* Use this in synchrony with {@link io.github.paldiu.simplexcore.config.YamlFactory} to create a new yaml file to store your bans, or to create an individual yaml file per user ban. * Use this in synchrony with {@link YamlFactory} to create a new yaml file to store your bans, or to create an individual yaml file per user ban.
*/ */
public abstract class Ban implements IBan { public abstract class Ban implements IBan {
private final Player player; private final Player player;
@ -35,7 +37,7 @@ public abstract class Ban implements IBan {
} }
public Ban(Player player, CommandSender sender, BanType type) { public Ban(Player player, CommandSender sender, BanType type) {
this(player, sender, type, Constants.getTimeValues().DAY()); this(player, sender, type, Constants.getPlugin().getInstances().getTimeValues().DAY());
} }
public Ban(Player player, CommandSender sender, BanType type, long banDuration) { public Ban(Player player, CommandSender sender, BanType type, long banDuration) {

View File

@ -1,9 +1,10 @@
package io.github.paldiu.simplexcore.ban; package io.github.simplexdev.simplexcore.ban;
import io.github.paldiu.simplexcore.chat.Messages; import io.github.simplexdev.api.IBan;
import io.github.paldiu.simplexcore.functional.Guard; import io.github.simplexdev.simplexcore.chat.Messages;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.api.func.Guard;
import io.github.paldiu.simplexcore.utils.Utilities; import io.github.simplexdev.simplexcore.utils.Constants;
import io.github.simplexdev.simplexcore.utils.Utilities;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -26,7 +27,6 @@ public final class BanFactory {
this.type = type; this.type = type;
this.banReason = Messages.BAN.getMessage(); this.banReason = Messages.BAN.getMessage();
assignBanDuration().verify();
banId = createBanId(); banId = createBanId();
} }
@ -99,11 +99,11 @@ public final class BanFactory {
private Guard assignBanDuration() { private Guard assignBanDuration() {
return () -> { return () -> {
if (type.equals(BanType.PERMANENT)) { if (type.equals(BanType.PERMANENT)) {
banDuration = Constants.getTimeValues().YEAR() * 99; banDuration = Constants.getPlugin().getInstances().getTimeValues().YEAR() * 99;
} else if (type.equals(BanType.TEMPORARY)) { } else if (type.equals(BanType.TEMPORARY)) {
banDuration = Constants.getTimeValues().DAY(); banDuration = Constants.getPlugin().getInstances().getTimeValues().DAY();
} else { } else {
banDuration = Constants.getTimeValues().MINUTE() * 5; banDuration = Constants.getPlugin().getInstances().getTimeValues().MINUTE() * 5;
} }
}; };
} }

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.ban; package io.github.simplexdev.simplexcore.ban;
public enum BanType { public enum BanType {
PERMANENT("P-"), PERMANENT("P-"),

View File

@ -1,6 +1,6 @@
package io.github.paldiu.simplexcore.chat; package io.github.simplexdev.simplexcore.chat;
import io.github.paldiu.simplexcore.utils.Bean; import io.github.simplexdev.simplexcore.utils.Bean;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.chat; package io.github.simplexdev.simplexcore.chat;
public enum Messages { public enum Messages {
NO_PERMS("You do not have permission to use this command!"), NO_PERMS("You do not have permission to use this command!"),

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.chat; package io.github.simplexdev.simplexcore.chat;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;

View File

@ -1,7 +1,8 @@
package io.github.paldiu.simplexcore.command; package io.github.simplexdev.simplexcore.command;
import io.github.paldiu.simplexcore.command.defaults.DefaultCommand; import io.github.simplexdev.api.annotations.CommandInfo;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.command.defaults.DefaultCommand;
import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.*; import org.bukkit.command.*;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.command; package io.github.simplexdev.simplexcore.command;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import io.github.paldiu.simplexcore.utils.Utilities; import io.github.simplexdev.simplexcore.utils.Utilities;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.command.defaults; package io.github.simplexdev.simplexcore.command.defaults;
import io.github.paldiu.simplexcore.command.CommandInfo; import io.github.simplexdev.api.annotations.CommandInfo;
import io.github.paldiu.simplexcore.command.SimplexCommand; import io.github.simplexdev.simplexcore.command.SimplexCommand;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.command.defaults; package io.github.simplexdev.simplexcore.command.defaults;
import io.github.paldiu.simplexcore.command.CommandInfo; import io.github.simplexdev.api.annotations.CommandInfo;
import io.github.paldiu.simplexcore.command.SimplexCommand; import io.github.simplexdev.simplexcore.command.SimplexCommand;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.concurrent; package io.github.simplexdev.simplexcore.concurrent;
import io.github.paldiu.simplexcore.chat.Messages; import io.github.simplexdev.simplexcore.chat.Messages;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import org.apache.commons.lang.math.RandomUtils; import org.apache.commons.lang.math.RandomUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.concurrent; package io.github.simplexdev.simplexcore.concurrent;
import io.github.paldiu.simplexcore.plugin.SimplexAddon; import io.github.simplexdev.simplexcore.plugin.SimplexAddon;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import java.util.Date; import java.util.Date;
@ -24,8 +24,8 @@ public abstract class SimplexTask implements Consumer<BukkitTask> {
} }
protected SimplexTask() { protected SimplexTask() {
DELAY = Constants.getTimeValues().SECOND() * 30; // 30 seconds until the task triggers for the first time. DELAY = Constants.getPlugin().getInstances().getTimeValues().SECOND() * 30; // 30 seconds until the task triggers for the first time.
INTERVAL = Constants.getTimeValues().MINUTE() * 5; // Task will run at 5 minute intervals once the first trigger has been called. INTERVAL = Constants.getPlugin().getInstances().getTimeValues().MINUTE() * 5; // Task will run at 5 minute intervals once the first trigger has been called.
} }
public <T extends SimplexTask> void register(T task, SimplexAddon<?> plugin, boolean repeating, boolean delayed) { public <T extends SimplexTask> void register(T task, SimplexAddon<?> plugin, boolean repeating, boolean delayed) {

View File

@ -0,0 +1,4 @@
package io.github.simplexdev.simplexcore.concurrent;
public final class TaskFactory {
}

View File

@ -1,5 +1,7 @@
package io.github.paldiu.simplexcore.config; package io.github.simplexdev.simplexcore.config;
import io.github.simplexdev.api.IConfig;
import io.github.simplexdev.api.func.Path;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import java.util.List; import java.util.List;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.config; package io.github.simplexdev.simplexcore.config;
public final class JsonFactory { public final class JsonFactory {
// TODO: Write a JSON Object Factory. // TODO: Write a JSON Object Factory.

View File

@ -1,7 +1,9 @@
package io.github.paldiu.simplexcore.config; package io.github.simplexdev.simplexcore.config;
import io.github.paldiu.simplexcore.plugin.SimplexAddon; import io.github.simplexdev.api.IConfig;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.api.func.Path;
import io.github.simplexdev.simplexcore.plugin.SimplexAddon;
import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.config; package io.github.simplexdev.simplexcore.config;
import io.github.paldiu.simplexcore.plugin.SimplexAddon; import io.github.simplexdev.simplexcore.plugin.SimplexAddon;
import io.github.paldiu.simplexcore.utils.Trio; import io.github.simplexdev.simplexcore.utils.Trio;
import java.io.File; import java.io.File;

View File

@ -1,9 +1,10 @@
package io.github.paldiu.simplexcore.gui; package io.github.simplexdev.simplexcore.gui;
import io.github.simplexdev.api.func.Action;
import io.github.simplexdev.api.IGUI;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;

View File

@ -1,5 +1,7 @@
package io.github.paldiu.simplexcore.gui; package io.github.simplexdev.simplexcore.gui;
import io.github.simplexdev.api.func.Action;
import io.github.simplexdev.api.IGUI;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.listener; package io.github.simplexdev.simplexcore.listener;
import io.github.paldiu.simplexcore.functional.Validate; import io.github.simplexdev.api.func.Validate;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.listener; package io.github.simplexdev.simplexcore.listener;
import io.github.paldiu.simplexcore.plugin.SimplexAddon; import io.github.simplexdev.simplexcore.plugin.SimplexAddon;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;

View File

@ -1,6 +1,6 @@
package io.github.paldiu.simplexcore.math; package io.github.simplexdev.simplexcore.math;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
@ -44,6 +44,6 @@ public final class Cuboid {
}; };
Constants.getScheduler().runTaskLaterAsynchronously(Constants.getPlugin(), task, Constants.getTimeValues().SECOND()); Constants.getScheduler().runTaskLaterAsynchronously(Constants.getPlugin(), task, Constants.getPlugin().getInstances().getTimeValues().SECOND());
} }
} }

View File

@ -1,6 +1,6 @@
package io.github.paldiu.simplexcore.math; package io.github.simplexdev.simplexcore.math;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.math; package io.github.simplexdev.simplexcore.math;
public enum Size { public enum Size {
SMALL(1, 1, 1), SMALL(1, 1, 1),

View File

@ -1,6 +1,6 @@
package io.github.paldiu.simplexcore.plugin; package io.github.simplexdev.simplexcore.plugin;
import io.github.paldiu.simplexcore.utils.Constants; import io.github.simplexdev.simplexcore.utils.Constants;
public final class AddonManager { public final class AddonManager {
public AddonManager() { public AddonManager() {

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.plugin; package io.github.simplexdev.simplexcore.plugin;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.plugin; package io.github.simplexdev.simplexcore.plugin;
import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager; import com.comphenix.protocol.ProtocolManager;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.plugin; package io.github.simplexdev.simplexcore.plugin;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;

View File

@ -1,6 +1,7 @@
package io.github.paldiu.simplexcore.potion; package io.github.simplexdev.simplexcore.potion;
import io.github.paldiu.simplexcore.utils.Utilities; import io.github.simplexdev.api.IPotionEffect;
import io.github.simplexdev.simplexcore.utils.Utilities;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.structures; package io.github.simplexdev.simplexcore.structures;
public class Structure { public class Structure {
// TODO: Write this file to parse schematics. // TODO: Write this file to parse schematics.

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.utils; package io.github.simplexdev.simplexcore.utils;
import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@ -0,0 +1,43 @@
package io.github.simplexdev.simplexcore.utils;
import io.github.simplexdev.simplexcore.SimplexCorePlugin;
import io.github.simplexdev.simplexcore.command.CommandLoader;
import io.github.simplexdev.simplexcore.config.Yaml;
import io.github.simplexdev.simplexcore.config.YamlFactory;
import io.github.simplexdev.simplexcore.plugin.AddonRegistry;
import io.github.simplexdev.simplexcore.plugin.DependencyManagement;
import org.bukkit.Server;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
import java.util.logging.Logger;
public final class Constants {
private static final SimplexCorePlugin plugin = JavaPlugin.getPlugin(SimplexCorePlugin.class);
private static final Server server = plugin.getServer();
private static final Logger logger = plugin.getLogger();
private static final PluginManager manager = server.getPluginManager();
private static final BukkitScheduler scheduler = server.getScheduler();
public static SimplexCorePlugin getPlugin() {
return plugin;
}
public static Server getServer() {
return server;
}
public static Logger getLogger() {
return logger;
}
public static PluginManager getManager() {
return manager;
}
public static BukkitScheduler getScheduler() {
return scheduler;
}
}

View File

@ -0,0 +1,33 @@
package io.github.simplexdev.simplexcore.utils;
import io.github.simplexdev.simplexcore.command.CommandLoader;
import io.github.simplexdev.simplexcore.config.Yaml;
import io.github.simplexdev.simplexcore.config.YamlFactory;
import io.github.simplexdev.simplexcore.plugin.AddonRegistry;
import io.github.simplexdev.simplexcore.plugin.DependencyManagement;
public class Instances {
private final DependencyManagement dpm = new DependencyManagement();
private final Yaml config = new YamlFactory(Constants.getPlugin()).setDefaultPathways();
private final TimeValues time = new TimeValues();
public synchronized AddonRegistry getRegistry() {
return AddonRegistry.getInstance();
}
public synchronized CommandLoader getCommandLoader() {
return CommandLoader.getInstance();
}
public DependencyManagement getDependencyManager() {
return dpm;
}
public TimeValues getTimeValues() {
return time;
}
public Yaml getConfig() {
return config;
}
}

View File

@ -0,0 +1,27 @@
package io.github.simplexdev.simplexcore.utils;
public final class TimeValues {
public long SECOND() {
return 20L;
}
public long MINUTE() {
return 1200L;
}
public long HOUR() {
return 72000L;
}
public long DAY() {
return 1728000L;
}
public long MONTH() {
return 51840000L;
}
public long YEAR() {
return 622080000L;
}
}

View File

@ -1,4 +1,4 @@
package io.github.paldiu.simplexcore.utils; package io.github.simplexdev.simplexcore.utils;
import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@ -1,6 +1,7 @@
package io.github.paldiu.simplexcore.utils; package io.github.simplexdev.simplexcore.utils;
import io.github.paldiu.simplexcore.ban.BanType; import io.github.simplexdev.api.func.Guard;
import io.github.simplexdev.simplexcore.ban.BanType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View File

@ -1,7 +1,7 @@
package io.github.paldiu.simplexcore.utils; package io.github.simplexdev.simplexcore.utils;
import junit.framework.TestCase; import junit.framework.TestCase;
import io.github.paldiu.simplexcore.ban.BanType; import io.github.simplexdev.simplexcore.ban.BanType;
public class UtilitiesTest extends TestCase { public class UtilitiesTest extends TestCase {
public void testGenerateBanId() { public void testGenerateBanId() {