Jump to content

Recommended Posts

Posted

I have been working on my mod, and everything is working pretty well, but I've been waiting for a good creative tab tutorial for a while. basically, in 1.7 i could do this:

 

 

public class ModTabs{

 

public static CreativeTabs Tab1;

public static CreativeTabs Tab2;

 

public static void init() {

Tab1 = new CreativeTabs("Tab One"){

public Item getTabIconItem(){

return ModItems.Icon1;

}

};

Tab2 = new CreativeTabs("Tab Two"){

public Item getTabIconItem() {

return ModItems.Icon2;

}

};

//repeat

}

}

 

public class Icon1 extends Item {

 

public Icon1() {

setUnlocalizedName("Icon1");

setRegistryName("Icon1");

setCreativeTab(ModTabs.Tab1);

}

 

}

 

Now, in 1.10, the tabs still show up, but I cant add items to them! Anyone know what I'm doing wrong?

Lord Volkihar has requested that I send the following message to everyone who is gifted, intellectually or artistically:

We hope that some people could help us share an epic tale of lord Volkihar's achievements and magnificent life. we plan to do this through modern media such as books, games, and mods.

For lost details, we are looking for around 5 gallons of Cortexiphan, and some N.Z.T.(around 50 pills) also, if you happen to know how to create a gel with the same density as human flesh, but low viscosity and adhesion, recipes would be appreciated.

Posted

That was just an example, I didn't actually plan on doing that.

 

 

@Mod(modid = MagicRifts.MODID, version = MagicRifts.VERSION)

public class MagicRifts {

public static final String MODID = "magicrifts";

public static final String VERSION = "0.0";

public static final String CLIENT_PROXY_CLASS = "com.zane49er.MagicRifts.proxy.ClientProxy";

public static final String SERVER_PROXY_CLASS = "com.zane49er.MagicRifts.proxy.ServerProxy";

 

@Instance

public static MagicRifts instance;

 

@SidedProxy(clientSide = CLIENT_PROXY_CLASS, serverSide = SERVER_PROXY_CLASS)

public static CommonProxy proxy;

 

@EventHandler

public void preInit(FMLPreInitializationEvent event) {

ModItems.init();

ModItems.register();

ModBlocks.init();

ModBlocks.register();

ModTabs.init();

ModWorld.init();

}

 

@EventHandler

public void init(FMLInitializationEvent event) {

proxy.init();

ModCrafting.register();

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event) {

 

}

}

 

 

Lord Volkihar has requested that I send the following message to everyone who is gifted, intellectually or artistically:

We hope that some people could help us share an epic tale of lord Volkihar's achievements and magnificent life. we plan to do this through modern media such as books, games, and mods.

For lost details, we are looking for around 5 gallons of Cortexiphan, and some N.Z.T.(around 50 pills) also, if you happen to know how to create a gel with the same density as human flesh, but low viscosity and adhesion, recipes would be appreciated.

Posted

When I create a Creative Tab for my mod I just have it has a variable in my main class like so

 

public class Main {
public static CreativeTabs tab = new CreativeTabs("tab") {
	public Item getTabIconItem () {
		return ModItems.AN_ITEM;
	}
};
}

 

I don't need it to place it in one of FML's initialization events.

 

Maybe try that and see if it fixes your problem.

 

Posted

When I create a Creative Tab for my mod I just have it has a variable in my main class like so

 

public class Main {
   public static CreativeTabs tab = new CreativeTabs("tab") {
      public Item getTabIconItem () {
         return ModItems.AN_ITEM;
      }
   };
}

 

I don't need it to place it in one of FML's initialization events.

 

Maybe try that and see if it fixes your problem.

 

 

Not having your creative tab defined in an anonymous inner class in your main class definitely isn't the problem.  Frankly I think having a creative tab in main in an anonymous inner class is messy and should be avoided...and as far as I can tell it was a trend started by tutorial writers.  Big surprise there.

 

 

And god forbid you want to start manually ordering your items/blocks, suddenly your creative tab's anonymous inner class is bigger than the rest of the main class several times over.

Posted

diesieben07 is right, I was just initializing things in the wrong order, since I just initialized everything as I worked on it. Thanks, that would have taken a long time for me to notice.

Lord Volkihar has requested that I send the following message to everyone who is gifted, intellectually or artistically:

We hope that some people could help us share an epic tale of lord Volkihar's achievements and magnificent life. we plan to do this through modern media such as books, games, and mods.

For lost details, we are looking for around 5 gallons of Cortexiphan, and some N.Z.T.(around 50 pills) also, if you happen to know how to create a gel with the same density as human flesh, but low viscosity and adhesion, recipes would be appreciated.

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.