Posted April 4, 20169 yr I have made a custom Slab and Double slab, but it seems, when in Creative mode, and one middle-clicks it on an empty slot, it gives me a Stone Slab, instead of my Block. This is my ItemSlab Code package com.strebornella.adrtwo.blocks.slabs.compressed; import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.item.ItemSlab; public class CCobblestone_ItemSlab extends ItemSlab { public CCobblestone_ItemSlab(Block block){ super(block, (BlockSlab)CCobblestone_Slabs.ccslab, (BlockSlab)CCobblestone_Slabs.ccDoubleSlab, false); setHasSubtypes(true); } } and this is the Slab code package com.strebornella.adrtwo.blocks.slabs.compressed; import java.util.Random; import com.strebornella.adrtwo.StringRefs; import com.strebornella.adrtwo.tabs.creative.ADRTabs; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; public class CCobblestone_Slabs extends BlockSlab{ public CCobblestone_Slabs(boolean isDouble, Material material) { super(isDouble, material); setLightOpacity(0); useNeighborBrightness = true; } public static Block ccslab; public static Block ccDoubleSlab; public static IIcon bottom; public static IIcon top; public static IIcon side1; public static IIcon side2; public static IIcon side3; public static IIcon side4; public static void mainRegistry(){ ccslab = new CCobblestone_Slabs(false, Material.rock) .setBlockName("compcobblestoneslab") .setHardness(20.0F) .setResistance(280.0F) .setCreativeTab(ADRTabs.adrBlocks) .setStepSound(soundTypeStone); ccslab.setHarvestLevel("pickaxe", 1); ccslab.isToolEffective("pickaxe", 1); ccDoubleSlab = new CCobblestone_Slabs(true, Material.rock) .setBlockName("compcobblestonedoubleslab") .setHardness(16.0F) .setResistance(240.0F) .setStepSound(soundTypeStone); ccDoubleSlab.setHarvestLevel("pickaxe", 1); ccDoubleSlab.isToolEffective("pickaxe", 1); GameRegistry.registerBlock(ccslab, CCobblestone_ItemSlab.class, ccslab.getUnlocalizedName()); GameRegistry.registerBlock(ccDoubleSlab, CCobblestone_ItemSlab.class, ccDoubleSlab.getUnlocalizedName()); } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister icon){ this.bottom = icon.registerIcon(StringRefs.MODID + ":comp/compressed_cobblestone"); this.top = icon.registerIcon(StringRefs.MODID + ":comp/compressed_cobblestone"); this.side1 = icon.registerIcon(StringRefs.MODID + ":compressed_cobblestone_slab_side"); this.side2 = icon.registerIcon(StringRefs.MODID + ":compressed_cobblestone_slab_side"); this.side3 = icon.registerIcon(StringRefs.MODID + ":compressed_cobblestone_slab_side"); this.side4 = icon.registerIcon(StringRefs.MODID + ":compressed_cobblestone_slab_side"); } @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int meta){ if (side == 0) return bottom; else if (side == 1) return top; else if (side == 2) return side1; else if (side == 3) return side2; else if (side == 4) return side3; else if (side == 5) return side4; else return bottom; } public Item getItemDropped(int meta, Random random, int fortune) { return Item.getItemFromBlock(ccslab); } protected ItemStack createStackedBlock() { return new ItemStack(Item.getItemFromBlock(ccslab), 2); } public String getFullSlabName(int par1) { return getUnlocalizedName(); } @Override public String func_150002_b(int par1) { return getFullSlabName(par1); } } Why this is happening, I don't know.
April 4, 20169 yr Override createStackedBlock for your Block class. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.