failed to join an energy net when loading a world

  • i did a block using EU myself, but it was somewhere wrong:(
    in the tileentity part of my block, i do what i did in 189 version(in fact, i copy&paste my code)(which worked very well in the older version)
    but when i was trying to join a world, it went wrong because of a looped call.(when the block tried to join an energy net)
    here's my code:https://github.com/Kanbe-Kotor…tityAdvCraftingTable.java


    what's more, this block also has something wrong when rendering in the world... (although it seems to be my bad)


    PS: maybe you dont know that there is too few people making mods now in my country. Thus, i have no way to ask for help without your forum(actually its also the only place i know)
    i feel so sorry if my behavior(post a lot of threads) bothers you.
    (i hope you can understand what im saying for my english level's too bad...)

    • Official Post

    it went wrong because of a looped call.(when the block tried to join an energy net

    Do you have a crash report/log of this? The code itself looks ok, but onLoaded() should probably check if addedToEnergyNet is true before posting an energy load event.

    this block also has something wrong when rendering in the world... (although it seems to be my bad)

    That's from this line, you'll want to change it to

    Code
    return EnumBlockRenderType.MODEL;

    145 Mods isn't too many. 9 types of copper and 8 types of tin aren't too many. 3 types of coffee though?

    I know that you believe that you understood what you think I said, but I am not sure you realise that what you read was not what I meant.


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(


    I see this too much.

  • the problem of rendering solved successfully. thx:)


    however, the looped call problem is still unsolved:(


    i know the meaning of what you said, but in fact i determine whether it's addedToEnergyNet in the function intialize() when i try to call onLoaded()


    besides, there's no crashreport in my folder, for it doesn't crash anymore.


    ↓see this picture and you'll understand


    (these lines) just loop and loop, and continuously making hundreds of lines of report before my memory is used out. that really makes me so sad.

  • dont use validate function there is the TileEntity not added to the World yet...
    use onLoad() the function is basicly called after the TileEntity is added to the chunk.
    Best thing would be to add a even bigger delay and wait 1 tick to inject it.

  • dont use validate function there is the TileEntity not added to the World yet...
    use onLoad() the function is basicly called after the TileEntity is added to the chunk.
    Best thing would be to add a even bigger delay and wait 1 tick to inject it.

    yep you're right. i moved the call of onLoaded() func from validate() to update(), and it finally solved.


    thx a lot. :)


    btw, your english grammar is not so similar to what i've learned:( and it took me a long time to realize your real meaning(and i even understood a wrong meaning for a time)(and dealt a wrong way to solve my problem)