XxArchangelz Posted October 30, 2012 Posted October 30, 2012 Where would I find reference to half-slabs to use in crafting recipes? I can only find wooden and stone in block.java Quote
LordFokas Posted October 30, 2012 Posted October 30, 2012 I think it uses Metadata... so stone is actually stone, brick and cobble, while wood covers all 4 types of wood. Quote 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.
XxArchangelz Posted October 30, 2012 Author Posted October 30, 2012 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) }); Quote
gravitythief Posted October 30, 2012 Posted October 30, 2012 new Itemstack(Block.whatever.blockID, metadata) instead of Block.whatever Quote I like collars. XP
XxArchangelz Posted October 30, 2012 Author Posted October 30, 2012 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 }); Quote
OpposingForces Posted October 31, 2012 Posted October 31, 2012 i believe if you set meta data to -1 it will except any of that block id. but don't quote me on that. Quote
XxArchangelz Posted October 31, 2012 Author Posted October 31, 2012 I thought that was the case too, but I tried -1 and it seems to create its own meta block with the default texture Quote
founderio Posted November 1, 2012 Posted November 1, 2012 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. Quote
XxArchangelz Posted November 1, 2012 Author Posted November 1, 2012 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 Quote
Recommended Posts
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.