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)
| 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. |
no test coverage detected