Killjoy0593 Posted November 24, 2013 Posted November 24, 2013 I've Been trying to fix this a while now and nothing works, Can somebody please tell me what im doing wrong as to why the name wont show? Main Class package Adobe; import net.minecraft.block.Block; import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemSlab; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="AdobeInfo.ID", name="AdobeInfo.NAME", version="AdobeInfo.VERS") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class AdobeBlock { public final static Block AdobeClayBlock = new AdobeClayBlock(500, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("AdobeBlock").setCreativeTab(CreativeTabs.tabBlock).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_block"); public final static Block AdobeHalfSlab = new AdobeHalfSlab(501, false, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("AdobeHalfSlab").setCreativeTab(CreativeTabs.tabBlock).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_block"); public final static Block AdobeHalfSlabDouble = new AdobeHalfSlab(502, true, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("AdobeHalfSlabDouble").setCreativeTab(CreativeTabs.tabBlock).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_block"); public final static Block AdobeStair = new AdobeStair(503, AdobeBlock.AdobeClayBlock, 0).setUnlocalizedName("AdobeStair"); public final static Item AdobeBrick = new AdobeBrick(504).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_brick"); public final static Item AdobeMixture = new AdobeMixture(505).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_mixture"); // The instance of your mod that Forge uses. @Instance("AdobeBlock") public static AdobeBlock instance; // Says where the client and server 'proxy' code is loaded. @SidedProxy(clientSide="Adobe.client.ClientProxy", serverSide="Adobe.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method } @EventHandler public void load(FMLInitializationEvent event) { proxy.registerRenderers(); GameRegistry.registerItem(AdobeBrick, "AdobeBrick"); LanguageRegistry.addName(AdobeBrick, "Adobe Brick"); GameRegistry.registerItem(AdobeMixture, "AdobeMixture"); LanguageRegistry.addName(AdobeMixture, "Adobe Mixture"); GameRegistry.registerBlock(AdobeClayBlock, "AdobeClayBlock"); LanguageRegistry.addName(AdobeClayBlock, "Adobe Brick"); MinecraftForge.setBlockHarvestLevel(AdobeClayBlock, "pickaxe", 0); GameRegistry.registerBlock(AdobeHalfSlab, "AdobeHalfSlab"); LanguageRegistry.addName(AdobeHalfSlab, "Adobe Brick Half Slab"); MinecraftForge.setBlockHarvestLevel(AdobeHalfSlab, "pickaxe", 0); GameRegistry.registerBlock(AdobeHalfSlabDouble, "AdobeHalfSlabDouble"); LanguageRegistry.addName(AdobeHalfSlabDouble, "Adobe Brick Double Slab"); MinecraftForge.setBlockHarvestLevel(AdobeHalfSlabDouble, "pickaxe", 0); ItemStack DirtStack = new ItemStack(Block.dirt); ItemStack SandStack = new ItemStack(Block.sand); ItemStack WaterBucket = new ItemStack(Item.bucketWater); ItemStack AdobeMixtureSingle = new ItemStack(AdobeBlock.AdobeMixture); ItemStack AdobeMixtureStack = new ItemStack(AdobeBlock.AdobeMixture, 32); ItemStack AdobeBrick = new ItemStack(AdobeBlock.AdobeBrick); ItemStack AdobeClayBlock = new ItemStack(AdobeBlock.AdobeClayBlock); ItemStack AdobeHalfSlab = new ItemStack(AdobeBlock.AdobeHalfSlab); GameRegistry.addRecipe(AdobeMixtureStack, "yxx", "yzx", "yyx", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "xxx", "yzx", "yyy", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "xxx", "xzy", "yyy", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "xxy", "xzy", "xyy", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "xyy", "xzy", "xxy", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "yyy", "xzy", "xxx", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "yyy", "yzx", "xxx", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); GameRegistry.addRecipe(AdobeMixtureStack, "yyx", "yzx", "yxx", 'x', DirtStack, 'y', SandStack, 'z', WaterBucket); //Stairs ItemStack AdobeStairStack = new ItemStack(AdobeBlock.AdobeStair, 4); GameRegistry.registerBlock(AdobeStair, "AdobeStair"); LanguageRegistry.addName(AdobeStair, "Adobe Brick Stairs"); MinecraftForge.setBlockHarvestLevel(AdobeStair, "pickaxe", 0); GameRegistry.addRecipe(AdobeStairStack, " x", " xx", "xxx", 'x', AdobeClayBlock); GameRegistry.addSmelting(AdobeBlock.AdobeMixture.itemID, AdobeBrick, 0.3F); GameRegistry.addRecipe(AdobeClayBlock, "xx", "xx", 'x', AdobeBrick); } @EventHandler public void postInit(FMLPostInitializationEvent event) { Item.itemsList[AdobeBlock.AdobeHalfSlab.blockID] = new ItemSlab(AdobeBlock.AdobeHalfSlab.blockID - 256, (BlockHalfSlab)AdobeBlock.AdobeHalfSlab, (BlockHalfSlab)AdobeBlock.AdobeHalfSlabDouble, false).setUnlocalizedName("AdobeHalfSlab"); LanguageRegistry.instance().addStringLocalization(((Adobe.AdobeHalfSlab)AdobeBlock.AdobeHalfSlab).getFullSlabName(0)+".name", "AdobeHalfSlab"); } } Slab Class package Adobe; import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.material.Material; public class AdobeHalfSlab extends BlockHalfSlab { public AdobeHalfSlab(int par1, boolean par2, Material par3Material) { super(par1, par2, par3Material); this.useNeighborBrightness[blockID] = true; } @Override public String getFullSlabName(int i) { return null; } } Result Quote
saxon564 Posted November 25, 2013 Posted November 25, 2013 take public final static Block AdobeHalfSlab = new AdobeHalfSlab(501, false, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("AdobeHalfSlab").setCreativeTab(CreativeTabs.tabBlock).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_block"); and change the texture name to something like (AdobeInfo.Test.toLowerCase() + ":adobe_block") and see what the name says, my guess is that the name showing is coming from that section for some reason. Quote
superckl Posted November 25, 2013 Posted November 25, 2013 Have you tried not returning null in getSlabFullName? Maybe return the unlocalized name of the block? Quote http://i.imgur.com/nVI9Y.png[/img]
superckl Posted November 25, 2013 Posted November 25, 2013 Actually I just found your problem. In your postInit, you do this: LanguageRegistry.instance().addStringLocalization(((Adobe.AdobeHalfSlab)AdobeBlock.AdobeHalfSlab).getFullSlabName(0)+".name", "AdobeHalfSlab"); notice you do getSlabFullName, when you have that method overridden to return null. Try removing this line and see what happens. Quote http://i.imgur.com/nVI9Y.png[/img]
Killjoy0593 Posted November 25, 2013 Author Posted November 25, 2013 Thanks, This Was The Full Code When I Fixed All Issues. The Name And Not Getting The Slab When Middle Clicking. package Adobe; import net.minecraft.block.Block; import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.material.Material; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class AdobeHalfSlab extends BlockHalfSlab { public AdobeHalfSlab(int par1, boolean par2, Material par3Material) { super(par1, par2, par3Material); this.useNeighborBrightness[blockID] = true; } @Override public String getFullSlabName(int i) { return (AdobeInfo.NAME.toLowerCase() + ":adobe_block"); } @SideOnly(Side.CLIENT) private static boolean isBlockSingleSlab(int par0) { return par0 == AdobeBlock.AdobeHalfSlab.blockID; } /** * Returns the slab block name with step type. */ public int getDamageValue(World par1World, int par2, int par3, int par4) { return super.getDamageValue(par1World, par2, par3, par4) & 7; } public int idPicked(World par1World, int par2, int par3, int par4) { return isBlockSingleSlab(this.blockID) ? this.blockID : (this.blockID == AdobeBlock.AdobeHalfSlabDouble.blockID ? AdobeBlock.AdobeHalfSlab.blockID : (this.blockID == Block.woodDoubleSlab.blockID ? Block.woodSingleSlab.blockID : Block.stoneSingleSlab.blockID)); } } Quote
superckl Posted November 25, 2013 Posted November 25, 2013 First, try adding an @Override to your idPicked method to make sure it's properly overridden. If it is, I can tell you isBlockSingleSlab(this.blockID) is returning false for your half slab. Why, I have no idea. Try changing up what you return in idPicked and see what happens. Quote http://i.imgur.com/nVI9Y.png[/img]
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.