Package net.minecraft.nbt

Examples of net.minecraft.nbt.NBTTagByte


        {
            NBTTagList list = new NBTTagList();
            boolean[] array = (boolean[]) obj;
            for (int i = 0; i < array.length; i++)
            {
                list.appendTag(new NBTTagByte((byte) (array[i] ? 1 : 0)));
            }

            tag.setTag(name, list);
        }
        else if (type.equals(String.class))
View Full Code Here


        {
            return tag.getBoolean(name);
        }
        else if (type.equals(boolean[].class))
        {
            NBTTagList list = tag.getTagList(name, new NBTTagByte((byte) 0).getId());
            boolean[] array = new boolean[list.tagCount()];
            for (int i = 0; i < array.length; i++)
            {
                array[i] = ((NBTTagByte) list.removeTag(0)).func_150290_f() != 0;
            }
View Full Code Here

    return null;
  }
 
  /** Creates a tag from a value. The type is determined by the type of the value. */
  public static NBTBase createTag(Object value) {
    if (value instanceof Byte)    return new NBTTagByte((Byte)value);
    if (value instanceof Short)   return new NBTTagShort((Short)value);
    if (value instanceof Integer) return new NBTTagInt((Integer)value);
    if (value instanceof Long)    return new NBTTagLong((Long)value);
    if (value instanceof Float)   return new NBTTagFloat((Float)value);
    if (value instanceof Doublereturn new NBTTagDouble((Double)value);
View Full Code Here

  }

  @Override
  public byte getByte(String tag) {
    try {
      NBTTagByte nbtTagByte = (NBTTagByte) tagMap.get(tag);
      return nbtTagByte == null ? 0 : nbtTagByte.data;
    } catch (ClassCastException e) {
      throw new ReportedException(createCrashReport(tag, 1, e));
    }
  }
View Full Code Here

TOP

Related Classes of net.minecraft.nbt.NBTTagByte

Copyright © 2018 www.massapicom. 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.