public CompoundTag clone() { CompoundMap map = new CompoundMap(value); return new CompoundTag(getName(), map); } }
public ByteArrayTag clone() { byte[] clonedArray = cloneArray(value); return new ByteArrayTag(getName(), clonedArray); }
@Before public void setUp() { subject = new ExampleHolder(); CompoundMap map = new CompoundMap(); map.put(new StringTag("name", "helloworld")); CompoundTag mapTag = new CompoundTag("", map); subject.load(mapTag); }
/** * Writes a {@code TAG_Compound} tag. * * @param tag The tag. * @throws java.io.IOException if an I/O error occurs. */ private void writeCompoundTagPayload(CompoundTag tag) throws IOException { for (Tag<?> childTag : tag.getValue().values()) { writeTag(childTag); } os.writeByte(TagType.TAG_END.getId()); // end tag - better way? }
@Test public void reverseSorted() { CompoundMap tag = new CompoundMap(random, true, true); assertEquals("Tag setup", tag, reverse); tag = new CompoundMap(true, true); for (Tag t : random) { tag.put(t); } assertEquals("Tag setup", tag, reverse); }
/** * Takes in an NBT tag, sanely checks null status, and then returns its value. * * @param t Tag to get value from * @return tag value as an object or null if no value */ public static Object toTagValue(Tag<?> t) { if (t == null) { return null; } else { return t.getValue(); } }
/** * Creates a CompoundMap using the same element ordering rules as in the given CompoundMap.<br> <br> The map is initialised using the values given in the CompoundMap. * * @param initial the initial values for the CompoundMap */ public CompoundMap(CompoundMap initial) { this(initial.values(), initial.sort, initial.reverse); }
public static Boolean getBooleanValue(Tag<?> t) { if (t == null) { return null; } try { ByteTag byteTag = (ByteTag) t; return byteTag.getBooleanValue(); } catch (ClassCastException e) { return null; } } }
public EndTag clone() { return new EndTag(); } }
public CompoundTag clone() { CompoundMap map = new CompoundMap(value); return new CompoundTag(getName(), map); } }
/** * Writes a {@code TAG_Compound} tag. * * @param tag The tag. * @throws java.io.IOException if an I/O error occurs. */ private void writeCompoundTagPayload(CompoundTag tag) throws IOException { for (Tag<?> childTag : tag.getValue().values()) { writeTag(childTag); } os.writeByte(TagType.TAG_END.getId()); // end tag - better way? }
/** * Creates a CompoundMap using the same element ordering rules as in the given CompoundMap.<br> <br> The map is initialised using the values given in the CompoundMap. * * @param initial the initial values for the CompoundMap */ public CompoundMap(CompoundMap initial) { this(initial.values(), initial.sort, initial.reverse); }
public static Boolean getBooleanValue(Tag<?> t) { if (t == null) { return null; } try { ByteTag byteTag = (ByteTag) t; return byteTag.getBooleanValue(); } catch (ClassCastException e) { return null; } } }
public EndTag clone() { return new EndTag(); } }
public CompoundTag clone() { CompoundMap map = new CompoundMap(value); return new CompoundTag(getName(), map); } }