MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / addTextureSet

Method addTextureSet

src/main/java/gregapi/render/TextureSet.java:57–65  ·  view source on GitHub ↗

Adds a new Texture Set, unless another Set with the same Name already exists. @param aModID the Mod responsible for adding the Icons (which are located in either assets\aModID.toLowerCase()\textures\items\materialicons\ or assets\aModID.toLowerCase()\textures\blocks\materialicons\). @param aIsItem t

(String aModID, boolean aIsItem, String aNameSet)

Source from the content-addressed store, hash-verified

55 * @param aIsItem true if this is an Item Icon, false if this is a Block Icon.
56 */
57 public static TextureSet addTextureSet(String aModID, boolean aIsItem, String aNameSet) {
58 List<TextureSet> tTextureSetList = (aIsItem?INSTANCES_ITEM:INSTANCES_BLOCK);
59 List<String> tFileNameList = (aIsItem?FILENAMES_ITEM:FILENAMES_BLOCK);
60 for (TextureSet tSet : tTextureSetList) if (tSet.mNameSet.equals(aNameSet)) return tSet;
61 TextureSet rSet = new TextureSet(aIsItem, aNameSet);
62 tTextureSetList.add(rSet);
63 for (int i = 0, j = tFileNameList.size(); i < j; i++) rSet.mList.add(aIsItem?new TextureSetIconItem(aModID, aNameSet+"/"+tFileNameList.get(i)):new TextureSetIconBlock(aModID, aNameSet+"/"+tFileNameList.get(i)));
64 return rSet;
65 }
66
67 /**
68 * Adds a new Icon Name to all Texture Sets, or just returns the Index of an already existing Set with the same File Name.

Callers 4

TextureSetClass · 0.95
GT_APIMethod · 0.45
PrefixItemMethod · 0.45
PrefixBlockMethod · 0.45

Calls 4

addMethod · 0.65
getMethod · 0.65
equalsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected