diff --git a/src/main/java/io/github/simplexdev/simplexcore/structures/PasteType.java b/src/main/java/io/github/simplexdev/simplexcore/structures/PasteType.java new file mode 100644 index 0000000..1ec4955 --- /dev/null +++ b/src/main/java/io/github/simplexdev/simplexcore/structures/PasteType.java @@ -0,0 +1,7 @@ +package io.github.simplexdev.simplexcore.structures; + + +public enum PasteType { + BLOCKBYBLOCKASYNC, + INSTANTASYNC +} diff --git a/src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java b/src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java index 07c07df..c5528d7 100644 --- a/src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java +++ b/src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java @@ -1,5 +1,45 @@ package io.github.simplexdev.simplexcore.structures; -public class Structure { - // TODO: Write this +import io.github.simplexdev.simplexcore.module.SimplexModule; +import io.github.simplexdev.simplexcore.structures.block.NBTBlock; +import io.github.simplexdev.simplexcore.structures.exception.InvalidSchematic; +import io.github.simplexdev.simplexcore.structures.exception.SchematicNotLoaded; +import org.bukkit.Location; +import org.bukkit.block.data.BlockData; +import org.bukkit.plugin.Plugin; + +import java.io.File; +import java.util.HashMap; +import java.util.Vector; + +public final class Structure { + public Plugin plugin; + private File schematic; + private short width = 0; + private short height = 0; + private short length = 0; + private byte[] blockdatacontainer; + + private HashMap nbtBlocks = new HashMap<>(); + private HashMap blocks = new HashMap<>(); + + public Structure(SimplexModule plugin,File schematic) + { + this.plugin = plugin.getPlugin(); + this.schematic = schematic; + } + + public void load() throws InvalidSchematic + { + + } + + public void paste(Location loc,PasteType pasteType) throws SchematicNotLoaded + { + if (width == 0 || height == 0 || length == 0 || blocks.isEmpty()) { + throw new SchematicNotLoaded("Schematic not loaded please load schematic first..."); + } + + + } } diff --git a/src/main/java/io/github/simplexdev/simplexcore/structures/exception/SchematicNotLoaded.java b/src/main/java/io/github/simplexdev/simplexcore/structures/exception/SchematicNotLoaded.java new file mode 100644 index 0000000..1612a28 --- /dev/null +++ b/src/main/java/io/github/simplexdev/simplexcore/structures/exception/SchematicNotLoaded.java @@ -0,0 +1,8 @@ +package io.github.simplexdev.simplexcore.structures.exception; + +public class SchematicNotLoaded extends Exception { + + public SchematicNotLoaded(String msg) { + super(msg); + } +}