Posted August 3, 201312 yr Hello. I writing on a machine which uses modules to work. The modules will be created by my module maker. Very Easy. Now the problem is i use NBTData to safe most informations for the modules. As the same way as tinkers construct as does. Now the info what tells the problem. I made my system so much compatible that everyone can add their own modules. Without adding any Item/BlockID. And this is the Trouble. How do i get The icons? There is no function which makes Icons without using an Item. or i didn't found one. So how can i add icons without using an Itemclass? I looked at IronChest. And there he uses a for loop with ItemDamage. Will not work in my case! Same as TinkersConstruct. Won't work too. how is that solveable?
August 3, 201312 yr This is a little confusing... are you saying you don't know how to get the item/block icon to appear in the inventory? as in, it just show a missing texture file? also, uploading your code would help people to work out where you're going wrong or what you need to do
August 3, 201312 yr Well put a public abstract Icon getModuleIcon(); In your abstract class. Anyone extending your class will need to provide this icon. If your class isn't abstract: public Icon getModuleIcon() { return defaultIcon; } But then you'll have to register this default icon yourself, and people not overriding it will get the same. Of course, you can provide more arguments if you have some.
August 3, 201312 yr Author Yeah getAnIcon is not the problem i make it like this: IModulClass: public interface IModul { Icon getIconFormModulID(int modulID); } ModulRegisterClass public class ModulRegister { public static IModul modul; public List<IModul> modules = new ArrayList<IModul>(); public static void RegisterModul(IModul par1) { modules.add(par1); } public static Icon getIconFromID(int modulID) { Icon output = null; for(IModul icons : modules) { if(icons.getIconFormModulID(modulID) != null) { output = icons.getIconFormModulID(modulID); } } return output; } } Now the problem is how register an icon ? I know that you have to register it befor it can be loaded. That is my Problem!
August 3, 201312 yr You can register an Icon with a Block, an Item or a Render class. But why would it matter ? Once you get that returned icon, you can do whatever you want with it, it should be already registered. Alternatively, you can ask for a ResourceLocation
August 3, 201312 yr Author Cool would that work with renderpasses? I mean is that convertable to icons?
August 3, 201312 yr Author i did not read it perfect . I have an idea. I tell it if it did work^^ or if i failed .
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.