Posted October 30, 201212 yr Where would I find reference to half-slabs to use in crafting recipes? I can only find wooden and stone in block.java
October 30, 201212 yr 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.
October 30, 201212 yr Author 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) });
October 30, 201212 yr new Itemstack(Block.whatever.blockID, metadata) instead of Block.whatever I like collars. XP
October 30, 201212 yr Author 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 });
October 31, 201212 yr i believe if you set meta data to -1 it will except any of that block id. but don't quote me on that.
October 31, 201212 yr Author I thought that was the case too, but I tried -1 and it seems to create its own meta block with the default texture
November 1, 201212 yr 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.
November 1, 201212 yr Author 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
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.