Update on Structure

This commit is contained in:
abhiram 2021-03-26 23:37:30 +05:30
parent 81dbe3b234
commit 628294f148
3 changed files with 57 additions and 2 deletions

View File

@ -0,0 +1,7 @@
package io.github.simplexdev.simplexcore.structures;
public enum PasteType {
BLOCKBYBLOCKASYNC,
INSTANTASYNC
}

View File

@ -1,5 +1,45 @@
package io.github.simplexdev.simplexcore.structures; package io.github.simplexdev.simplexcore.structures;
public class Structure { import io.github.simplexdev.simplexcore.module.SimplexModule;
// TODO: Write this 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<Vector, NBTBlock> nbtBlocks = new HashMap<>();
private HashMap<Integer, BlockData> 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...");
}
}
} }

View File

@ -0,0 +1,8 @@
package io.github.simplexdev.simplexcore.structures.exception;
public class SchematicNotLoaded extends Exception {
public SchematicNotLoaded(String msg) {
super(msg);
}
}