its as simple as that. it does have some requirements, the constructor of your item class will have to initialize everything, e.g. this.setUnlocolizedName("thing"); this.setTexture(MODID + ":thing");
next, loading entities are planned. also if anyone can think of other variable arguments that you normaly pass to your items, let me know, and i will see if they can be passed this way.
you can download the api here.
you can view the source, and so how to use it here.
this is not a mod, this is a modding tool for modders.
you do not have to use it, i found it useful, and added it to this forum in the hope that it stop the same annoyance i had with this, for someone else.
I like it. It's a very nice, and interesting idea.
I probably won't use this in the future, but if I do I'll have to make my own from scratch.
thank you, i met with allot of resistance with various people in forge and sponge ircs trying to get this to work. "stop it with the tom foolery"
probably best you make your own, i don't know how efficient this is.
thank you, i met with allot of resistance with various people in forge and sponge ircs trying to get this to work. "stop it with the tom foolery"
probably best you make your own, i don't know how efficient this is.
Taking a look at it right now, you're not enabling it to have much flexibility with the instances. I think you could try calling a new instance of the class instead of the constructor?
Taking a look at it right now, you're not enabling it to have much flexibility with the instances. I think you could try calling a new instance of the class instead of the constructor?
ok, iv just done that with the "getRaw method", saw i made a mistake with that one anyway.
i guess i should have a getClassInfo : Classinfo function, so people can instantiate it how they like too if they want. then its not limited to items, entities or single constructors etc.
it allows you to automatically import all items or mobs within a package/folder, without the mod having to know they exist, no more:
public static Item item2;
public static Item item3;
public static Item item4;
public static Item item5;
public static Item item6;
public static Item item7;
public static Item item8;
public static Item item9;
public static Item item10;
public static Item item11;
public static Item item12;
public static Item item13;
public static Item item14;
public static Item item15;
public static Item item16;
public static void preinit(FMLPreInitalizationEvent event) {
item1 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item2 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item3 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item4 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item5 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item6 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item7 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item8 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item9 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item10 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item11 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item12 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item13 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item14 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item15 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
item16 = new Item().setUnlocolizedName().setCreativeTab(this.creativetab);
GameRegistry.registerItem(item1, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item2, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item3, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item4, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item5, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item6, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item7, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item8, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item9, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item10, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item11, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item12, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item13, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item14, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item15, item1.getUnlocolizedname.replace("item."),"")
GameRegistry.registerItem(item16, item1.getUnlocolizedname.replace("item."),"")
}
no. this API alows you to replace all that mess with just a couple of lines:
public void preinit(FMLPreInitializationEvent event)
{
CLAPI clap = new CLAPI();
items = clap.getItems("nz.co.crookedhill.items");
registerItems(items);
}
private void registerItems(Map<string, item="">items)
{
for(Map.Entry<string, item=""> entry : items.entrySet())
{
GameRegistry.registerItem(entry.getValue(), entry.getKey());
}
}
next, loading entities are planned. also if anyone can think of other variable arguments that you normaly pass to your items, let me know, and i will see if they can be passed this way.
you can download the api here.
you can view the source, and so how to use it here.
this is not a mod, this is a modding tool for modders.
you do not have to use it, i found it useful, and added it to this forum in the hope that it stop the same annoyance i had with this, for someone else.
I probably won't use this in the future, but if I do I'll have to make my own from scratch.
thank you, i met with allot of resistance with various people in forge and sponge ircs trying to get this to work. "stop it with the tom foolery"
probably best you make your own, i don't know how efficient this is.
Taking a look at it right now, you're not enabling it to have much flexibility with the instances. I think you could try calling a new instance of the class instead of the constructor?
ok, iv just done that with the "getRaw method", saw i made a mistake with that one anyway.
i guess i should have a getClassInfo : Classinfo function, so people can instantiate it how they like too if they want. then its not limited to items, entities or single constructors etc.