Jump to content

Need help with coding a MultiBlock


greiko5

Recommended Posts

I have searched all over the forums and the internet and i have not found any tutorials on how to code a multiblock.

 

I want to create a multiblock that is made out of several different blocks and when it is fully built it will form into a techne model that i have.

Can anyone help me with this, im desperate for help.

Link to comment
Share on other sites

I'm codding using multiBlocks and multiItems too and is hard to find anything without asking in forums. The Forge Wiki has a simple tutorial to get started, but it does not cover all you need to do such as Textures and Display names.

 

http://www.minecraftforge.net/wiki/Metadata_Based_Subblocks

 

I created the methods below in my Mod Class for MultiBlocks and MultiItems' display Names :

 

 

public void registerMultiBlock(Block block, String unlocalizedName, String[] name) {

 

GameRegistry.registerBlock(block, MetalItemBlock.class, unlocalizedName);

 

for (int id = 0; id < name.length; id++) {

 

ItemStack blockItemStack = new ItemStack(block, 1, id);

LanguageRegistry

.addName(blockItemStack, name[blockItemStack.getItemDamage()]);

 

}

}

 

public void registerMultiItemNames(Item item, String[] name) {

 

for (int id = 0; id < name.length; id++) {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack, name[itemStack.getItemDamage()]);

 

}

 

}

 

 

 

 

... and this method for a complex MultiItems names:

 

 

public void registerMultiItemMetalsNames(Item item, String[] ingotsNames,

String[] nuggetsNames, String[] dustsNames) {

 

for (int id = 0; id < ingotsNames.length + nuggetsNames.length

+ dustsNames.length; id++) {

 

if (id < ingotsNames.length) {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack,

ingotsNames[itemStack.getItemDamage()]);

 

} else if (id < ingotsNames.length + nuggetsNames.length) {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack,

nuggetsNames[itemStack.getItemDamage() - ingotsNames.length]);

 

} else {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack, dustsNames[itemStack.getItemDamage()

- ingotsNames.length - nuggetsNames.length]);

 

}

}

 

}

 

 

 

Currently, I'm learning how to add different Textures for subBlocks, as soon as I figure out how to do I'll post it here.

Link to comment
Share on other sites

I'm codding using multiBlocks and multiItems too and is hard to find anything without asking in forums. The Forge Wiki has a simple tutorial to get started, but it does not cover all you need to do such as Textures and Display names.

 

http://www.minecraftforge.net/wiki/Metadata_Based_Subblocks

 

For Display Names, I created the method below in my Mod Class:

 

 

public void registerMultiItemMetalsNames(Item item, String[] ingotsNames,

String[] nuggetsNames, String[] dustsNames) {

 

for (int id = 0; id < ingotsNames.length + nuggetsNames.length

+ dustsNames.length; id++) {

 

if (id < ingotsNames.length) {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack,

ingotsNames[itemStack.getItemDamage()]);

 

} else if (id < ingotsNames.length + nuggetsNames.length) {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack,

nuggetsNames[itemStack.getItemDamage() - ingotsNames.length]);

 

} else {

 

ItemStack itemStack = new ItemStack(item, 1, id);

LanguageRegistry.addName(itemStack, dustsNames[itemStack.getItemDamage()

- ingotsNames.length - nuggetsNames.length]);

 

}

}

 

}

 

 

 

Currently, I'm learning how to add different Textures for subBlocks, as soon as I figure out how to do I'll post it here.

I think that isn't what he wanted, i think he wants something like the RailCraft tanks.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I think that isn't what he wanted, i think he wants something like the RailCraft tanks.

 

Sorry for my mistake :)

 

I found a good youtube tutorial series but I haven't watch the episode about Multiblock structures yet. If you want to check, here is the link:

 

 

 

Link to comment
Share on other sites

Sorry for my mistake :)

 

I found a good youtube tutorial series but I haven't watch the episode about Multiblock structures yet. If you want to check, here is the link:

 

 

 

I've already looked at those tutorials and he uses a program he created to code the multiblocks, however the programs download does not work .

Im trying to make a multiblock similar to railcraft coke ovens rather than tanks because mine is going to have a fixed shape and size, and as i said i want it to render a techne model when completed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.