Package com.forgeessentials.data.api

Examples of com.forgeessentials.data.api.ClassContainer


    {

        if (cat != null)
        {
            String name;
            ClassContainer newType;
            ITypeInfo<?> newInfo;
            TypeData newData;
            Object value;
            for (Property prop : cat.getValues().values())
            {
                name = prop.getName();
                newType = info.getTypeOfField(name);
                value = readFieldFromProperty(cfg, cat.getQualifiedName(), name, newType.getType());
                data.putField(name, value);
            }

            for (String childName : cfg.getCategoryNames())
            {
View Full Code Here


        DataStorageManager.registerSaveableType(Point.class);
        DataStorageManager.registerSaveableType(WorldPoint.class);
        DataStorageManager.registerSaveableType(WarpPoint.class);

        DataStorageManager.registerSaveableType(TypeInfoItemStack.class, new ClassContainer(ItemStack.class));
        DataStorageManager.registerSaveableType(TypeInfoNBTCompound.class, new ClassContainer(NBTTagCompound.class));
        DataStorageManager.registerSaveableType(TypeInfoNBTTagList.class, new ClassContainer(NBTTagList.class));
    }
View Full Code Here

        }
    }

    private void readClassFromTag(NBTTagCompound tag, TypeData data, ITypeInfo info)
    {
        ClassContainer tempType;
        Object val;
        for (String childName : (Collection<String>) tag.func_150296_c())
        {
            tempType = info.getTypeOfField(childName);

            if (StorageManager.isTypeComplex(tempType))
            {
                NBTTagCompound compound = tag.getCompoundTag(childName);
                TypeData tempData = DataStorageManager.getDataForType(tempType);
                readClassFromTag(compound, tempData, info.getInfoForField(childName));
                val = tempData;
            }
            else
            {
                val = readPrimitiveFromTag(tag, childName, tempType.getType());
            }

            data.putField(childName, val);
        }
    }
View Full Code Here

  }

  @Override
  public ClassContainer getType()
  {
    return new ClassContainer(type);
  }
View Full Code Here

    }

    @Override
    public void buildEntry(HashMap<String, ClassContainer> fields)
    {
        fields.put(KEY, new ClassContainer(String.class));
        fields.put(TYPE, new ClassContainer(int.class));
        fields.put(PRIMITIVE, new ClassContainer(String.class));
        fields.put(TAG_LIST, new ClassContainer(NBTTagList.class));
        fields.put(COMPOUND, new ClassContainer(NBTTagCompound.class));
        fields.put(B_ARRAY, new ClassContainer(byte[].class));
        fields.put(I_ARRAY, new ClassContainer(int[].class));
    }
View Full Code Here

    @Override
    public ClassContainer getTypeOfField(String field)
    {
        if (field.equalsIgnoreCase(COMPOUND))
        {
            return new ClassContainer(NBTTagCompound.class);
        }
        else
        {
            return null;
        }
View Full Code Here

    }

    @Override
    public void buildEntry(HashMap<String, ClassContainer> fields)
    {
        fields.put(KEY, new ClassContainer(container.getParameters()[0]));
        fields.put(VAL, new ClassContainer(container.getParameters()[1]));
    }
View Full Code Here

    }

    @Override
    public void buildEntry(HashMap<String, ClassContainer> fields)
    {
        fields.put(POS, new ClassContainer(int.class));
        fields.put(ELEMENT, new ClassContainer(container.getParameters()[0]));
    }
View Full Code Here

     * Notifies the PlayerInfo to save itself to the Data store.
     */
    public void save()
    {
        recalcTimePlayed();
        DataStorageManager.getReccomendedDriver().saveObject(new ClassContainer(PlayerInfo.class), this);
    }
View Full Code Here

    public static boolean playerInfoExists(UUID playerID)
    {
        if (playerInfoMap.containsKey(playerID))
            return true;
        PlayerInfo info = (PlayerInfo) DataStorageManager.getReccomendedDriver().loadObject(new ClassContainer(PlayerInfo.class), playerID.toString());
        if (info != null)
            return true;
        info = new PlayerInfo(playerID);
        playerInfoMap.put(playerID, info);
        return false;
View Full Code Here

TOP

Related Classes of com.forgeessentials.data.api.ClassContainer

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.