Jump to content

Recommended Posts

Posted

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

1051ro7.png

Posted

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.

Posted

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.

Posted

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));
    }

}

Posted

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • UPDATE: this seems to be an Arch-specific issue. Switching to Ubuntu server fixed EVERYTHING.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.