mirror of
https://github.com/SimplexDevelopment/SimplexCore.git
synced 2024-12-22 08:37:37 +00:00
Update on Structure
This commit is contained in:
parent
81dbe3b234
commit
628294f148
@ -0,0 +1,7 @@
|
|||||||
|
package io.github.simplexdev.simplexcore.structures;
|
||||||
|
|
||||||
|
|
||||||
|
public enum PasteType {
|
||||||
|
BLOCKBYBLOCKASYNC,
|
||||||
|
INSTANTASYNC
|
||||||
|
}
|
@ -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...");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
package io.github.simplexdev.simplexcore.structures.exception;
|
||||||
|
|
||||||
|
public class SchematicNotLoaded extends Exception {
|
||||||
|
|
||||||
|
public SchematicNotLoaded(String msg) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user