Package net.minecraft.nbt

Examples of net.minecraft.nbt.NBTTagShort


  }
 
  /** 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);
    if (value instanceof Stringreturn new NBTTagString((String)value);
View Full Code Here


  }

  @Override
  public short getShort(String tag) {
    try {
      NBTTagShort nbtTagShort = (NBTTagShort) tagMap.get(tag);
      return nbtTagShort == null ? 0 : nbtTagShort.data;
    } catch (ClassCastException e) {
      throw new ReportedException(createCrashReport(tag, 2, e));
    }
  }
View Full Code Here

TOP

Related Classes of net.minecraft.nbt.NBTTagShort

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.