Jump to content

Custom furnace and armor texture problem


Nieue

Recommended Posts

Hello, I've been creating a mod with a custom furnace, but when I try to give it a texture, it comes up as white with texture missing. I have already created other blocks/items that DO have the good textures, but this one doesn't want to work. Oh and the GUI doesn't work as well :(

Class:

 

package mods.DennisMod.COMMON;

 

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockContainer;

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.entity.EntityLiving;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.Container;

import net.minecraft.inventory.IInventory;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.Icon;

import net.minecraft.util.MathHelper;

import net.minecraft.world.World;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.item.Item;

import net.minecraftforge.common.ForgeDirection;

 

public class Combiner extends BlockContainer

{

 

Icon blockTextureTop;

Icon blockTextureSide;

Icon blockTextureFront;

 

Icon textureFront, textureSides, textureBack, textureTop;

 

 

/**

    * Is the random generator used by furnace to drop the inventory contents in random directions.

    */

    private final Random furnaceRand = new Random();

 

    /** True if this is an active furnace, false if idle */

    private final boolean isActive;

 

    /**

    * This flag is used to prevent the furnace inventory to be dropped upon block removal, is used internally when the

    * furnace block changes from idle to active and vice-versa.

    */

    private static boolean keepFurnaceInventory = false;

    @SideOnly(Side.CLIENT)

    private Icon field_94458_cO;

    @SideOnly(Side.CLIENT)

    private Icon field_94459_cP;

 

    protected Combiner(int par1, boolean par2)

    {

        super(par1, Material.rock);

        this.isActive = par2;

    }

 

    /**

    * Returns the ID of the items to drop on destruction.

    */

    public int idDropped(int par1, Random par2Random, int par3)

    {

        return MoGems.CombinerIdle.blockID;

    }

 

    /**

    * Called whenever the block is added into the world. Args: world, x, y, z

    */

    public void onBlockAdded(World par1World, int par2, int par3, int par4)

    {

        super.onBlockAdded(par1World, par2, par3, par4);

        this.setDefaultDirection(par1World, par2, par3, par4);

    }

 

    /**

    * set a blocks direction

    */

    private void setDefaultDirection(World par1World, int par2, int par3, int par4)

    {

        if (!par1World.isRemote)

        {

            int l = par1World.getBlockId(par2, par3, par4 - 1);

            int i1 = par1World.getBlockId(par2, par3, par4 + 1);

            int j1 = par1World.getBlockId(par2 - 1, par3, par4);

            int k1 = par1World.getBlockId(par2 + 1, par3, par4);

            byte b0 = 3;

 

            if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1])

            {

                b0 = 3;

            }

 

            if (Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l])

            {

                b0 = 2;

            }

 

            if (Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1])

            {

                b0 = 5;

            }

 

            if (Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1])

            {

                b0 = 4;

            }

 

            par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);

        }

    }

 

 

    @Override

public Icon getIcon(int i, int j) {

if (j == 0 && i == 3)

return blockTextureFront;

 

if (i == j)

return blockTextureFront;

 

switch (i) {

case 1:

return blockTextureTop;

default:

return blockTextureSide;

}}

 

    /**

    * 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 updateIcons(IconRegister iconRegister)

{

    textureFront = iconRegister.registerIcon("[MCP]/eclipse/Minecraft/bin/textures/blocks/combiner_front");

        textureSides = iconRegister.registerIcon("[MCP]/eclipse/Minecraft/bin/textures/blocks/combiner_side");

        textureTop = iconRegister.registerIcon("[MCP]/eclipse/Minecraft/bin/textures/blocks/combiner_top");

       

}

    /**

    * Called upon block activation (right click on the block.)

    */

@Override

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float f, float g, float t) {

TileEntity tile_entity = world.getBlockTileEntity(x, y, z);

 

if (tile_entity == null || player.isSneaking()) {

 

return false;

}

 

player.openGui(MoGems.instance, 0, world, x, y, z);

 

return true;

}

 

    /**

    * Update which block ID the furnace is using depending on whether or not it is burning

    */

    public static void updateFurnaceBlockState(boolean par0, World par1World, int par2, int par3, int par4)

    {

        int l = par1World.getBlockMetadata(par2, par3, par4);

        TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);

        keepFurnaceInventory = true;

 

        if (par0)

        {

            par1World.setBlock(par2, par3, par4, MoGems.CombinerLit.blockID);

        }

        else

        {

            par1World.setBlock(par2, par3, par4, MoGems.CombinerIdle.blockID);

        }

 

        keepFurnaceInventory = false;

        par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);

 

        if (tileentity != null)

        {

            tileentity.validate();

            par1World.setBlockTileEntity(par2, par3, par4, tileentity);

        }

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * Returns a new instance of a block's tile entity class. Called on placing the block.

    */

    public TileEntity createNewTileEntity(World par1World)

    {

        return new TileEntityCombiner();

    }

 

    /**

    * Called when the block is placed in the world.

    */

    public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack)

    {

        int l = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

 

        if (l == 0)

        {

            par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);

        }

 

        if (l == 1)

        {

            par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2);

        }

 

        if (l == 2)

        {

            par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);

        }

 

        if (l == 3)

        {

            par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);

        }

 

        if (par6ItemStack.hasDisplayName())

        {

            ((TileEntityCombiner)par1World.getBlockTileEntity(par2, par3, par4)).func_94129_a(par6ItemStack.getDisplayName());

        }

    }

 

    /**

    * ejects contained items into the world, and notifies neighbours of an update, as appropriate

    */

    public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)

    {

        if (!keepFurnaceInventory)

        {

        TileEntityCombiner tileentitycombiner = (TileEntityCombiner)par1World.getBlockTileEntity(par2, par3, par4);

 

            if (tileentitycombiner != null)

            {

                for (int j1 = 0; j1 < tileentitycombiner.getSizeInventory(); ++j1)

                {

                    ItemStack itemstack = tileentitycombiner.getStackInSlot(j1);

 

                    if (itemstack != null)

                    {

                        float f = this.furnaceRand.nextFloat() * 0.8F + 0.1F;

                        float f1 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;

                        float f2 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;

 

                        while (itemstack.stackSize > 0)

                        {

                            int k1 = this.furnaceRand.nextInt(21) + 10;

 

                            if (k1 > itemstack.stackSize)

                            {

                                k1 = itemstack.stackSize;

                            }

 

                            itemstack.stackSize -= k1;

                            EntityItem entityitem = new EntityItem(par1World, (double)((float)par2 + f), (double)((float)par3 + f1), (double)((float)par4 + f2), new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));

 

                            if (itemstack.hasTagCompound())

                            {

                                entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());

                            }

 

                            float f3 = 0.05F;

                            entityitem.motionX = (double)((float)this.furnaceRand.nextGaussian() * f3);

                            entityitem.motionY = (double)((float)this.furnaceRand.nextGaussian() * f3 + 0.2F);

                            entityitem.motionZ = (double)((float)this.furnaceRand.nextGaussian() * f3);

                            par1World.spawnEntityInWorld(entityitem);

                        }

                    }

                }

 

                par1World.func_96440_m(par2, par3, par4, par5);

            }

        }

 

        super.breakBlock(par1World, par2, par3, par4, par5, par6);

    }

 

    /**

    * If this returns true, then comparators facing away from this block will use the value from

    * getComparatorInputOverride instead of the actual redstone signal strength.

    */

    public boolean hasComparatorInputOverride()

    {

        return true;

    }

 

    /**

    * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal

    * strength when this block inputs to a comparator.

    */

    public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)

    {

        return Container.func_94526_b((IInventory)par1World.getBlockTileEntity(par2, par3, par4));

    }

}

 

 

GUICombiner class

 

package mods.DennisMod.COMMON;

 

import net.minecraft.client.gui.inventory.GuiContainer;

import net.minecraft.entity.player.InventoryPlayer;

 

import net.minecraft.util.StatCollector;

 

import org.lwjgl.opengl.GL11;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@SideOnly(Side.CLIENT)

public class GUICombiner extends GuiContainer

{

    private TileEntityCombiner furnaceInventory;

 

    public GUICombiner(InventoryPlayer par1InventoryPlayer, TileEntityCombiner par2TileEntityCombiner)

    {

        super(new ContainerCombiner(par1InventoryPlayer, par2TileEntityCombiner));

        this.furnaceInventory = par2TileEntityCombiner;

    }

 

    /**

    * Draw the foreground layer for the GuiContainer (everything in front of the items)

    */

    protected void drawGuiContainerForegroundLayer(int par1, int par2)

    {

        String s = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : StatCollector.translateToLocal(this.furnaceInventory.getInvName());

        this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);

        this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);

    }

 

    /**

    * Draw the background layer for the GuiContainer (everything behind the items)

    */

    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)

    {

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

        this.mc.renderEngine.bindTexture("[MCP]/eclipse/Minecraft/bin/textures/gui/combiner.png");

        int k = (this.width - this.xSize) / 2;

        int l = (this.height - this.ySize) / 2;

        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);

        int i1;

 

        if (this.furnaceInventory.isBurning())

        {

            i1 = this.furnaceInventory.getBurnTimeRemainingScaled(12);

            this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);

        }

 

        i1 = this.furnaceInventory.getCookProgressScaled(24);

        this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);

    }

}

 

 

And my armor works PERFECTLY, but it doesn't render on the player, how do I do this? Tutorials on youtube didn't work for me, so I've just let it rest for a minute but I want to know it now :P

Main mod class (if that's needed)

 

package mods.DennisMod.COMMON;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockFurnace;

import net.minecraft.block.BlockOre;

import net.minecraft.block.BlockOreStorage;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.EnumArmorMaterial;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemAxe;

import net.minecraft.item.ItemHoe;

import net.minecraft.item.ItemPickaxe;

import net.minecraft.item.ItemSpade;

import net.minecraft.item.ItemStack;

import net.minecraft.item.ItemSword;

import net.minecraft.item.crafting.FurnaceRecipes;

import net.minecraft.world.World;

import net.minecraftforge.common.Configuration;

import net.minecraftforge.common.EnumHelper;

import net.minecraftforge.common.MinecraftForge;

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.PreInit;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

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 net.minecraft.block.material.Material;

 

 

@Mod(modid = "MoGems",name = "Mo' Gems and Ingots", version = "0.3.1")

@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"DennisMod"}, packetHandler = ModPacketHandler.class)

public class MoGems

{

 

public final static EnumToolMaterial DENNIS = EnumHelper.addToolMaterial("DENNIS", 3, 2500, 10.0F, 6, 10);

public final static EnumToolMaterial AMETHYST = EnumHelper.addToolMaterial("AMETHYST", 3, 5000, 25.0F, 15, 10);

public final static EnumToolMaterial MANGANESE = EnumHelper.addToolMaterial("MANGANESE", 2, 1000, 12.0F, 3, 12);

public final static EnumArmorMaterial EMERALD = EnumHelper.addArmorMaterial("EMERALD", 55, new int[]{4, 9, 5, 2}, 20);

 

@PreInit

public void preInit(FMLInitializationEvent event) {

 

}

//Emerald

public final static Item EmeraldSword = new ItemSword(6320, DENNIS).setMaxStackSize(1).setUnlocalizedName("emeraldsword");

public final static Item EmeraldPickaxe = new ItemPickaxe(6321, DENNIS).setMaxStackSize(1).setUnlocalizedName("emeraldpickaxe");

public final static Item EmeraldAxe = new ItemAxe(6322, DENNIS).setMaxStackSize(1).setUnlocalizedName("emeraldaxe");

public final static Item EmeraldShovel = new ItemSpade(6323, DENNIS).setMaxStackSize(1).setUnlocalizedName("emeraldshovel");

public final static Item EmeraldHoe = new ItemHoe(6324, DENNIS).setMaxStackSize(1).setUnlocalizedName("emeraldhoe");

public static Item EmeraldHelm  = new ItemArmor(6337, EMERALD, 5, 0).setMaxStackSize(1).setUnlocalizedName("emeraldhelmet");

public static Item EmeraldChest = new ItemArmor(6338, EMERALD, 5, 1).setMaxStackSize(1).setUnlocalizedName("emeraldchestplate");

public static Item EmeraldLegs = new ItemArmor(6339, EMERALD, 5, 2).setMaxStackSize(1).setUnlocalizedName("emeraldpants");

public static Item EmeraldBoots = new ItemArmor(6340, EMERALD, 5, 3).setMaxStackSize(1).setUnlocalizedName("emeraldboots");

 

//Amethyst

public final static Item AmethystSword = new ItemSword(6326, AMETHYST).setMaxStackSize(1).setUnlocalizedName("amethystsword");

public final static Item AmethystPickaxe = new ItemPickaxe(6327, AMETHYST).setMaxStackSize(1).setUnlocalizedName("amethystpickaxe");

public final static Item AmethystAxe = new ItemAxe(6328, AMETHYST).setMaxStackSize(1).setUnlocalizedName("amethystaxe");

public final static Item AmethystShovel = new ItemSpade(6329, AMETHYST).setMaxStackSize(1).setUnlocalizedName("amethystshovel");

public final static Item AmethystHoe = new ItemHoe(6330, AMETHYST).setMaxStackSize(1).setUnlocalizedName("amethysthoe");

public final static Item Amethyst = new Amethyst(6325).setUnlocalizedName("amethyst");

public final static Block AmethystBlock = new AmethystBlock(4061).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("amethystblock");

 

//Manganese

public final static Block ManganeseOre = new BlockOre(4060).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("manganeseore");

public final static Item ManganeseIngot = new ManganeseIngot(6331).setUnlocalizedName("manganeseingot");

    public final static Item ManganeseSword = new ItemSword(6332, MANGANESE).setMaxStackSize(1).setUnlocalizedName("manganesesword"); 

    public final static Item ManganesePickaxe = new ItemPickaxe(6333, MANGANESE).setMaxStackSize(1).setUnlocalizedName("manganesepickaxe");

public final static Item ManganeseAxe = new ItemAxe(6334, MANGANESE).setMaxStackSize(1).setUnlocalizedName("manganeseaxe");

public final static Item ManganeseShovel = new ItemSpade(6335, MANGANESE).setMaxStackSize(1).setUnlocalizedName("manganeseshovel");

public final static Item ManganeseHoe = new ItemHoe(6336, MANGANESE).setMaxStackSize(1).setUnlocalizedName("manganesehoe");

public final static Block ManganeseBlock = new ManganeseBlock(4071).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("manganeseblock");

 

//Misc

public final static Block CharcoalCobble = new CharcoalCobble(4074).setHardness(3.0F).setResistance(10.0F).setUnlocalizedName("charcoalcobble");

 

//Fuel

public final static Item SuperCoal = new SuperCoal(6341).setUnlocalizedName("supercoal");

public final static Item MegaCoal = new MegaCoal(6342).setUnlocalizedName("megacoal");

public final static Item SuperMegaCoal = new SuperMegaCoal(6343).setUnlocalizedName("supermegacoal");

 

//Tab

public final static CreativeTabs MoGems = new MoGemsTab(CreativeTabs.getNextID(), Amethyst.itemID, "MoGems", "Mo' Gems and Ingots");

 

 

 

@SidedProxy(clientSide = "mods.DennisMod.client.ClientProxy", serverSide = "mods.DennisMod.common.CommonProxy")

public static CommonProxy Proxy;

 

@Instance

public static MoGems instance = new MoGems();

 

private GuiHandler guihandler = new GuiHandler();

private AdvancedGuiHandler advancedguihandler = new AdvancedGuiHandler();

 

public static Block CombinerIdle;

public static Block CombinerLit;

public static Block AdvancedIdle;

public static Block AdvancedLit;

 

@Init

public void load(FMLInitializationEvent event)

{

GameRegistry.registerWorldGenerator(new ModGenerator());

GameRegistry.registerFuelHandler(new MoGemsFuelHandler());

 

CombinerIdle = new Combiner(4062, false).setHardness(3.5F).setUnlocalizedName("combineridle");

CombinerLit = new Combiner(4063, true).setHardness(3.5F).setUnlocalizedName("combinerlit");

AdvancedIdle = new AdvancedCombiner(4065, false).setHardness(5.0F).setUnlocalizedName("advancedidle");

AdvancedLit = new AdvancedCombiner(4066, true).setHardness(5.0F).setUnlocalizedName("advancedlit");

 

EmeraldSword.setCreativeTab(MoGems);

EmeraldPickaxe.setCreativeTab(MoGems);

EmeraldAxe.setCreativeTab(MoGems);

EmeraldShovel.setCreativeTab(MoGems);

EmeraldHoe.setCreativeTab(MoGems);

EmeraldHelm.setCreativeTab(MoGems);

EmeraldChest.setCreativeTab(MoGems);

EmeraldLegs.setCreativeTab(MoGems);

EmeraldBoots.setCreativeTab(MoGems);

Amethyst.setCreativeTab(MoGems);

AmethystSword.setCreativeTab(MoGems);

AmethystPickaxe.setCreativeTab(MoGems);

AmethystAxe.setCreativeTab(MoGems);

AmethystShovel.setCreativeTab(MoGems);

AmethystHoe.setCreativeTab(MoGems);

AmethystBlock.setCreativeTab(MoGems);

ManganeseSword.setCreativeTab(MoGems);

ManganesePickaxe.setCreativeTab(MoGems);

ManganeseAxe.setCreativeTab(MoGems);

ManganeseShovel.setCreativeTab(MoGems);

ManganeseHoe.setCreativeTab(MoGems);

ManganeseOre.setCreativeTab(MoGems);

ManganeseIngot.setCreativeTab(MoGems);

ManganeseBlock.setCreativeTab(MoGems);

CombinerIdle.setCreativeTab(MoGems);

CharcoalCobble.setCreativeTab(MoGems);

AdvancedIdle.setCreativeTab(MoGems);

SuperCoal.setCreativeTab(MoGems);

MegaCoal.setCreativeTab(MoGems);

SuperMegaCoal.setCreativeTab(MoGems);

 

 

LanguageRegistry.addName(EmeraldSword, "Emerald Sword");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldPickaxe, "Emerald Pickaxe");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldAxe, "Emerald Axe");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldShovel, "Emerald Shovel");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldHoe, "Emerald Hoe");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldHelm, "Emerald Helmet");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldChest, "Emerald Chestplate");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldLegs, "Emerald Leggings");

Proxy.registerRendering();

LanguageRegistry.addName(EmeraldBoots, "Emerald Boots");

Proxy.registerRendering();

 

LanguageRegistry.addName(Amethyst, "Amethyst");

Proxy.registerRendering();

LanguageRegistry.addName(AmethystSword, "Amethyst Sword");

Proxy.registerRendering();

LanguageRegistry.addName(AmethystPickaxe, "Amethyst Pickaxe");

Proxy.registerRendering();

LanguageRegistry.addName(AmethystAxe, "Amethyst Axe");

Proxy.registerRendering();

LanguageRegistry.addName(AmethystShovel, "Amethyst Shovel");

Proxy.registerRendering();

LanguageRegistry.addName(AmethystHoe, "Amethyst Hoe");

Proxy.registerRendering();

LanguageRegistry.addName(AmethystBlock, "Amethyst Block");

Proxy.registerRendering();

 

LanguageRegistry.addName(ManganeseOre, "Manganese Ore");

Proxy.registerRendering();

LanguageRegistry.addName(ManganeseIngot, "Manganese Ingot");

Proxy.registerRendering();

LanguageRegistry.addName(ManganeseSword, "Manganese Sword");

Proxy.registerRendering();

LanguageRegistry.addName(ManganesePickaxe, "Manganese Pickaxe");

Proxy.registerRendering();

LanguageRegistry.addName(ManganeseAxe, "Manganese Axe");

Proxy.registerRendering();

LanguageRegistry.addName(ManganeseShovel, "Manganese Shovel");

Proxy.registerRendering();

LanguageRegistry.addName(ManganeseHoe, "Manganese Hoe");

Proxy.registerRendering();

LanguageRegistry.addName(ManganeseBlock, "Manganese Block");

Proxy.registerRendering();

LanguageRegistry.addName(CombinerIdle,"Combiner");

Proxy.registerRendering();

LanguageRegistry.addName(CombinerLit, "Combiner Lit");

Proxy.registerRendering();

LanguageRegistry.addName(CharcoalCobble, "Charchoal Engraved Cobblestone");

Proxy.registerRendering();

LanguageRegistry.addName(AdvancedIdle, "Advanced Combiner");

Proxy.registerRendering();

 

LanguageRegistry.addName(SuperCoal, "Super Coal");

Proxy.registerRendering();

LanguageRegistry.addName(MegaCoal, "Mega Coal");

Proxy.registerRendering();

LanguageRegistry.addName(SuperMegaCoal, "Super Mega Coal");

 

GameRegistry.registerBlock(AmethystBlock, "Amethyst.AmethystBlock");

GameRegistry.registerBlock(ManganeseOre, "Manganese.ManganeseOre");

GameRegistry.registerBlock(ManganeseBlock, "Manganese.ManganeseBlock");

GameRegistry.registerBlock(CombinerIdle, "Combiner.CombinerIdle");

GameRegistry.registerBlock(CombinerLit, "Combiner.CombinerLit");

GameRegistry.registerBlock(CharcoalCobble, "Charcoal.CharcoalCobble");

GameRegistry.registerBlock(AdvancedIdle, "Combiner.AdvancedIdle");

GameRegistry.registerBlock(AdvancedLit, "Combiner.AdvancedLit");

 

 

GameRegistry.registerTileEntity(TileEntityCombiner.class, "TileEntityCombiner");

GameRegistry.registerTileEntity(TileEntityAdvanced.class, "TileEntityAdvanced");

 

NetworkRegistry.instance().registerGuiHandler(this, guihandler);

 

MinecraftForge.setBlockHarvestLevel(ManganeseOre, "pickaxe", 2);

MinecraftForge.setBlockHarvestLevel(AmethystBlock, "pickaxe", 2);

MinecraftForge.setBlockHarvestLevel(ManganeseBlock, "pickaxe", 2);

MinecraftForge.setBlockHarvestLevel(CombinerIdle, "pickaxe", 1);

MinecraftForge.setBlockHarvestLevel(CombinerLit, "pickaxe", 1);

MinecraftForge.setBlockHarvestLevel(CharcoalCobble, "pickaxe", 1);

MinecraftForge.setBlockHarvestLevel(AdvancedIdle, "pickaxe", 2);

MinecraftForge.setBlockHarvestLevel(AdvancedLit, "pickaxe", 2);

 

ItemStack ema = new ItemStack(Item.emerald);

ItemStack stick = new ItemStack(Item.stick);

ItemStack quartz = new ItemStack(Item.netherQuartz);

ItemStack ame = new ItemStack(Amethyst);

ItemStack cha = new ItemStack(Item.coal, 1, 1);

ItemStack man = new ItemStack(ManganeseIngot);

ItemStack fur = new ItemStack(Block.furnaceIdle);

ItemStack bmn = new ItemStack(ManganeseBlock);

ItemStack chc = new ItemStack(CharcoalCobble);

ItemStack com = new ItemStack(CombinerIdle);

 

GameRegistry.addRecipe(new ItemStack (EmeraldSword), "e", "e", "s",

's', stick, 'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldPickaxe), "eee", " s ", " s ",

's', stick, 'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldAxe), "ee ", "es ", " s ",

's', stick, 'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldShovel), " e ", " s ", " s ",

's', stick, 'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldHoe), "ee ", " s ", " s ",

's', stick, 'e', ema);

GameRegistry.addRecipe(new ItemStack (Amethyst), "eqe", "qeq", "eqe",

'q', quartz, 'e', ema);

GameRegistry.addRecipe(new ItemStack (AmethystSword), "a", "a", "s",

'a', ame, 's', stick);

GameRegistry.addRecipe(new ItemStack (AmethystPickaxe), "aaa", " s ", " s ",

'a', ame, 's', stick);

GameRegistry.addRecipe(new ItemStack (AmethystAxe), "aa ", "as ", " s ",

'a', ame, 's', stick);

GameRegistry.addRecipe(new ItemStack (AmethystShovel)," a ", " s ", " s ",

'a', ame, 's', stick);

GameRegistry.addRecipe(new ItemStack (AmethystHoe), "aa ", " s ", " s ",

'a', ame, 's', stick);

GameRegistry.addRecipe(new ItemStack (AmethystBlock), "aaa", "aaa", "aaa",

'a', ame);

GameRegistry.addRecipe(new ItemStack(ManganeseSword), "m", "m", "s",

'm', man, 's', stick);

GameRegistry.addRecipe(new ItemStack(ManganesePickaxe), "mmm", " s ", " s ",

'm', man, 's', stick);

GameRegistry.addRecipe(new ItemStack(ManganeseAxe), "mm ", "ms ", " s ",

'm', man, 's', stick);

GameRegistry.addRecipe(new ItemStack(ManganeseShovel), " m ", " s ", " s ",

'm', man, 's', stick);

GameRegistry.addRecipe(new ItemStack(ManganeseHoe), "mm ", " s ", " s ",

'm', man, 's', stick);

GameRegistry.addRecipe(new ItemStack (EmeraldHelm), "eee", "e e", "  ",

'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldHelm), "  ", "eee", "e e",

'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldChest), "e e", "eee", "eee",

'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldLegs), "eee", "e e", "e e",

'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldBoots), "e e", "e e", "  ",

'e', ema);

GameRegistry.addRecipe(new ItemStack (EmeraldBoots), "  ", "e e", "e e",

'e', ema);

GameRegistry.addRecipe(new ItemStack (ManganeseBlock), "iii", "iii", "iii",

'i', man);

GameRegistry.addRecipe(new ItemStack (CombinerIdle), " b ", "bfb", " b ",

'f', fur, 'b', bmn);

GameRegistry.addRecipe(new ItemStack (AdvancedIdle), "c c", " m ", "c c",

'c', chc, 'm', com);

 

 

GameRegistry.addShapelessRecipe(new ItemStack(Amethyst, 9), new Object[]{

new ItemStack(AmethystBlock)

});

}{;

GameRegistry.addShapelessRecipe(new ItemStack (ManganeseIngot, 9), new Object[]{

new ItemStack(ManganeseBlock)

}

 

);

FurnaceRecipes.smelting().addSmelting(ManganeseOre.blockID, 0, new ItemStack(ManganeseIngot), 0.1F);

 

 

 

}

}

 

 

Thanks already :)

Link to comment
Share on other sites

#13

http://s22.postimg.org/yx3yzq3td/Capture.png[/url]

You would think that no one SEARCHES for this problem before posting.

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

#13

width=800 height=646http://s22.postimg.org/yx3yzq3td/Capture.png[/url]

You would think that no one SEARCHES for this problem before posting.

And that didn't work, I think because it has 3 sides (front, top and side)

 

Really?  You can't figure the rest out on your own?

Capture.png

The only unusual thing there is that I'm saving the result back to a location accessible from everywhere (that block exists solely to register a bunch of debug textures for general use).

 

The problem might be that none of my blocks have a texture without a .unlocalizedName thingy behind it in the main class :/

 

No, because it's all set in the Block class, along with hardness, resistance, and several other things.

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

Okay so I got the textures working for the blocks, but not for the armor and gui :/

 

Armor I haven't messed with.  I believe they work differently from everything else

 

GUIs don't do the registerIcon stuff.  They use mc.renderEngine.bindTexture("full/path/to/texture.png") where the full path starts after "src/minecraft/" so if you want to put those textures in a gui folder next to your blocks and items, then you'd use:

 

mc.renderEngine.bindTexture("/mods/MODNAME/textures/gui/GUI.png");

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

Okay so I got the textures working for the blocks, but not for the armor and gui :/

 

Armor I haven't messed with.  I believe they work differently from everything else

 

GUIs don't do the registerIcon stuff.  They use mc.renderEngine.bindTexture("full/path/to/texture.png") where the full path starts after "src/minecraft/" so if you want to put those textures in a gui folder next to your blocks and items, then you'd use:

 

mc.renderEngine.bindTexture("/mods/MODNAME/textures/gui/GUI.png");

Thanks dude, you're a great help :)

Link to comment
Share on other sites

For armor, did your armor class implement IArmorTextureProvider. It says that it's deprecated but it still works.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

For armor, did your armor class implement IArmorTextureProvider. It says that it's deprecated but it still works.

Yeah I did that, but it didn't work for me. And I it gave me errors, so I deleted the armor class because I wanted to do something else without errors. So I don't have the armor class anymore, can you show me how to set up a good armor class?

Link to comment
Share on other sites

Ow, I've got 1 more problem with the GUI:

 

Just looks like your "active" textury bit is just sitting in the wrong place.

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

where should I put it?

 

In your GUI code there's some X and Y coordinates.  THAT'S what's offset.

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

For armor, did your armor class implement IArmorTextureProvider. It says that it's deprecated but it still works.

Yeah I did that, but it didn't work for me. And I it gave me errors, so I deleted the armor class because I wanted to do something else without errors. So I don't have the armor class anymore, can you show me how to set up a good armor class?

Yeah, this is my SapphireArmor class:

 

package com.larsg310.uc.item;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;
import com.larsg310.uc.UltimateCraft;
import com.larsg310.uc.lib.UCReferences;

public class SapphireArmor extends ItemArmor implements IArmorTextureProvider
{
    public SapphireArmor(int id, EnumArmorMaterial enumArmor, int par3, int par4, String name)
    {
        super(id, enumArmor, par3, par4);
        this.setCreativeTab(UltimateCraft.tabUC);
        this.setUnlocalizedName(name);
    }
    public void registerIcons(IconRegister iconRegister)
    {
        this.itemIcon = iconRegister.registerIcon(UCReferences.MOD_ID + ":" + this.getUnlocalizedName());
    }
    public String getArmorTextureFile(ItemStack par1)
    {
        if(par1.itemID == UCItems.helmetSapphire.itemID||par1.itemID == UCItems.chestplateSapphire.itemID||par1.itemID == UCItems.bootsSapphire.itemID)
        {
            return "/mods/uc/textures/armor/sapphire_1.png";
        }
        if(par1.itemID == UCItems.leggingsSapphire.itemID)
        {
            return "/mods/uc/textures/armor/sapphire_2.png";
        }
        return "/mods/uc/textures/armor/sapphire_2.png";
    }
    public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
    {
        return UCItems.gemSapphire.itemID == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
    }
}

 

Note the last method getIsRepairable: you only want to have this if you want your armor to be repairable.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

[quote name="larsgerrits" post="43862" timestamp="1369060732"]
[quote author=Nieue link=topic=8650.msg43838#msg43838 date=1369055430]
[quote author=larsgerrits link=topic=8650.msg43836#msg43836 date=1369055194]
For armor, did your armor class implement IArmorTextureProvider. It says that it's deprecated but it still works.
[/quote]
Yeah I did that, but it didn't work for me. And I it gave me errors, so I deleted the armor class because I wanted to do something else without errors. So I don't have the armor class anymore, can you show me how to set up a good armor class?
[/quote]
Yeah, this is my SapphireArmor class:
[spoiler]
    public void registerIcons(IconRegister iconRegister)
    {
        this.itemIcon = iconRegister.registerIcon(UCReferences.MOD_ID + ":" + this.getUnlocalizedName());
    }

 

What should I replace UCReferences.MOD_ID with?

Link to comment
Share on other sites

[quote author=larsgerrits link=topic=8650.msg43862#msg43862 date=1369060732]
[quote author=Nieue link=topic=8650.msg43838#msg43838 date=1369055430]
[quote author=larsgerrits link=topic=8650.msg43836#msg43836 date=1369055194]
For armor, did your armor class implement IArmorTextureProvider. It says that it's deprecated but it still works.
[/quote]
Yeah I did that, but it didn't work for me. And I it gave me errors, so I deleted the armor class because I wanted to do something else without errors. So I don't have the armor class anymore, can you show me how to set up a good armor class?
[/quote]
Yeah, this is my SapphireArmor class:
[spoiler]
    public void registerIcons(IconRegister iconRegister)
    {
        this.itemIcon = iconRegister.registerIcon(UCReferences.MOD_ID + ":" + this.getUnlocalizedName());
    }

 

What should I replace UCReferences.MOD_ID with?

Your modid that you used in your @Mod annotation in your main class

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

[quote author=larsgerrits link=topic=8650.msg43862#msg43862 date=1369060732]
[quote author=Nieue link=topic=8650.msg43838#msg43838 date=1369055430]
[quote author=larsgerrits link=topic=8650.msg43836#msg43836 date=1369055194]
For armor, did your armor class implement IArmorTextureProvider. It says that it's deprecated but it still works.
[/quote]
Yeah I did that, but it didn't work for me. And I it gave me errors, so I deleted the armor class because I wanted to do something else without errors. So I don't have the armor class anymore, can you show me how to set up a good armor class?
[/quote]
Yeah, this is my SapphireArmor class:
[spoiler]
    public void registerIcons(IconRegister iconRegister)
    {
        this.itemIcon = iconRegister.registerIcon(UCReferences.MOD_ID + ":" + this.getUnlocalizedName());
    }

 

What should I replace UCReferences.MOD_ID with?

Your modid that you used in your @Mod annotation in your main class

That didn't work, it gives me an error under the MODID name and 4 fix options:

Create constant 'MYMODID' <- not the name by the way :P

Create local variable 'MYMODID'

Create field 'MYMODID'

Create parameter 'MYMODID'

Link to comment
Share on other sites

That didn't work, it gives me an error under the MODID name and 4 fix options:

Create constant 'MYMODID' <- not the name by the way :P

Create local variable 'MYMODID'

Create field 'MYMODID'

Create parameter 'MYMODID'

 

Jesus christ.  Use a freaking string.  Don't try to reference the @Mod annotation.

He said use what's IN the annotation.

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

That didn't work, it gives me an error under the MODID name and 4 fix options:

Create constant 'MYMODID' <- not the name by the way :P

Create local variable 'MYMODID'

Create field 'MYMODID'

Create parameter 'MYMODID'

 

Jesus christ.  Use a freaking string.  Don't try to reference the @Mod annotation.

He said use what's IN the annotation.

So if I have this:

@Mod(modid = "MoGems",name = "Mo' Gems and Ingots", version = "0.4.0")

I should put Mo' Gems and Ingots?

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.