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

Method addToAll

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

Adds a new Icon Name to all Texture Sets, or just returns the Index of an already existing Set with the same File Name. @param aModID the Mod responsible for adding the Icons (which are located in either assets\aModID.toLowerCase()\textures\items\materialicons\ or assets\aModID.toLowerCase()\texture

(String aModID, boolean aIsItem, String aNameFile)

Source from the content-addressed store, hash-verified

71 * @return the Index of this Icon inside the Set Lists.
72 */
73 public static int addToAll(String aModID, boolean aIsItem, String aNameFile) {
74 List<String> tFileNameList = (aIsItem?FILENAMES_ITEM:FILENAMES_BLOCK);
75 int tIndex = tFileNameList.indexOf(aNameFile);
76 if (tIndex >= 0) return tIndex;
77 tFileNameList.add(aNameFile);
78 for (TextureSet tSet : (aIsItem?INSTANCES_ITEM:INSTANCES_BLOCK)) tSet.mList.add(tSet.mIsItem?new TextureSetIconItem(aModID, tSet.mNameSet+"/"+aNameFile):new TextureSetIconBlock(aModID, tSet.mNameSet+"/"+aNameFile));
79 return tFileNameList.size() - 1;
80 }
81
82 public static class TextureSetIconItem implements IIconContainer, Runnable {
83 private final String mMod, mName;

Callers 2

GT_APIMethod · 0.95
addTextureSetMethod · 0.95

Calls 2

addMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected