Search in sources :

Example 1 with ShieldJsonFile

use of reborncore.shields.json.ShieldJsonFile in project RebornCore by TechReborn.

the class ShieldTextureStore method load.

public static void load() {
    ShieldJsonFile file = ShieldJsonLoader.shieldJsonFile;
    if (file != null) {
        for (ShieldUser user : file.userList) {
            boolean isCustomTexture = false;
            String name = user.username;
            if (!user.textureName.isEmpty()) {
                name = user.textureName;
                isCustomTexture = true;
            }
            if (isCustomTexture) {
                ShieldTexture texture;
                if (customTextures.containsKey(name)) {
                    texture = customTextures.get(name);
                } else {
                    texture = new ShieldTexture(RebornCore.WEB_URL + "reborncore/textures/" + name + ".png");
                    customTextures.put(name, texture);
                }
                textures.put(user.username, texture);
            } else {
                textures.put(user.username, new ShieldTexture(RebornCore.WEB_URL + "reborncore/textures/" + user.username + ".png"));
            }
        }
    }
}
Also used : ShieldJsonFile(reborncore.shields.json.ShieldJsonFile) ShieldUser(reborncore.shields.json.ShieldUser)

Aggregations

ShieldJsonFile (reborncore.shields.json.ShieldJsonFile)1 ShieldUser (reborncore.shields.json.ShieldUser)1