Jump to content

[SOLVED][1.4.2] 6.0.1 Noob question regarding Half-slabs


XxArchangelz

Recommended Posts

I think it uses Metadata... so stone is actually stone, brick and cobble, while wood covers all 4 types of wood.

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

Link to comment
Share on other sites

I figured it was meta data, I just haven't the slightest clue as to how to access it in my code as well as not modifying base classes. My code is bellow but it only works with the original wood planks/steps. I am trying to give the user a way to craft slabs/stairs back into the original materials given they have the required amount.

 

 

 

ItemStack StackSlab = new ItemStack(Block.woodSingleSlab);

GameRegistry.addShapelessRecipe(new ItemStack(Block.planks, 3, 0),

new Object[] {

new ItemStack(Block.woodSingleSlab), (Block.woodSingleSlab), (Block.woodSingleSlab),

(Block.woodSingleSlab), (Block.woodSingleSlab), (Block.woodSingleSlab)

});

 

 

Link to comment
Share on other sites

Thank you so much. Now is there a way to apply this to multiple variables (oak spruce etc.) without having to make multiple recipes

 

ItemStack SlabStack = new ItemStack(Block.woodSingleSlab.blockID, 1, 0);

GameRegistry.addShapelessRecipe(new ItemStack(Block.planks.blockID, 3, 0),

new Object[] {

SlabStack, SlabStack, SlabStack, SlabStack, SlabStack, SlabStack

});

 

Link to comment
Share on other sites

Using -1 will allow any Metadata to be used in the recipe, but it will probably not give you the correct wood blocks....

 

But you could add the recipes in a simple for loop.

 

for(int i = 0; i <= 3; i++) {
      GameRegistry.addShapelessRecipe(new ItemStack(Block.planks, 3, i),
            new Object[] {
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i),
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i)
            });
}

that should work.

Link to comment
Share on other sites

Using -1 will allow any Metadata to be used in the recipe, but it will probably not give you the correct wood blocks....

 

But you could add the recipes in a simple for loop.

 

for(int i = 0; i <= 3; i++) {
      GameRegistry.addShapelessRecipe(new ItemStack(Block.planks, 3, i),
            new Object[] {
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i),
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i)
            });
}

that should work.

THE FOR LOOP! Why didn't I think of that. Thank you so much

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.