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