Help with Multiblocks?

Discussion in 'Mod Development' started by jordsta95, Nov 16, 2014.

  1. jordsta95

    jordsta95 New Member

    I think the title sorta says all I have to say.
    I'm looking to create a 3x3x3 multiblock (because multiblocks are cool, don't judge me) that I will be using as what will essentially be a furnace/pulverizer combo (e.g. 1 iron or cooks into 2 ingots)
    Anyway, there isn't really any good "noob friendly" documentation on multiblocks, that I can find, and I was wondering if anyone knew of either a place to direct someone who has very little modding experience, or would be willing to choose their death sentence and actually help me...
  2. Strikingwolf

    Strikingwolf New Member

    It is very easy to create a multi block sec while I grab some code.
  3. Strikingwolf

    Strikingwolf New Member

  4. InfinityRaider

    InfinityRaider New Member

  5. Strikingwolf

    Strikingwolf New Member

    yep :p
  6. jordsta95

    jordsta95 New Member

    Not gonna lie, I am a BIT of an idiot, and have no idea what this means:
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){
    Why can't minecraft just use words and not functions :(
  7. Strikingwolf

    Strikingwolf New Member

    That's a side-effect of deobsufucation. Forge can't get all the original function names. Also, just a side-effect of MC being coded kinda terribly (spaghetti code). That is just something you probably won't have to do...Santa's TileEntity was acting weird so I had to copy over the super functions instead of calling them. If you want you can just copy those, it won't make a difference.
  8. jordsta95

    jordsta95 New Member

    /me doesn't know what she's doing....
    Time to just put it all in, change some names, and see if it works XD
  9. Strikingwolf

    Strikingwolf New Member

    Here's what you need to understand. Whenever the entity is updated we check the blocks around it to see what they are. If they match the blocks we want we proceed to form the multiblock. There done
  10. jordsta95

    jordsta95 New Member

    so this wouldn't work for a multiblock like

    {} represents a layer, numbers represent blocks
    Or would it?
  11. Strikingwolf

    Strikingwolf New Member

    It would, you just check for different blocks. For example I think ours was something like
    You just get the middle bottom block (in bold) to create the tileEntity (you could use any other block, but you would have to change the x,y,z value changes I do and things like that). Then you can just change the block names to your configuration (if you use that block multiple times in the structure it will still work, but it will hurt preformance)
  12. jordsta95

    jordsta95 New Member

    Well I am going to have 4 different possibilities... (I would probably have to register these as different multiblocks?)

    Like so:
    4x efficiency:

    3x efficiency

    2x efficiency:

    1x efficiency:

    Sorry about the noob questions, but you are dealing with a grade A noob
  13. Strikingwolf

    Strikingwolf New Member

    Different TileEntity[Something]Multiblocks and using some OR (||) things in the if statements of the first TileEntity
  14. Lumaceon

    Lumaceon Popular Member

    Honestly, there are tons of ways multi-blocks can be coded. What a "multi-block" is from a technical standpoint, is a tile entity that searches around itself every few update ticks for a valid pattern of blocks.

    The best way to make one is probably to have one "core" block that uses a tile entity to search for the pattern around it every second or so. Think about the Tinker's Construct smeltery: it has the controller block, which is responsible for recognizing and assembling "smeltery-valid" blocks around it.

    In my case, I made a large array of offsets (represented by my class called BlockData) and I have the tile entities loop through these offsets. It could be done more mathematically, but I prefer doing it this way seeing as I'm not the most mathematically brilliant. While my tile entity uses this to place blocks, you could just as easily replace the metadata with a "blocktype" and have the tile entity check for equality.

    BlockData Class
    Block Patterns
    Tile Entity

    The result is this pattern of blocks:
    1SDAN and VapourDrive like this.
  15. immibis

    immibis New Member

    Remember that there is nothing special about multiblocks - they're just blocks that act differently if they have certain other blocks around them. There is no built-in support in Forge or Minecraft for them.
    1SDAN, Padfoote and SatanicSanta like this.
  16. Strikingwolf

    Strikingwolf New Member

    1SDAN likes this.
  17. SkeletonPunk

    SkeletonPunk New Member

    Off topic: Holy god, those textures are amazing
    1SDAN and SatanicSanta like this.
  18. kaisauerstein14

    kaisauerstein14 New Member

  19. Gideonseymour

    Gideonseymour Relatable Gamer Trusted User Retired Staff

    I don't think you meant to post this here. Maybe you were looking for the Introductions section?
    1SDAN, VapourDrive, Padfoote and 2 others like this.

Share This Page