/** * Update the given tag compound with position information. * * @param tag the tag * @param position the position * @return a tag compound */ private static NBTTagCompound updateForSet(NBTTagCompound tag, BlockVector3 position) { checkNotNull(tag); checkNotNull(position); tag.setTag("x", new NBTTagInt(position.getBlockX())); tag.setTag("y", new NBTTagInt(position.getBlockY())); tag.setTag("z", new NBTTagInt(position.getBlockZ())); return tag; }
public static NBTTagCompound copyNbtData(TileEntity tile) { NBTTagCompound tag = new NBTTagCompound(); tile.writeToNBT(tag); return tag; } }
public static NBTTagString toNative(StringTag tag) { return new NBTTagString(tag.getValue()); }
public static NBTTagList toNative(ListTag tag) { NBTTagList list = new NBTTagList(); for (Tag child : tag.getValue()) { if (child instanceof EndTag) { continue; } list.appendTag(toNative(child)); } return list; }
public static NBTTagInt toNative(IntTag tag) { return new NBTTagInt(tag.getValue()); }
public static NBTTagLong toNative(LongTag tag) { return new NBTTagLong(tag.getValue()); }
public static NBTTagByte toNative(ByteTag tag) { return new NBTTagByte(tag.getValue()); }
public static LongTag fromNative(NBTTagLong other) { return new LongTag(other.getLong()); }
public static StringTag fromNative(NBTTagString other) { return new StringTag(other.getString()); }
public static NBTTagIntArray toNative(IntArrayTag tag) { int[] value = tag.getValue(); return new NBTTagIntArray(Arrays.copyOf(value, value.length)); }
public static NBTTagFloat toNative(FloatTag tag) { return new NBTTagFloat(tag.getValue()); }
public static IntTag fromNative(NBTTagInt other) { return new IntTag(other.getInt()); }
public static ByteArrayTag fromNative(NBTTagByteArray other) { byte[] value = other.getByteArray(); return new ByteArrayTag(Arrays.copyOf(value, value.length)); }
public static NBTTagByteArray toNative(ByteArrayTag tag) { byte[] value = tag.getValue(); return new NBTTagByteArray(Arrays.copyOf(value, value.length)); }
public static NBTTagShort toNative(ShortTag tag) { return new NBTTagShort(tag.getValue()); }
public static NBTTagDouble toNative(DoubleTag tag) { return new NBTTagDouble(tag.getValue()); }
public static FloatTag fromNative(NBTTagFloat other) { return new FloatTag(other.getFloat()); }
public static ByteTag fromNative(NBTTagByte other) { return new ByteTag(other.getByte()); }
public static ShortTag fromNative(NBTTagShort other) { return new ShortTag(other.getShort()); }
public static DoubleTag fromNative(NBTTagDouble other) { return new DoubleTag(other.getDouble()); }