Jump to content

[RESOLVED] Name for custom crafting table is tile.null.name in-game


bdkuhman

Recommended Posts

Can't really help without seeing your code.

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.

Link to comment
Share on other sites

Can't really help without seeing your code.

 

Main mod file:

package deconstruction.common;

import net.minecraft.block.Block;
import net.minecraft.block.BlockStone;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemReed;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
//import deconstruction.alchemy.BlockAlchemy;
//import deconstruction.alchemy.TileEntityStationAlchemy;
import deconstruction.deconTable.DeconstructionManager;

@Mod(modid="deconstruction", name="The Deconstruction Mod", version="1.2.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class mod_Deconstruction {
public static Block deconstructionTable;



// The instance of your mod that Forge uses.
@Instance("deconstruction")
public static mod_Deconstruction instance;

private GuiHandler guiHandler = new GuiHandler();
// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide="deconstruction.client.ClientProxy", serverSide="deconstruction.common.CommonProxy")
public static CommonProxy proxy;

@PreInit
public void preInit(FMLPreInitializationEvent event) {

}

@Init
public void load(FMLInitializationEvent event) {

	deconstructionTable = new BlockDeconstructionTable(600).setHardness(2.5F).setStepSound(Block.soundWoodFootstep);

	//register names
	LanguageRegistry.addName(deconstructionTable, "Deconstruction Table");
	//Register Block
	GameRegistry.registerBlock(deconstructionTable, "deconstructionTable");
	//Add Recipe
	GameRegistry.addRecipe(new ItemStack(deconstructionTable, 1), "BDB", "ACA", "AAA", 'A', Block.planks, 'B', Item.ingotIron, 'C', Block.workbench, 'D', Item.diamond);
	//add Deconstruction Recipe
	DeconstructionManager.getInstance().addRecipe(new ItemStack(deconstructionTable, 1), new Object[]{"BDB", "ACA", "AAA", 'A', Block.planks, 'B', Item.ingotIron, 'C', Block.workbench, 'D', Item.diamond});
	//Register Gui Handler
	NetworkRegistry.instance().registerGuiHandler(this, guiHandler);

}


@PostInit
public void postInit(FMLPostInitializationEvent event) {
	// Stub Method
}
}



 

Link to comment
Share on other sites

And now, BlockDeconstructionTable...

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.

Link to comment
Share on other sites

And now, BlockDeconstructionTable...

 

package deconstruction.common;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Icon;
import net.minecraft.world.World;

public class BlockDeconstructionTable extends Block
{
    @SideOnly(Side.CLIENT)
    private Icon workbenchIconTop;
    @SideOnly(Side.CLIENT)
    private Icon workbenchIconFront;

    protected BlockDeconstructionTable(int par1)
    {
        super(par1, Material.wood);
        this.setCreativeTab(CreativeTabs.tabDecorations);
    }

    @SideOnly(Side.CLIENT)

    /**
     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
     */
    public Icon getIcon(int par1, int par2)
    {
        return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront));
    }

    @SideOnly(Side.CLIENT)

    /**
     * When this method is called, your block should register all the icons it needs with the given IconRegister. This
     * is the only chance you get to register icons.
     */
    public void registerIcons(IconRegister par1IconRegister)
    {
    	System.out.println(this.func_111023_E() + "ASDFASDF");
        this.blockIcon = par1IconRegister.registerIcon("deconstruction:Decon_Side");
        this.workbenchIconTop = par1IconRegister.registerIcon("deconstruction:Decon_Top");
        this.workbenchIconFront = par1IconRegister.registerIcon("deconstruction:Decon_Side");
    }

    /**
     * Called upon block activation (right click on the block.)
     */
    public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int var6, float var7, float var8, float var9){
        if (!player.isSneaking()){
                player.openGui(mod_Deconstruction.instance, 1, par1World, x, y, z);
                return true;
        }else{
                return false;
        }
}
}

Link to comment
Share on other sites

Try...

 

protected BlockDeconstructionTable(int par1)
    {
        super(par1, Material.wood);
        this.setCreativeTab(CreativeTabs.tabDecorations);
        this.setUnlocalizedName("Deconstruction Table");
    }

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.

Link to comment
Share on other sites

Try...

 

protected BlockDeconstructionTable(int par1)
    {
        super(par1, Material.wood);
        this.setCreativeTab(CreativeTabs.tabDecorations);
        this.setUnlocalizedName("Deconstruction Table");
    }

 

Now it's tile.Deconstruction Table.name...

Link to comment
Share on other sites

Hi bdkuhman,

 

I've spent the past couple hours with this problem and it's fricken annoying.

 

However I just found a solution, place your LanguageRegistry.addName(deconstructionTable, "Deconstruction Table"); in the PreInit function and it should work.

 

If it doesn't let me know, but it should work.

 

Good Luck!

Link to comment
Share on other sites

Hi bdkuhman,

 

I've spent the past couple hours with this problem and it's fricken annoying.

 

However I just found a solution, place your LanguageRegistry.addName(deconstructionTable, "Deconstruction Table"); in the PreInit function and it should work.

 

If it doesn't let me know, but it should work.

 

Good Luck!

 

Thank you, It worked

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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