Help with Multiblocks?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

jordsta95

New Member
Jul 29, 2019
5,056
-4
1
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...
 
Not gonna lie, I am a BIT of an idiot, and have no idea what this means:
Code:
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){
readFromNBT(pkt.func_148857_g());
}
Why can't minecraft just use words and not functions :(
 
Not gonna lie, I am a BIT of an idiot, and have no idea what this means:
Code:
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){
readFromNBT(pkt.func_148857_g());
}
Why can't minecraft just use words and not functions :(
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.
 
/me doesn't know what she's doing....
Time to just put it all in, change some names, and see if it works XD
 
/me doesn't know what she's doing....
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
 
so this wouldn't work for a multiblock like

{111
121
111}
{131
323
131}
{111
121
111}
{} represents a layer, numbers represent blocks
Or would it?
 
so this wouldn't work for a multiblock like

{111
121
111}
{131
323
131}
{111
121
111}
{} represents a layer, numbers represent blocks
Or would it?
It would, you just check for different blocks. For example I think ours was something like
{111
222
232}
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)
 
It would, you just check for different blocks. For example I think ours was something like
{111
222
232}
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)
Well I am going to have 4 different possibilities... (I would probably have to register these as different multiblocks?)

Like so:
4x efficiency:
jbjGymC.png

gkHk9v0.png

3x efficiency
jbjGymC.png

9DRfUPC.png

2x efficiency:
9DRfUPC.png

WUWOoTZ.png

1x efficiency:
WUWOoTZ.png

TbtZzvo.png

Sorry about the noob questions, but you are dealing with a grade A noob
 
Well I am going to have 4 different possibilities... (I would probably have to register these as different multiblocks?)

Like so:
4x efficiency:
jbjGymC.png

gkHk9v0.png

3x efficiency
jbjGymC.png

9DRfUPC.png

2x efficiency:
9DRfUPC.png

WUWOoTZ.png

1x efficiency:
WUWOoTZ.png

TbtZzvo.png

Sorry about the noob questions, but you are dealing with a grade A noob
Different TileEntity[Something]Multiblocks and using some OR (||) things in the if statements of the first TileEntity
 
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:
9USIAXX.png
 
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.
 
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:
9USIAXX.png
Off topic: Holy god, those textures are amazing