Jump to content

[1.6.4] Furnace GUI [solved]


ASHninja1997

Recommended Posts

Hello!

 

I am back again with yet another problem...

So I was watching a video on how to make a custom furnace [1.5.2] (you have to start somewhere xD) and I followed the tutorial till the end but I encountered a problem.

 

I know what line is causing the error, but I don't understand what the error is saying to fix.

 

Error

 

Description: Exception in world tick

2014-02-06 20:06:02 [iNFO] [sTDOUT]

2014-02-06 20:06:02 [iNFO] [sTDOUT] java.lang.ClassCastException: Crystalorb.ContainerEnergizer cannot be cast to net.minecraft.client.gui.GuiScreen

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.client.FMLClientHandler.showGuiScreen(FMLClientHandler.java:397)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLCommonHandler.showGuiScreen(FMLCommonHandler.java:334)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:328)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:357)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2483)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.common.network.OpenGuiPacket.execute(OpenGuiPacket.java:67)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.common.network.FMLNetworkHandler.handleFMLPacket(FMLNetworkHandler.java:116)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:81)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.NetClientHandler.handleCustomPayload(NetClientHandler.java:1651)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.network.packet.Packet250CustomPayload.processPacket(Packet250CustomPayload.java:70)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:99)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1930)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:838)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)

2014-02-06 20:06:02 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

 

 

ContainerEnergizer Class

 

package Crystalorb;

 

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.entity.player.InventoryPlayer;

import net.minecraft.inventory.Container;

import net.minecraft.inventory.ICrafting;

import net.minecraft.inventory.Slot;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class ContainerEnergizer extends Container

{

    private TileEntityEnergizer furnace;

    private int lastCookTime;

    private int lastBurnTime;

    private int lastItemBurnTime;

 

    public ContainerEnergizer(InventoryPlayer par1InventoryPlayer, TileEntityEnergizer par2TileEntityFurnace)

    {

        this.furnace = par2TileEntityFurnace;

        this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17));

        this.addSlotToContainer(new Slot(par2TileEntityFurnace, 1, 56, 53));

        this.addSlotToContainer(new SlotEnergizer(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35));

        int i;

 

        for (i = 0; i < 3; ++i)

        {

            for (int j = 0; j < 9; ++j)

            {

                this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));

            }

        }

 

        for (i = 0; i < 9; ++i)

        {

            this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142));

        }

    }

 

    public void addCraftingToCrafters(ICrafting par1ICrafting)

    {

        super.addCraftingToCrafters(par1ICrafting);

        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);

        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);

        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);

    }

 

    /**

    * Looks for changes made in the container, sends them to every listener.

    */

    public void detectAndSendChanges()

    {

        super.detectAndSendChanges();

 

        for (int i = 0; i < this.crafters.size(); ++i)

        {

            ICrafting icrafting = (ICrafting)this.crafters.get(i);

 

            if (this.lastCookTime != this.furnace.furnaceCookTime)

            {

                icrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);

            }

 

            if (this.lastBurnTime != this.furnace.furnaceBurnTime)

            {

                icrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);

            }

 

            if (this.lastItemBurnTime != this.furnace.currentItemBurnTime)

            {

                icrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);

            }

        }

 

        this.lastCookTime = this.furnace.furnaceCookTime;

        this.lastBurnTime = this.furnace.furnaceBurnTime;

        this.lastItemBurnTime = this.furnace.currentItemBurnTime;

    }

 

    @SideOnly(Side.CLIENT)

    public void updateProgressBar(int par1, int par2)

    {

        if (par1 == 0)

        {

            this.furnace.furnaceCookTime = par2;

        }

 

        if (par1 == 1)

        {

            this.furnace.furnaceBurnTime = par2;

        }

 

        if (par1 == 2)

        {

            this.furnace.currentItemBurnTime = par2;

        }

    }

 

    public boolean canInteractWith(EntityPlayer par1EntityPlayer)

    {

        return this.furnace.isUseableByPlayer(par1EntityPlayer);

    }

 

    /**

    * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.

    */

    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)

    {

        ItemStack itemstack = null;

        Slot slot = (Slot)this.inventorySlots.get(par2);

 

        if (slot != null && slot.getHasStack())

        {

            ItemStack itemstack1 = slot.getStack();

            itemstack = itemstack1.copy();

 

            if (par2 == 2)

            {

                if (!this.mergeItemStack(itemstack1, 3, 39, true))

                {

                    return null;

                }

 

                slot.onSlotChange(itemstack1, itemstack);

            }

            else if (par2 != 1 && par2 != 0)

            {

                if (EnergizerRecipes.smelting().getSmeltingResult(itemstack1) != null)

                {

                    if (!this.mergeItemStack(itemstack1, 0, 1, false))

                    {

                        return null;

                    }

                }

                else if (TileEntityEnergizer.isItemFuel(itemstack1))

                {

                    if (!this.mergeItemStack(itemstack1, 1, 2, false))

                    {

                        return null;

                    }

                }

                else if (par2 >= 3 && par2 < 30)

                {

                    if (!this.mergeItemStack(itemstack1, 30, 39, false))

                    {

                        return null;

                    }

                }

                else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))

                {

                    return null;

                }

            }

            else if (!this.mergeItemStack(itemstack1, 3, 39, false))

            {

                return null;

            }

 

            if (itemstack1.stackSize == 0)

            {

                slot.putStack((ItemStack)null);

            }

            else

            {

                slot.onSlotChanged();

            }

 

            if (itemstack1.stackSize == itemstack.stackSize)

            {

                return null;

            }

 

            slot.onPickupFromSlot(par1EntityPlayer, itemstack1);

        }

 

        return itemstack;

    }

}

 

 

 

OrbEnergizer Class

 

package Crystalorb;

 

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

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;

 

public class OrbEnergizer extends BlockContainer

{

    /**

    * 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;

    @SideOnly(Side.CLIENT)

    private Icon furnaceIconTop;

    @SideOnly(Side.CLIENT)

    private Icon furnaceIconFront;

 

    protected OrbEnergizer(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 Main.energizerIdle.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);

        }

    }

 

    @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.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront));

    }

 

    @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)

    {

        this.blockIcon = par1IconRegister.registerIcon(Main.modid + ":" + (this.getUnlocalizedName().substring(5)) + "_side");

        this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? Main.modid + ":" + (this.getUnlocalizedName().substring(5)) + "_on" : Main.modid + ":" + (this.getUnlocalizedName().substring(5)) + "_off");

        this.furnaceIconTop = par1IconRegister.registerIcon(Main.modid + ":" + (this.getUnlocalizedName().substring(5)) + "_top");

    }

 

    /**

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

    */

    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

    {

        if (par1World.isRemote)

        {

            return true;

        }

        else

        {

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

 

            if (tileentityfurnace != null)

            {

            par5EntityPlayer.openGui(Main.instance, 0, par1World, par2, par3, par4);

            }

 

            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, Main.energizerBurning.blockID);

        }

        else

        {

            par1World.setBlock(par2, par3, par4, Main.energizerIdle.blockID);

        }

 

        keepFurnaceInventory = false;

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

 

        if (tileentity != null)

        {

            tileentity.validate();

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

        }

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * A randomly called display update to be able to add particles or other items for display

    */

    public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)

    {

        if (this.isActive)

        {

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

            float f = (float)par2 + 0.5F;

            float f1 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;

            float f2 = (float)par4 + 0.5F;

            float f3 = 0.52F;

            float f4 = par5Random.nextFloat() * 0.6F - 0.3F;

 

            if (l == 4)

            {

                par1World.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

                par1World.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

            }

            else if (l == 5)

            {

                par1World.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

                par1World.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);

            }

            else if (l == 2)

            {

                par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);

                par1World.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);

            }

            else if (l == 3)

            {

                par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);

                par1World.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);

            }

        }

    }

 

    /**

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

    */

    public TileEntity createNewTileEntity(World par1World)

    {

        return new TileEntityEnergizer();

    }

 

    /**

    * Called when the block is placed in the world.

    */

    public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)

    {

        int l = MathHelper.floor_double((double)(par5EntityLivingBase.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())

        {

            ((TileEntityEnergizer)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName());

        }

    }

 

    /**

    * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a

    * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old

    * metadata

    */

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

    {

        if (!keepFurnaceInventory)

        {

            TileEntityEnergizer tileentityfurnace = (TileEntityEnergizer)par1World.getBlockTileEntity(par2, par3, par4);

 

            if (tileentityfurnace != null)

            {

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

                {

                    ItemStack itemstack = tileentityfurnace.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.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4));

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)

    */

    public int idPicked(World par1World, int par2, int par3, int par4)

    {

        return Main.energizerIdle.blockID;

    }

}

 

 

 

Line Error (Line 144)

 

par5EntityPlayer.openGui(Main.instance, 0, par1World, par2, par3, par4);

 

 

If you have anymore questions please ask.

Every day is a new day to learn.

I acknowledge the hard work of original content.

I will always improve in many ways.

 

Java > c

Link to comment
Share on other sites

Hello!

 

So I watched the video again and got the GUI to load but right after it loads minecraft crashes.

It said the error was

 

[sTDERR] Caused by: java.lang.ClassCastException: Crystalorb.GUIEnergizer cannot be cast to net.minecraft.inventory.Container

at Crystalorb.OrbEnergizer.onBlockActivated(OrbEnergizer.java:139)

 

OrbEnergizer 139

par5EntityPlayer.openGui(Main.instance, 0, par1World, x, y, z);

 

GUIEnergizer.class

 

package Crystalorb;

 

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

import net.minecraft.client.resources.I18n;

import net.minecraft.entity.player.InventoryPlayer;

import net.minecraft.util.ResourceLocation;

 

import org.lwjgl.opengl.GL11;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@SideOnly(Side.CLIENT)

public class GUIEnergizer extends GuiContainer

{

    private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("ashninja1997_crystalorbmod:textures/gui/container/energizer.png");

    private TileEntityEnergizer furnaceInventory;

 

    public GUIEnergizer(InventoryPlayer par1InventoryPlayer, TileEntityEnergizer par2TileEntityFurnace)

    {

        super(new ContainerEnergizer(par1InventoryPlayer, par2TileEntityFurnace));

        this.furnaceInventory = par2TileEntityFurnace;

    }

 

    /**

    * 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() : I18n.getString(this.furnaceInventory.getInvName());

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

        this.fontRenderer.drawString(I18n.getString("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.getTextureManager().bindTexture(furnaceGuiTextures);

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

    }

}

 

 

 

 

Every day is a new day to learn.

I acknowledge the hard work of original content.

I will always improve in many ways.

 

Java > c

Link to comment
Share on other sites

Oops....sorry I forgot to add that class.

 

GuiHandler

 

package Crystalorb;

 

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

import cpw.mods.fml.common.network.IGuiHandler;

 

public class GuiHandler implements IGuiHandler{

 

@Override

public Object getServerGuiElement(int ID, EntityPlayer player, World world,

int x, int y, int z) {

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

 

if(tileentity instanceof TileEntityEnergizer){

return new GUIEnergizer(player.inventory, (TileEntityEnergizer) tileentity);

}

 

return null;

}

 

@Override

public Object getClientGuiElement(int ID, EntityPlayer player, World world,

int x, int y, int z) {

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

 

if(tileentity instanceof TileEntityEnergizer){

return new GUIEnergizer(player.inventory, (TileEntityEnergizer) tileentity);

}

 

return null;

}

 

}

 

 

Every day is a new day to learn.

I acknowledge the hard work of original content.

I will always improve in many ways.

 

Java > c

Link to comment
Share on other sites

Oops....sorry I forgot to add that class.

 

GuiHandler

 

package Crystalorb;

 

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

import cpw.mods.fml.common.network.IGuiHandler;

 

public class GuiHandler implements IGuiHandler{

 

@Override

public Object getServerGuiElement(int ID, EntityPlayer player, World world,

int x, int y, int z) {

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

 

if(tileentity instanceof TileEntityEnergizer){

return new GUIEnergizer(player.inventory, (TileEntityEnergizer) tileentity);

}

 

return null;

}

 

@Override

public Object getClientGuiElement(int ID, EntityPlayer player, World world,

int x, int y, int z) {

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

 

if(tileentity instanceof TileEntityEnergizer){

return new GUIEnergizer(player.inventory, (TileEntityEnergizer) tileentity);

}

 

return null;

}

 

}

 

 

 

Also post your GUIEnergizer class please.

Link to comment
Share on other sites

YOU FIXED IT!!!!

 

You are the man!!

Man thank you so much, your awesome!!!

 

I can not explain how happy I am, I have been having trouble with this for a couple of days then you come along and solve it.

 

YES!!!

 

Thank you so much!!

Every day is a new day to learn.

I acknowledge the hard work of original content.

I will always improve in many ways.

 

Java > c

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.