Jump to content

Zergod

Members
  • Posts

    1
  • Joined

  • Last visited

Zergod's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. In Forge Build 1.7.10-10.13.1.1219: Was introdused BlockSnapshot (BlockSnapshot contained blockID, Meta, BlockPosition(int: x, y, z), etc. But later at Forge Build Build 1.8-11.14.0.1296: all of the x,y,z values was replaced by BlockPos (Now BlockSnapshot contains BlockID(string),Meta, BlockPosition(BlockPos), etc. This change (int: x, y, z, -> BlockPos) renders Serialization not posible, due to BlockPos not a serializable class. BlockSnapshot still implements io.Serializable interface, but it cant be serialized Idk this is a bug or feature, but still cost me a hour to realise a problem source. code example: BlockSnapshot BA1 = new BlockSnapshot(plr.world,cap1.getBlockPos(0),plr.world.getBlockState(cap1.getBlockPos(0))); try { File directory = new File(System.getProperty("user.dir")+"/"+arg2+"/"+arg3+"/"); if (! directory.exists()){ directory.mkdirs(); } FileOutputStream fileOut = new FileOutputStream(System.getProperty("user.dir")+"/"+arg2+"/"+arg3+"/"+arg4+".zba"); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(BA1); out.close(); fileOut.close(); System.out.printf("Serialized data is saved in :"+System.getProperty("user.dir")+"/"+arg2+"/"+arg3+"/"+arg4+".zba"); }catch(IOException i) { i.printStackTrace(); } https://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.8-11.14.1.1320/serialized-form.html#net.minecraftforge.common.util.BlockSnapshot http://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.7.10-10.13.2.1291//index.html?net/minecraftforge/common/util/BlockSnapshot.html http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.11.2-13.20.0.2282/forge-1.11.2-13.20.0.2282-changelog.txt
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.