Package org.jnbt

Examples of org.jnbt.NBTOutputStream.writeTag()


      final Map<String, Tag> newTopLevelMap = new HashMap<String, Tag>(1);
      newTopLevelMap.put("Data", newDataTag);
      final CompoundTag newTopLevelTag = new CompoundTag("", newTopLevelMap);

      final NBTOutputStream output = new NBTOutputStream(new FileOutputStream(level));
      output.writeTag(newTopLevelTag);
      output.close();
    } catch (final ClassCastException ex) {
      throw new IOException("Invalid level format.");
    } catch (final NullPointerException ex) {
      throw new IOException("Invalid level format.");
View Full Code Here


        posTag.set(1, new DoubleTag("y", 120));
        posTag.set(2, new DoubleTag("z", y));
        rootMap.put("Pos", new ListTag("Pos", DoubleTag.class, posTag));
        root = new CompoundTag("Data", rootMap);
        NBTOutputStream outStream = new NBTOutputStream(new FileOutputStream(out));
        outStream.writeTag(root);
        outStream.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
     
View Full Code Here

        root = new CompoundTag("Data", rootMap);
        HashMap<String, Tag> base = new HashMap<String, Tag>();
        base.put("Data", root);
        root = new CompoundTag("Base", base);
        NBTOutputStream outStream = new NBTOutputStream(new FileOutputStream(out));
        outStream.writeTag(root);
        outStream.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.