Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to sub forum page

General forum

Non-course related subjects

4. Mod discussion

Block Madness

  • 2013-08-02 16:54:53
    Today, I started developing my mod that I have always wanted to make. However, the problem that I foretold has came up. The mod is based around thaumcraft's aspects, allowing you to infuse different aspects into blocks which then inturn effect the nature the block. So lux in a block would cause it to emit light.

    Now the problem is obvious, how do I make all the blocks with all the possibilities, with out registering each and every block. I have no clue how to go about start this. So was wondering if anyone will be able to give their view on this and what could possibly fix this.

    It's been driving me insane not knowing what do. So any help will be hugely appreciated.
  • 2013-08-02 18:42:18
    You could, for example, look at the code of the vanilla redstone lamp and look how it emits light under certain conditions. Then use that in combination with the flux values stored in a block ;)
  • 2013-08-02 18:45:29
    Yh, I know. But thats not what I am talking about. The problem is all the blocks themselves, how to handle them without making each and every block and taking up 1000's (which it will be, if I was insane enough to try that).
  • 2013-08-02 18:56:53
    I remember hearing about the fact that tile entities being able to hold metadata. How does it work?
  • 2013-08-02 19:35:39
    A tilentity can just store variables as every block has it's own tilentity instance. Just don't forget to read/write them from the save file.
  • 2013-08-02 22:22:06
    Exactly, just use a block with a tile entity. Then store the required information in that tile entity. One id but an infinite sub blocks (well, almost).
  • 2013-08-02 22:39:24
    Hmmm... how would one do this though.
  • 2013-08-03 02:29:33
    i don't think there is an easy way to set different light level for blocks with same id. you need different id for blocks with different light level.

    as for the textures and other information about the block, you can just store it in the tile entity.
  • 2013-08-03 08:30:45
    Indeed, the light thingy might be an issue, but apart from that everything is explained in the TileEntity lecture. How to store and save data, how to synchronize it as well as displaying different textures depending on the tile entity.

    Give it another watch and you might get a better idea.
  • 2013-10-21 16:33:04
    Probably also reading the BlockRegistry and looping through every Block would help
  • Log in or sign up to reply to this thread