Help with energy sources.

  • Hi,
    I am working on an addon that generates certain ores that can be smelted into gems. These gems have electromagnetic properties and put into a special generator can create energy for IC2. the problem is, i am struggling set the gems as a power source... i have opted to start again from scratch.


    after looking at the API wiki and finding it extremely vague, then i was hoping someone would be kind enough to show me how to turn it into a power source... if anyone can help they will be credited in the addon.


    the source for the gem itself is here:
    http://pastebin.com/iwNBAxAE



    what do i need to add to this from the API to make it emit power when placed into an IC2 generator.


    Thanks in advance!

  • 1 suggestion: You should probably use Forge instead of Modloader if you are trying to integrate with IC2.


    1 question: What exactly are you trying to do? Are you trying to make a new generator or add a fuel value to an existing one?

    Is the answer to this question no?


    Quote

    Hey don't take it so hard. Ignorance is part of this generation it seems. -the wise words of XFmax-o-l

  • 1 suggestion: You should probably use Forge instead of Modloader if you are trying to integrate with IC2.


    1 question: What exactly are you trying to do? Are you trying to make a new generator or add a fuel value to an existing one?

    Basically i used MCreator to generate the basic block template (coz im really lazy not coz i cant do it) and that builds the mod for forge!


    secondly, I want to be able to use my gem like a lapotron crystal or battery...on a seperate note i need one of my gems however i need to be infinite. would i give it a value of -1 if i want it infinite?

  • There's a mod that makes an infinite "battery" here


    I believe he implements IElectricItem from the API.

    Is the answer to this question no?


    Quote

    Hey don't take it so hard. Ignorance is part of this generation it seems. -the wise words of XFmax-o-l

  • There's a mod that makes an infinite "battery" here


    I believe he implements IElectricItem from the API.

    Thats erm, great? but that's completely not what I asked for... I have Thaumcraft on my server along with IC2 BC BC/IC2 Crossover and UE and tonnes of other stuff. I liked the lapotron crsytal and felt that with the "mystical and magical" theme from thaumcraft on the server that magic gems that could power stuff would be awesome so i want to make a whole array of gems that generate that can power the machines.


    I am a little bit of a scriptkiddie more than a hardened Dev, This is my first MC mod so just saying "he implements IElectricItem" isnt particularly useful as the wiki is comepletely vague on what is required to implement that hook... I was kind of hoping someone could tell me how to implement that hook?


    if i just wanted infinite power i would add a custom recipe so that and empty battery on a workbench made a full battery and set up an ejector belt from BC with some redstone from an MFSU when full, invert that output and send the signal to the ejector belt which feeds the autocrafting table to turn empty batt to full and pump it back into the MFSU


    Is nobody able to help me with this??

    • Official Post

    In your state, no. You really have to start to learn coding with Java.
    Make a little mod, then advance to Forge and then try using the IC2 API to implement your idea. It's not like someone eats a bowl of letter soup and craps out a completely bugfree fully compatible mod doing what you've wanted it to do.

  • In your state, no. You really have to start to learn coding with Java.
    Make a little mod, then advance to Forge and then try using the IC2 API to implement your idea. It's not like someone eats a bowl of letter soup and craps out a completely bugfree fully compatible mod doing what you've wanted it to do.

    Ok i am not being funny but i am not completely retarded... i do know java, this is just my first MINECRAFT MOD, also for the LAST TIME i AM using forge... and thirdly if you want to see what i am doing please take a look at my new pastebin which compiles with no errors or warnings but still doesn't generate power in an MFSU etc, i realised i probably need to implement ITileEntity or something but like i say, first MC mod, first IC2 addon... so just need a little guidance, i have actually used java for quite a lot... a little bit sick of being told that i dont know what i am doing. if it carries on i will just got for Universal Electricity instead, their community is much more supportive...


    my new pastebin:
    http://pastebin.com/c00g7fsY


    Also, NO TELLING ME to clean up the imports, i will do this, its messy because MCreator generated the initial gem code (saves about 30mins of work QUOTE FROM OP "Because I am lazy, not because i can't do it")


    Please just focus on what i am missing to make it act like a battery (in this case preferably an infinite one, but i have made about 17 different ores and gems, all work and all generate in chunks, just the IC2 part isn't working)

  • Quote

    i realised i probably need to implement ITileEntity or something but like i say, first MC mod, first IC2 addon...


    Most (if not all) blocks that deal with 'power' are going to be TileEntities, and not just 'Blocks'. The way that EU is sent around and managed is a bit of a hack with metadata values. However, since I don't have the 9 years of expertise that you have, I can't give you a decisive answer as to how it specifically calls those functions...


    And I don't know if MCreator will make the appropriate adjustments into this as requested. You may have to end up using an Eclipse workspace to apply this functionality...

    Would anyone like to try a Slowpoke Tail?! Only 1 Million Yen!


    Quote

    this isn't about arrogance or ego, I have a block that I put a lot of freaking work into


    Every Mod Author, in existence. And yet, you STILL say otherwise.

  • Most (if not all) blocks that deal with 'power' are going to be TileEntities, and not just 'Blocks'. The way that EU is sent around and managed is a bit of a hack with metadata values. However, since I don't have the 9 years of expertise that you have, I can't give you a decisive answer as to how it specifically calls those functions...


    And I don't know if MCreator will make the appropriate adjustments into this as requested. You may have to end up using an Eclipse workspace to apply this functionality...

    Thanks, yeah i am in the process of implementing TileEntities but documentation is a little sparse. I think there is a little bit of a misunderstanding in my posts above... i am not using MCreator to make the mods... I created my png's then used MCcreator to make the sprite map, and the blocks/items, textured through MCreator then after that was all compiled i took the .java files, moved them to my dedicated MCP/forge folder and added them to the source destination and then am working on adding the API hooks in eclipse... i was just saying that because i used MCreator to create the block entries and items themselves the imports are messy because MCreator is retarded.


    thanks though.

  • You didn't implement IElectricItem...

    Is the answer to this question no?


    Quote

    Hey don't take it so hard. Ignorance is part of this generation it seems. -the wise words of XFmax-o-l

  • You didn't implement IElectricItem...

    HAHA! YIKES! I have an 11 month old puppy who keeps running over my laptop and he messed stuff up earlier i thought i fixed it looks like i missed that! it is way too late to be doing this will fix it in the morning XD


    THANKS! that was a dumb moment!

  • I re-implemented it... BUT
    Basically this is the full code:
    http://pastebin.com/DSE6mZwQ



    and the bit of code i am using to implement IElectricItem is:

    Quote

    public class mod_plasmariteGem extends BaseMod
    implements IElectricItem{


    Am i doing that right? because it gives me 1 error on recompilation saying Symbol cannot be found and points the the 'I' of IElectricItem


    what is all that about. i cant help but feel that the light is at the end of the tunnel

    oddly if i remove that implementation and leave the "public interface IElectricItem" further down it compiles fine but still doesnt accept my gem as a battery...


    The implentation of this is literally the last hurdle to my mod.

  • Uhhh, yeahh, implements belongs to an object, not your class, so static class ItemplasmariteGem extends Item implements IElectricItem should work.

    Is the answer to this question no?


    Quote

    Hey don't take it so hard. Ignorance is part of this generation it seems. -the wise words of XFmax-o-l

  • Uhhh, yeahh, implements belongs to an object, not your class, so static class ItemplasmariteGem extends Item implements IElectricItem should work.

    haha i was so tired last night i realised my mistake at about 1.15am and tried to edit my post on here to say i realised my mistake but everything is a little blurry, looks like i never edited it in the end!


    Now i am awake and fresh i will see if i am more successful


    thanks

  • OK now its a fresh new day, i got it all down nice and quickly, implemented IElectricItem on the Item not the class, added in the charged/empty ID's and it works lovely, MFSU accepts it as a power source and will charge it.


    I guess now i need to make this one infinte!


    Thanks for all your help guys, really appreciate it!