diff options
author | syeyoung <cyong06@naver.com> | 2021-02-26 14:57:15 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-26 14:57:15 +0900 |
commit | e429287b83904d4d0576c3cf292a85eabb48c888 (patch) | |
tree | 7d239c05934460dabb8c7a44a8de94fe966efc1e /src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java | |
parent | 0e2ae080900bcb9c34d2013848bd9d2c5bae1e28 (diff) | |
download | Skyblock-Dungeons-Guide-e429287b83904d4d0576c3cf292a85eabb48c888.tar.gz Skyblock-Dungeons-Guide-e429287b83904d4d0576c3cf292a85eabb48c888.tar.bz2 Skyblock-Dungeons-Guide-e429287b83904d4d0576c3cf292a85eabb48c888.zip |
schematics bruh
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java index f4450bd2..c23d7c0d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java @@ -18,9 +18,11 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import java.awt.*; -import java.io.File; +import java.io.*; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.UUID; +import java.util.zip.GZIPOutputStream; public class GeneralEditPane extends MPanel { private DungeonRoom dungeonRoom; @@ -130,13 +132,32 @@ public class GeneralEditPane extends MPanel { public void run() { try { NBTTagCompound nbtTagCompound2 = createNBT(); - NBTTagCompound real = new NBTTagCompound(); - real.setTag("Schematic", nbtTagCompound2); File f=new File(e.getDungeonsGuide().getConfigDir(), "schematics/"+ dungeonRoom.getDungeonRoomInfo().getName()+"-"+dungeonRoom.getDungeonRoomInfo().getUuid().toString()+"-"+ UUID.randomUUID()+".schematic"); - CompressedStreamTools.write(nbtTagCompound2, f); + Method method = null; + try { + method = NBTTagCompound.class.getDeclaredMethod("write", DataOutput.class); + method.setAccessible(true); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + return; + } + FileOutputStream fos = new FileOutputStream(f); + DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(fos))); + + try + { + dataoutputstream.writeByte(nbtTagCompound2.getId()); + + dataoutputstream.writeUTF("Schematic"); + method.invoke(nbtTagCompound2, dataoutputstream); + } + finally + { + dataoutputstream.close(); + } Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSaved to "+f.getName())); } catch (Throwable e) { e.printStackTrace(); @@ -235,7 +256,7 @@ public class GeneralEditPane extends MPanel { compound.setByteArray("Blocks", blocks); compound.setByteArray("Data", meta); - compound.setString("Materials", "Classic"); + compound.setString("Materials", "Alpha"); if (extraEx) { compound.setByteArray("AddBlocks", extranibble); } |