You are not logged in.

IC2 Experimental builds (jenkins):
v2.0/2.1/2.2 / 2.3 / 2.5 / 2.6 (For Minecraft 1.6.4/1.7.2/1.7.10 / 1.8.9 / 1.9.4 / 1.10)
IndustrialCraft² recent version: v1.117! (For Minecraft 1.5.2 → topic)

BuIlDaLiBlE

Really cool!

  • "BuIlDaLiBlE" is male
  • "BuIlDaLiBlE" started this thread

Posts: 23

Location: Moscow, Russia

  • Send private message

1

Thursday, February 4th 2016, 12:13am

Need help creating a little addon

Alright, so I've seen some tutorials on how to create a basic IElectricItem, but the info is out of date. A lot has changed in IC2exp. For example, getChargedItemId and getEmptyItemId are now just getChargedItem and getEmptyItem respectively, so I have no idea what to put in there. I just can't figure out the basic code that's required for an electric item. Can someone share knowledge with me?

2

Thursday, February 4th 2016, 8:31am

In getChargedItem() and getEmptyItem() you mostly want to return "this". This is just there for things like RE-Batteries, that have a different Item depending on if there is charge in the Item or not.
In general, the JavaDoc comments in the API are mostly up-to-date.
Check out my mods here.

BuIlDaLiBlE

Really cool!

  • "BuIlDaLiBlE" is male
  • "BuIlDaLiBlE" started this thread

Posts: 23

Location: Moscow, Russia

  • Send private message

3

Saturday, February 6th 2016, 9:30pm

Okay, thanks. Now I dunno what I should import to add my item to the IC2 creative tab list.

4

Saturday, February 6th 2016, 9:48pm

You should create your own Creative Tab.
Check out my mods here.

Speiger

TMT & IC2 Classic Dev

  • "Speiger" is male

Posts: 997

Location: Germany

  • Send private message

5

Saturday, February 6th 2016, 10:06pm

If it is only a 2-5 items mod then use the ic2 creative tab.. I mean why spamming Creativetabs...
If it is planned as big mod then you should do one of your own...
But if not get the creative tab from ic2

BuIlDaLiBlE

Really cool!

  • "BuIlDaLiBlE" is male
  • "BuIlDaLiBlE" started this thread

Posts: 23

Location: Moscow, Russia

  • Send private message

6

Saturday, February 6th 2016, 10:32pm

You should create your own Creative Tab.

Oh, okay. How do I add discharged and charged states of my item to the NEI then? Currently it is there without any metadata\damage value.

If it is only a 2-5 items mod then use the ic2 creative tab.. I mean why spamming Creativetabs...
If it is planned as big mod then you should do one of your own...
But if not get the creative tab from ic2

Exactly! As title states "little addon", I only plan on adding one item, lol.

BuIlDaLiBlE

Really cool!

  • "BuIlDaLiBlE" is male
  • "BuIlDaLiBlE" started this thread

Posts: 23

Location: Moscow, Russia

  • Send private message

7

Saturday, February 6th 2016, 11:45pm

For some reason when I try to use IC2 recipe manager game just crashes during loading throwing java.lang.NullPointerException: Initializing game. Maybe I'm doing something wrong? The recipe is shapeless, and works if I use forge's GameRegistry.

8

Sunday, February 7th 2016, 9:37am

Oh, okay. How do I add discharged and charged states of my item to the NEI then? Currently it is there without any metadata\damage value.
You can just override the getSubItems class and add the empty verdion of the item to the list and then you add another Item that you prepare in before with ElectricItemManager.charge() or something.
For some reason when I try to use IC2 recipe manager game just crashes during loading throwing java.lang.NullPointerException
You, as an addon creator, should know that ,in order to help you, we need a full crash log.
Check out my mods here.

Speiger

TMT & IC2 Classic Dev

  • "Speiger" is male

Posts: 997

Location: Germany

  • Send private message

9

Sunday, February 7th 2016, 10:59am

There is a simple list you can do.
1: Is Ic2 in your dev invioment?
2: Is in your mod declared that your mod has to load after IC2
3: Did you try to load recipes not on Preinit (init is the recipe state)
4: If that was the case what about post init.
5: If that still crashes do you have the right itemName? (If you access ic2 items)
6: If everything fails then push a crashlog.

This post has been edited 1 times, last edit by "Aroma1997" (Feb 7th 2016, 11:51am)


BuIlDaLiBlE

Really cool!

  • "BuIlDaLiBlE" is male
  • "BuIlDaLiBlE" started this thread

Posts: 23

Location: Moscow, Russia

  • Send private message

10

Sunday, February 7th 2016, 3:51pm

You, as an addon creator, should know that ,in order to help you, we need a full crash log.

Sorry for asking stupidest questions, but it's been a while since I was modding for Minecraft (1.2.5 to be sure), many things have changed since then. And as for IC2 API, it's completely new for me.

There is a simple list you can do.
1: Is Ic2 in your dev invioment?
2: Is in your mod declared that your mod has to load after IC2
3: Did you try to load recipes not on Preinit (init is the recipe state)
4: If that was the case what about post init.
5: If that still crashes do you have the right itemName? (If you access ic2 items)
6: If everything fails then push a crashlog.

1. Of course.
2. Yes.
3. I tried init and it wasn't working.
4. With Postinit it's now working, thanks!

This post has been edited 1 times, last edit by "BuIlDaLiBlE" (Feb 7th 2016, 3:57pm)


Speiger

TMT & IC2 Classic Dev

  • "Speiger" is male

Posts: 997

Location: Germany

  • Send private message

11

Sunday, February 7th 2016, 5:48pm

No problem.
If something crashes. Make yourself a list what could cause it. Even if it is something stupid. Put it on the list and try everything out. With that you can fix almost every bug...

estebes

The guy who said he was back although he wasn't actually back but might be back soon

    Portugal
  • Send private message

12

Sunday, February 7th 2016, 6:07pm

If it is your first ic2 addon you can look up some open source addons to see how stuff works and then go from there.
Here are some repos:
https://github.com/cpw/compactsolars
https://github.com/xbony2/Nuclear-Control
https://github.com/estebes/Gravitation-Suite-Reloaded

BuIlDaLiBlE

Really cool!

  • "BuIlDaLiBlE" is male
  • "BuIlDaLiBlE" started this thread

Posts: 23

Location: Moscow, Russia

  • Send private message

13

Sunday, February 7th 2016, 6:15pm

If it is your first ic2 addon you can look up some open source addons to see how stuff works and then go from there.
Here are some repos:
https://github.com/cpw/compactsolars
https://github.com/xbony2/Nuclear-Control
https://github.com/estebes/Gravitation-Suite-Reloaded

Yes, I did look up for some sources and they helped a lot. Very useful stuff. :thumbsup:

Counter:

Hits today: 30,780 | Hits yesterday: 29,849 | Hits record: 152,331 | Hits total: 65,294,144