Package cpw.mods.fml.common.registry.GameRegistry

Examples of cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier


        public Map<String, Integer> getItemUniqueIDMap() {
            HashMap<String, Integer> map = new HashMap<String, Integer>();
            for (int i = 0; i < 32000; i++) {
                Item itm = getItemByID(i);
                if (itm == null) continue;
                UniqueIdentifier ui = null;
                try {
                    ui = GameRegistry.findUniqueIdentifierFor(itm);
                } catch (Exception x) {
                    Log.warning("Exception caught reading unique ID for item " + i);
                }
View Full Code Here


        this.x = x;
        this.y = y;
        this.z = z;
        this.meta = meta;
        this.flag = flag;
        this.blockIdentifier = new UniqueIdentifier(modid + ":" + blockName);
        this.nbt = nbt;
    }
View Full Code Here

  public String getFriendlyNameCC() {
    return MainProxy.proxy.getName(this);
  }
 
  public String getModName() {
    UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(this.item);
    if(ui == null) return "UNKNOWN";
    return ui.modId;
  }
View Full Code Here

    return i.getNameSpace() + ":" + i.getItemName();
  }

  public String getName(ItemStack is) throws RecipeError
  {
    UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
    String realName = id.modId + ":" + id.name;

    if ( !id.modId.equals( AppEng.modid ) && !id.modId.equals( "minecraft" ) )
      throw new RecipeError( "Not applicable for website" );
View Full Code Here

  public boolean checkEnabled(Block id, int metadata, boolean automatic)
  {
    if ( id == null )
      return false;

    UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id );
    if ( blk == null )
    {
      for (Field f : Block.class.getFields())
      {
        try
View Full Code Here

      NBTTagCompound data = new NBTTagCompound();
      int[] ds = new int[2];
      ds[0] = Item.getIdFromItem( l.getItem() );
      ds[1] = metadata;
      data.setIntArray( "x", ds );
      UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() );
      data.setString( "modid", ui.modId );
      data.setString( "itemname", ui.name );
      is.setTagCompound( data );
      return is;
    }
View Full Code Here

     * @deprecated no replacement planned
     */
    @Deprecated
    public static ModContainer findModOwner(String string)
    {
        UniqueIdentifier ui = new UniqueIdentifier(string);
        if (customOwners.containsKey(ui))
        {
            return customOwners.get(ui);
        }
        return Loader.instance().getIndexedModList().get(ui.modId);
View Full Code Here

    static UniqueIdentifier getUniqueName(Block block)
    {
        if (block == null) return null;
        String name = getMain().iBlockRegistry.getNameForObject(block);
        UniqueIdentifier ui = new UniqueIdentifier(name);
        if (customItemStacks.contains(ui.modId, ui.name))
        {
            return null;
        }
View Full Code Here

    static UniqueIdentifier getUniqueName(Item item)
    {
        if (item == null) return null;
        String name = getMain().iItemRegistry.getNameForObject(item);
        UniqueIdentifier ui = new UniqueIdentifier(name);
        if (customItemStacks.contains(ui.modId, ui.name))
        {
            return null;
        }
View Full Code Here

    public static boolean areStacksEqual(ItemStack stack1, ItemStack stack2, boolean checkMeta, boolean checkNBT, boolean checkOreDict, boolean checkModSimilarity){
        if(stack1 == null && stack2 == null) return true;
        if(stack1 == null && stack2 != null || stack1 != null && stack2 == null) return false;

        if(checkModSimilarity) {
            UniqueIdentifier id1 = GameRegistry.findUniqueIdentifierFor(stack1.getItem());
            if(id1 == null || id1.modId == null) return false;
            String modId1 = id1.modId;
            UniqueIdentifier id2 = GameRegistry.findUniqueIdentifierFor(stack2.getItem());
            if(id2 == null || id2.modId == null) return false;
            String modId2 = id2.modId;
            return modId1.equals(modId2);
        }
        if(checkOreDict) {
View Full Code Here

TOP

Related Classes of cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier

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.