diff --git a/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/SchematicsManagerImpl.java b/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/SchematicsManagerImpl.java index 974c2d726..43810ec22 100644 --- a/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/SchematicsManagerImpl.java +++ b/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/SchematicsManagerImpl.java @@ -239,9 +239,10 @@ public void saveSchematic(Location pos1, Location pos2, int offsetX, int offsetY compoundValue.put("pitch", new FloatTag(pitch)); compoundValue.put("version", new StringTag(ServerVersion.getBukkitVersion())); - SuperiorSchematic schematic = new SuperiorSchematic(schematicName, new CompoundTag(compoundValue)); + CompoundTag schematicTag = new CompoundTag(compoundValue); + SuperiorSchematic schematic = new SuperiorSchematic(schematicName, schematicTag); this.schematicsContainer.addSchematic(schematic); - saveIntoFile(schematicName, schematic); + saveIntoFile(schematicName, schematicTag); if (runnable != null) runnable.run(); @@ -299,7 +300,7 @@ private Schematic loadFromFile(String schemName, File file) { return schematic; } - private void saveIntoFile(String name, SuperiorSchematic schematic) { + private void saveIntoFile(String name, CompoundTag schematicTag) { try { File file = new File(plugin.getDataFolder(), "schematics/" + name + ".schematic"); @@ -310,7 +311,7 @@ private void saveIntoFile(String name, SuperiorSchematic schematic) { file.createNewFile(); try (DataOutputStream writer = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(file)))) { - schematic.getTag().write(writer); + schematicTag.write(writer); } } catch (IOException ex) { ex.printStackTrace(); diff --git a/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/impl/SuperiorSchematic.java b/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/impl/SuperiorSchematic.java index 563c1b49b..e8f391ca1 100644 --- a/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/impl/SuperiorSchematic.java +++ b/src/main/java/com/bgsoftware/superiorskyblock/world/schematic/impl/SuperiorSchematic.java @@ -30,8 +30,6 @@ public class SuperiorSchematic extends BaseSchematic implements Schematic { - private final CompoundTag compoundTag; - private final BlockOffset offset; private final float yaw; private final float pitch; @@ -42,7 +40,6 @@ public class SuperiorSchematic extends BaseSchematic implements Schematic { public SuperiorSchematic(String name, CompoundTag compoundTag) { super(name); - this.compoundTag = compoundTag; int xSize = compoundTag.getInt("xSize"); int ySize = compoundTag.getInt("ySize"); @@ -149,10 +146,6 @@ public Set getLoadedChunks() { return loadedChunks; } - public CompoundTag getTag() { - return compoundTag; - } - private void readBlock(SchematicBlockData block) { Key key = plugin.getNMSAlgorithms().getBlockKey(block.getCombinedId()); cachedCounts.put(key, cachedCounts.getRaw(key, 0) + 1);