Jump to content

Recommended Posts

Posted

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.

xD how is that solveable?

Posted

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

Posted

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.

Posted

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!

Posted

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 ;)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.