From 4bf672d3ee2707b0a5d41e8733e5b8f36708bd4a Mon Sep 17 00:00:00 2001 From: Paldiu Date: Mon, 22 Feb 2021 12:43:56 -0600 Subject: [PATCH] Added a couple new api features --- .../paldiu/simplexcore/SimplexCore.java | 4 +-- ...nListener.java => DependencyListener.java} | 2 +- .../paldiu/simplexcore/sign/IUsableSign.java | 17 +++++++++++ .../simplexcore/structures/IStructure.java | 29 +++++++++++++++++++ .../simplexcore/structures/Structure.java | 5 ++++ 5 files changed, 54 insertions(+), 3 deletions(-) rename src/main/java/io/github/paldiu/simplexcore/listener/{ServerPluginListener.java => DependencyListener.java} (95%) create mode 100644 src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java create mode 100644 src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java create mode 100644 src/main/java/io/github/paldiu/simplexcore/structures/Structure.java diff --git a/src/main/java/io/github/paldiu/simplexcore/SimplexCore.java b/src/main/java/io/github/paldiu/simplexcore/SimplexCore.java index 8447bcc..3b394a9 100644 --- a/src/main/java/io/github/paldiu/simplexcore/SimplexCore.java +++ b/src/main/java/io/github/paldiu/simplexcore/SimplexCore.java @@ -2,7 +2,7 @@ package io.github.paldiu.simplexcore; import io.github.paldiu.simplexcore.command.defaults.Command_info; import io.github.paldiu.simplexcore.concurrent.Announcer; -import io.github.paldiu.simplexcore.listener.ServerPluginListener; +import io.github.paldiu.simplexcore.listener.DependencyListener; import io.github.paldiu.simplexcore.listener.SimplexListener; import io.github.paldiu.simplexcore.plugin.SimplexAddon; import io.github.paldiu.simplexcore.utils.Constants; @@ -35,7 +35,7 @@ public final class SimplexCore extends SimplexAddon { Constants.getCommandLoader().classpath(Command_info.class).load(); Constants.getConfig().reload(); // - SimplexListener.register(new ServerPluginListener(), this); + SimplexListener.register(new DependencyListener(), this); new Announcer(); } catch (Exception ex) { suspended = true; diff --git a/src/main/java/io/github/paldiu/simplexcore/listener/ServerPluginListener.java b/src/main/java/io/github/paldiu/simplexcore/listener/DependencyListener.java similarity index 95% rename from src/main/java/io/github/paldiu/simplexcore/listener/ServerPluginListener.java rename to src/main/java/io/github/paldiu/simplexcore/listener/DependencyListener.java index 7a68fc8..052b6da 100644 --- a/src/main/java/io/github/paldiu/simplexcore/listener/ServerPluginListener.java +++ b/src/main/java/io/github/paldiu/simplexcore/listener/DependencyListener.java @@ -9,7 +9,7 @@ import org.bukkit.event.server.PluginEnableEvent; import java.util.ArrayList; import java.util.List; -public final class ServerPluginListener extends SimplexListener { +public final class DependencyListener extends SimplexListener { public List PAPI_NAMES = new ArrayList<>() {{ add("PlaceholderAPI"); add("PlaceHolderAPI"); diff --git a/src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java b/src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java new file mode 100644 index 0000000..0523067 --- /dev/null +++ b/src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java @@ -0,0 +1,17 @@ +package io.github.paldiu.simplexcore.sign; + +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.block.Block; + +public interface IUsableSign { + Block getBlock(); + + Location getSignLocation(); + + World getWorld(); + + String getSignText(); + + void executeOnInteract(); +} diff --git a/src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java b/src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java new file mode 100644 index 0000000..fb32415 --- /dev/null +++ b/src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java @@ -0,0 +1,29 @@ +package io.github.paldiu.simplexcore.structures; + +import io.github.paldiu.simplexcore.math.Size; +import org.bukkit.Location; +import org.bukkit.NamespacedKey; +import org.bukkit.World; +import org.bukkit.block.Block; + +public interface IStructure { + NamespacedKey getNamespacedKey(); + + String getName(); + + int getId(); + + Location getLocation(); + + World getWorld(); + + boolean shouldGenerateNaturally(); + + void generate(Location location, World world); + + void generate(Location location, World world, boolean generateNaturally); + + Size getApproximateSize(); + + Block[] getBlocks(); +} diff --git a/src/main/java/io/github/paldiu/simplexcore/structures/Structure.java b/src/main/java/io/github/paldiu/simplexcore/structures/Structure.java new file mode 100644 index 0000000..a101a7c --- /dev/null +++ b/src/main/java/io/github/paldiu/simplexcore/structures/Structure.java @@ -0,0 +1,5 @@ +package io.github.paldiu.simplexcore.structures; + +public class Structure { + // TODO: Write this file to parse schematics. +}