Jump to content

[INSANE]TileEntities/Rendering/NBT problems


mar21

Recommended Posts

Ouch ,it works now, no error, but it still showing the 16p image of block.

How to create client proxy? I tried before, but that didnt worked ... ;)

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Link to comment
Share on other sites

honestly just look at the wiki, its pretty straightdoward.

public class MainMod{
@SidedProxy(clientSide = "com.hydroflame.mod.ForgeRevClientProxy", serverSide = "com.hydroflame.mod.ForgeRevCommonProxy")
public static CommonProxy proxy;
//bunch of function
///......
//...
//...
}

 

make a class CommonProxy and one ClientProxy that extends the CommonProxy one

 

then make a function called registerRenderers() in both and but the rendering code in the client one

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

OK, I created the ClientProxy and CommonProxy, but still it doesnt work ...

So, the classes again :D :

Client proxy:

 

package mar21.omega.proxies;

 

import mar21.omega.ModCore;

import mar21.omega.machine.tileEntity.render.TileEntityPoweredMelterInvRender;

import net.minecraftforge.client.MinecraftForgeClient;

 

public class ClientProxy extends CommonProxy{

public static void registerRenderers()

{

MinecraftForgeClient.registerItemRenderer(ModCore.powered_melter_idle.blockID, new TileEntityPoweredMelterInvRender());

}

}

 

 

Common Proxy:

 

package mar21.omega.proxies;

 

public class CommonProxy {

public static void registerRenderers()

{

 

}

}

 

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Link to comment
Share on other sites

So, the small problem with invetory rendering is not solved, butt, I have there another problem.

I trying to make the machine working with my "WIP" electric site.

The way, it is made is: You need to place the machine on top of the power interface (if not, you cant open the gui of machine, or do anything), this is not the problem. I rewrited one method, and inserted in to, when there is that special block, set the currentItemBurnTime to 200 and remove 200 energy from that block ...Classes:

MachinePoweredMelter

package mar21.omega.machine;

 

import java.util.Random;

 

import mar21.omega.ModCore;

import mar21.omega.machine.tileEntity.TE_PoweredMelter;

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

import net.minecraft.world.World;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class MachinePoweredMelter 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 = false;

    @SideOnly(Side.CLIENT)

    private Icon furnaceIconTop;

    @SideOnly(Side.CLIENT)

    private Icon furnaceIconFront;

 

    public MachinePoweredMelter(int par1, boolean par2)

    {

        super(par1, Material.rock);

        this.isActive = par2;

        this.setHardness(5.0F);

    }

 

    /**

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

    */

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

    {

        return ModCore.powered_melter_idle.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(ModCore.modid + ":powered_meltericon");

        this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? ModCore.modid + ":powered_melteract" : ModCore.modid + ":powered_melteridle");

        this.furnaceIconTop = par1IconRegister.registerIcon(ModCore.modid + ":powered_meltertop");

    }

 

    /**

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

}

if(tile_entity != null && world.getBlockId(x, y-1, z) == ModCore.machine_power_interface.blockID)

{

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

return true;

}

return false;

}

 

    /**

    * 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, ModCore.powered_melter_act.blockID);

        }

        else

        {

            par1World.setBlock(par2, par3, par4, ModCore.powered_melter_idle.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.5F;

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

    }

 

    /**

    * 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())

        {

            ((TE_PoweredMelter)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)

        {

            TE_PoweredMelter TileEntityPoweredMelter = (TE_PoweredMelter)par1World.getBlockTileEntity(par2, par3, par4);

 

            if (TileEntityPoweredMelter != null)

            {

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

                {

                    ItemStack itemstack = TileEntityPoweredMelter.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 Block.furnaceIdle.blockID;

    }

   

   

    //You don't want the normal render type, or it wont render properly.

    @Override

    public int getRenderType() {

            return -1;

    }

   

    //It's not an opaque cube, so you need this.

    @Override

    public boolean isOpaqueCube() {

            return false;

    }

   

    //It's not a normal block, so you need this too.

    public boolean renderAsNormalBlock() {

            return false;

    }

}

 

 

TE_PoweredMelter

 

package mar21.omega.machine.tileEntity;

 

import mar21.omega.ModCore;

import mar21.omega.machine.MachinePoweredMelter;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.ISidedInventory;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.nbt.NBTTagList;

import net.minecraft.tileentity.TileEntity;

import net.minecraftforge.common.ForgeDirection;

import net.minecraftforge.common.ForgeDummyContainer;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class TE_PoweredMelter extends TileEntity implements ISidedInventory, net.minecraftforge.common.ISidedInventory

{

    private static final int[] field_102010_d = new int[] {0};

    private static final int[] field_102011_e = new int[] {2, 1};

    private static final int[] field_102009_f = new int[] {1};

 

    /**

    * The ItemStacks that hold the items currently being used in the furnace

    */

    private ItemStack[] furnaceItemStacks = new ItemStack[3];

 

    /** The number of ticks that the furnace will keep burning */

    public int furnaceBurnTime = 0;

 

    /**

    * The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for

    */

    public int currentItemBurnTime = 0;

 

    /** The number of ticks that the current item has been cooking for */

    public int furnaceCookTime = 0;

    private String field_94130_e;

 

    /**

    * Returns the number of slots in the inventory.

    */

    public int getSizeInventory()

    {

        return this.furnaceItemStacks.length;

    }

 

    /**

    * Returns the stack in slot i

    */

    public ItemStack getStackInSlot(int par1)

    {

        return this.furnaceItemStacks[par1];

    }

 

    /**

    * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a

    * new stack.

    */

    public ItemStack decrStackSize(int par1, int par2)

    {

        if (this.furnaceItemStacks[par1] != null)

        {

            ItemStack itemstack;

 

            if (this.furnaceItemStacks[par1].stackSize <= par2)

            {

                itemstack = this.furnaceItemStacks[par1];

                this.furnaceItemStacks[par1] = null;

                return itemstack;

            }

            else

            {

                itemstack = this.furnaceItemStacks[par1].splitStack(par2);

 

                if (this.furnaceItemStacks[par1].stackSize == 0)

                {

                    this.furnaceItemStacks[par1] = null;

                }

 

                return itemstack;

            }

        }

        else

        {

            return null;

        }

    }

 

    /**

    * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -

    * like when you close a workbench GUI.

    */

    public ItemStack getStackInSlotOnClosing(int par1)

    {

        if (this.furnaceItemStacks[par1] != null)

        {

            ItemStack itemstack = this.furnaceItemStacks[par1];

            this.furnaceItemStacks[par1] = null;

            return itemstack;

        }

        else

        {

            return null;

        }

    }

 

    /**

    * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).

    */

    public void setInventorySlotContents(int par1, ItemStack par2ItemStack)

    {

        this.furnaceItemStacks[par1] = par2ItemStack;

 

        if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())

        {

            par2ItemStack.stackSize = this.getInventoryStackLimit();

        }

    }

 

    /**

    * Returns the name of the inventory.

    */

    public String getInvName()

    {

        return this.isInvNameLocalized() ? this.field_94130_e : "Powered Metallurgic Melter";

    }

 

    /**

    * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's

    * language. Otherwise it will be used directly.

    */

    public boolean isInvNameLocalized()

    {

        return this.field_94130_e != null && this.field_94130_e.length() > 0;

    }

 

    public void func_94129_a(String par1Str)

    {

        this.field_94130_e = par1Str;

    }

 

    /**

    * Reads a tile entity from NBT.

    */

    public void readFromNBT(NBTTagCompound par1NBTTagCompound)

    {

        super.readFromNBT(par1NBTTagCompound);

        NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items");

        this.furnaceItemStacks = new ItemStack[this.getSizeInventory()];

 

        for (int i = 0; i < nbttaglist.tagCount(); ++i)

        {

            NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);

            byte b0 = nbttagcompound1.getByte("Slot");

 

            if (b0 >= 0 && b0 < this.furnaceItemStacks.length)

            {

                this.furnaceItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);

            }

        }

 

        this.furnaceBurnTime = par1NBTTagCompound.getShort("BurnTime");

        this.furnaceCookTime = par1NBTTagCompound.getShort("CookTime");

        this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);

 

        if (par1NBTTagCompound.hasKey("machine_powered_melter"))

        {

            this.field_94130_e = par1NBTTagCompound.getString("machine_powered_melter");

        }

    }

 

    /**

    * Writes a tile entity to NBT.

    */

    public void writeToNBT(NBTTagCompound par1NBTTagCompound)

    {

        super.writeToNBT(par1NBTTagCompound);

        par1NBTTagCompound.setShort("BurnTime", (short)this.furnaceBurnTime);

        par1NBTTagCompound.setShort("CookTime", (short)this.furnaceCookTime);

        NBTTagList nbttaglist = new NBTTagList();

 

        for (int i = 0; i < this.furnaceItemStacks.length; ++i)

        {

            if (this.furnaceItemStacks != null)

            {

                NBTTagCompound nbttagcompound1 = new NBTTagCompound();

                nbttagcompound1.setByte("Slot", (byte)i);

                this.furnaceItemStacks.writeToNBT(nbttagcompound1);

                nbttaglist.appendTag(nbttagcompound1);

            }

        }

 

        par1NBTTagCompound.setTag("Items", nbttaglist);

 

        if (this.isInvNameLocalized())

        {

            par1NBTTagCompound.setString("machine_powered_melter", this.field_94130_e);

        }

    }

 

    /**

    * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't

    * this more of a set than a get?*

    */

    public int getInventoryStackLimit()

    {

        return 64;

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * Returns an integer between 0 and the passed value representing how close the current item is to being completely

    * cooked

    */

    public int getCookProgressScaled(int par1)

    {

        return this.furnaceCookTime * par1 / 200;

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel

    * item, where 0 means that the item is exhausted and the passed value means that the item is fresh

    */

    public int getBurnTimeRemainingScaled(int par1)

    {

        if (this.currentItemBurnTime == 0)

        {

            this.currentItemBurnTime = 200;

        }

 

        return this.furnaceBurnTime * par1 / this.currentItemBurnTime;

    }

 

    /**

    * Returns true if the furnace is currently burning

    */

    public boolean isBurning()

    {

        return this.furnaceBurnTime > 0;

    }

 

    /**

    * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count

    * ticks and creates a new spawn inside its implementation.

    */

    public void updateEntity()

    {

        boolean flag = this.furnaceBurnTime > 0;

        boolean flag1 = false;

 

        if (this.furnaceBurnTime > 0)

        {

            --this.furnaceBurnTime;

        }

 

        if (!this.worldObj.isRemote)

        {

            if (this.furnaceBurnTime == 0 && this.canSmelt())

            {

                this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);

 

                if (this.furnaceBurnTime > 0)

                {

                    flag1 = true;

 

                    if (this.furnaceItemStacks[1] != null)

                    {

                        --this.furnaceItemStacks[1].stackSize;

 

                        if (this.furnaceItemStacks[1].stackSize == 0)

                        {

                            this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem().getContainerItemStack(furnaceItemStacks[1]);

                        }

                    }

                }

            }

 

            if (this.isBurning() && this.canSmelt())

            {

                ++this.furnaceCookTime;

 

                if (this.furnaceCookTime == 200)

                {

                    this.furnaceCookTime = 0;

                    this.smeltItem();

                    flag1 = true;

                }

            }

            else

            {

                this.furnaceCookTime = 0;

            }

 

            if (flag != this.furnaceBurnTime > 0)

            {

                flag1 = true;

                MachinePoweredMelter.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);

            }

        }

 

        if (flag1)

        {

            this.onInventoryChanged();

        }

    }

 

    /**

    * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc.

    */

    private boolean canSmelt()

    {

        if (this.furnaceItemStacks[0] == null)

        {

            return false;

        }

        else if(ModCore.machine_power_interface.blockID != worldObj.getBlockId(xCoord, yCoord-1, zCoord))

        {

        return false;

        }

        else

        {

            ItemStack itemstack = MachineMelterRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);

 

            if (itemstack == null)

            {

                return false;

            }

 

            if (this.furnaceItemStacks[2] == null)

            {

                return true;

            }

 

            if (!this.furnaceItemStacks[2].isItemEqual(itemstack))

            {

                return false;

            }

 

            int result = furnaceItemStacks[2].stackSize + itemstack.stackSize;

            return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());

        }

    }

 

    /**

    * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack

    */

    public void smeltItem()

    {

    TE_PowerInterface te_bottom = new TE_PowerInterface();

        if (this.canSmelt() && te_bottom.canConsume())

        {

        te_bottom.removeEnergy(te_bottom.getEnergyConsume());

        this.currentItemBurnTime += te_bottom.getEnergyConsume();

            ItemStack itemstack = MachineMelterRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);

 

            if (this.furnaceItemStacks[2] == null)

            {

                this.furnaceItemStacks[2] = itemstack.copy();

            }

            else if (this.furnaceItemStacks[2].isItemEqual(itemstack))

            {

                furnaceItemStacks[2].stackSize += itemstack.stackSize;

            }

 

            --this.furnaceItemStacks[0].stackSize;

 

            if (this.furnaceItemStacks[0].stackSize <= 0)

            {

                this.furnaceItemStacks[0] = null;

            }

        }

    }

 

    /**

    * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't

    * fuel

    */

    public static int getItemBurnTime(ItemStack par0ItemStack)

    {

        if (par0ItemStack == null)

        {

            return 0;

        }

        else

        {

            int i = par0ItemStack.getItem().itemID;

            Item item = par0ItemStack.getItem();

           

            if (i == ModCore.electrified_crystal.itemID)

            {

            return 200;

            }

 

            return GameRegistry.getFuelValue(par0ItemStack);

        }

    }

 

    /**

    * Return true if item is a fuel source (getItemBurnTime() > 0).

    */

    public static boolean isItemFuel(ItemStack par0ItemStack)

    {

        return getItemBurnTime(par0ItemStack) > 0;

    }

 

    /**

    * Do not make give this method the name canInteractWith because it clashes with Container

    */

    public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)

    {

        return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;

    }

 

    public void openChest() {}

 

    public void closeChest() {}

 

    /**

    * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.

    */

    public boolean isStackValidForSlot(int par1, ItemStack par2ItemStack)

    {

        return par1 == 2 ? false : (par1 == 1 ? isItemFuel(par2ItemStack) : true);

    }

 

    /**

    * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this

    * block.

    */

    public int[] getAccessibleSlotsFromSide(int par1)

    {

        return par1 == 0 ? field_102011_e : (par1 == 1 ? field_102010_d : field_102009_f);

    }

 

    /**

    * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item,

    * side

    */

    public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3)

    {

        return this.isStackValidForSlot(par1, par2ItemStack);

    }

 

    /**

    * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item,

    * side

    */

    public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3)

    {

        return par3 != 0 || par1 != 1 || par2ItemStack.itemID == Item.bucketEmpty.itemID;

    }

 

    /***********************************************************************************

    * This function is here for compatibilities sake, Modders should Check for

    * Sided before ContainerWorldly, Vanilla Minecraft does not follow the sided standard

    * that Modding has for a while.

    *

    * In vanilla:

    *

    *  Top: Ores

    *  Sides: Fuel

    *  Bottom: Output

    *

    * Standard Modding:

    *  Top: Ores

    *  Sides: Output

    *  Bottom: Fuel

    *

    * The Modding one is designed after the GUI, the vanilla one is designed because its

    * intended use is for the hopper, which logically would take things in from the top.

    *

    * This will possibly be removed in future updates, and make vanilla the definitive

    * standard.

    */

 

    @Override

    public int getStartInventorySide(ForgeDirection side)

    {

        if (ForgeDummyContainer.legacyFurnaceSides)

        {

            if (side == ForgeDirection.DOWN)

            {

                return 1;

            }

 

            if (side == ForgeDirection.UP)

            {

                return 0;

            }

 

            return 2;

        }

        else

        {

            if (side == ForgeDirection.DOWN)

            {

                return 2;

            }

 

            if (side == ForgeDirection.UP)

            {

                return 0;

            }

 

            return 1;

        }

    }

 

    @Override

    public int getSizeInventorySide(ForgeDirection side)

    {

        return 1;

    }

   

   

}

 

 

MachinePowerInterface

 

package mar21.omega.machine;

 

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

import mar21.omega.machine.tileEntity.TE_PowerInterface;

import mar21.omega.machine.tileEntity.TE_PoweredMelter;

import mar21.omega.mar21.Mar21Block;

 

public class MachinePowerInterface extends Mar21Block{

 

public MachinePowerInterface(int id, Material par2Material,

CreativeTabs par3CreativeTabs) {

super(id, par2Material, par3CreativeTabs);

}

 

    public TileEntity createNewTileEntity(World par1World)

    {

        return new TE_PowerInterface();

    }

   

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

    {

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

        TE_PowerInterface te_pi = new TE_PowerInterface();

        te_pi.InterfaceInit();

    }

 

}

 

 

TE_PowerInterface

 

package mar21.omega.machine.tileEntity;

 

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.tileentity.TileEntity;

 

public class TE_PowerInterface extends TileEntity{

private int currentEnergy;

private int energyConsume;

private int processSpeed;

private int maxEnergy;

private int progressSpeed;

private int baseConsume;

 

public void InterfaceInit()

{

setEnergy(111);//DEFAULT ENERGY AFTER PLACING THE BLOCK

setBaseConsume(100);//DEFAULT ENERGY CONSUMING AFTER PLACING THE BLOCK

setProcessSpeed(200);//DEFAULT SPEED FOR PROCESSING 1 TIME (200 - FURNACE SPEED)

setEnergyConsume(0);//DEFAULT 100 ENERGY FOR PROCESS

setProgressSpeed(0);//DEFAUL PROCESSING SPEED, 1 - NORMAL FURNACE SPEED

}

 

public void setEnergy(int Energy)//SETS CURRENT ENERGY HOLDING

{

if(this.currentEnergy + Energy >= this.maxEnergy)

{

this.currentEnergy = Energy;

}

this.currentEnergy = 0;

}

 

public void setBaseConsume(int Energy)

{

this.baseConsume = Energy;

}

 

public void setProcessSpeed(int Speed)

{

this.processSpeed = Speed;

}

 

public int sendEnergy(int Energy)//SENDS ENERGY TO CURRENT ENERGY HOLDING

{

if(this.currentEnergy + Energy > this.maxEnergy)

{

this.currentEnergy += Energy;

return this.currentEnergy;

}

return this.currentEnergy;

}

 

public int removeEnergy(int Energy)//REMOVE ENERGY FROM CURRENT ENERGY HOLDING

{

if(this.currentEnergy - Energy < 0)

{

this.currentEnergy -= Energy;

return this.currentEnergy;

}

return this.currentEnergy;

}

 

public int getEnergy()//GETS CURRENT ENERGY HOLDING

{

return this.currentEnergy;

}

 

public void setProgressSpeed(int SpeedU)//SETS PROCESSING SPEED//TODO

{

this.progressSpeed = this.processSpeed-(SpeedU*20);

}

 

public void setEnergyConsume(int EnergyU)//SETS ENERGY REQUIRED FOR 1 PROCESS//TODO

{

this.energyConsume = this.baseConsume-(EnergyU*10);

}

 

public int getProgressSpeed()//GETS PROCESSNG SPEED//TODO

{

return this.progressSpeed;

}

 

public int getEnergyConsume()//GETS ENERGY REQUIRED FOR 1 PROCESS//TODO

{

return this.energyConsume;

}

 

@Override

public void readFromNBT(NBTTagCompound tagCompound)

{

super.readFromNBT(tagCompound);

this.currentEnergy = tagCompound.getInteger("energy");

this.progressSpeed = tagCompound.getInteger("speed");

this.energyConsume = tagCompound.getInteger("consume");

}

 

@Override

public void writeToNBT(NBTTagCompound tagCompound)

{

super.writeToNBT(tagCompound);

        tagCompound.setInteger("energy", this.currentEnergy);

        tagCompound.setInteger("speed", this.progressSpeed);

        tagCompound.setInteger("consume", this.energyConsume);

}

 

public boolean canConsume() {

if(this.currentEnergy >= this.baseConsume)

{

return true;

}

return false;

}

}

 

 

 

When I solve this problem, I wish I do the upgrade gui :D

Thanks for you time!

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Link to comment
Share on other sites

 

                int meta = te.getBlockMetadata();
                int rotation = 0;
                if(meta == 2){rotation = 180;}//SOUTH
                if(meta == 3){rotation = 0;}//NORTH
                if(meta == 4){rotation = -90;}//EAST
                if(meta == 5){rotation = 90;}//WEST
                GL11.glRotatef(rotation, 0, 1, 0);

 

That code is giving me a crash.

 

Crash report:

 

 

 

 

      Minecraft has crashed!     

      ----------------------     

 

Minecraft has stopped running because it encountered a problem; Unexpected error

 

A full error report has been saved to C:\Users\Lars\Desktop\Modding-Development\mcp\jars\.\crash-reports\crash-2013-06-29_17.37.47-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(

 

 

 

--- BEGIN ERROR REPORT 19e0e28e --------

Full report at:

C:\Users\Lars\Desktop\Modding-Development\mcp\jars\.\crash-reports\crash-2013-06-29_17.37.47-client.txt

Please show that file to Mojang, NOT just this screen!

 

Generated 29-6-13 17:37

 

-- Head --

Stacktrace:

at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Larsg310'/262, l='MpServer', x=364,40, y=66,62, z=162,99]]

Chunk stats: MultiplayerChunkCache: 185

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (256,64,252), Chunk: (at 0,4,12 in 16,15; contains blocks 256,0,240 to 271,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 175755 game time, 84869 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 60 total; [EntityCow['Cow'/138, l='MpServer', x=286,78, y=64,00, z=114,72], EntityChicken['Chicken'/135, l='MpServer', x=286,84, y=66,00, z=85,81], EntityChicken['Chicken'/152, l='MpServer', x=294,53, y=64,00, z=237,47], EntityCow['Cow'/144, l='MpServer', x=291,28, y=66,00, z=92,88], EntityCow['Cow'/145, l='MpServer', x=303,91, y=64,00, z=95,81], EntityCow['Cow'/146, l='MpServer', x=294,22, y=64,00, z=104,84], EntityCow['Cow'/147, l='MpServer', x=289,75, y=64,00, z=109,88], EntityCow['Cow'/148, l='MpServer', x=294,75, y=63,00, z=138,19], EntityCow['Cow'/149, l='MpServer', x=301,22, y=64,00, z=147,22], EntitySquid['Squid'/150, l='MpServer', x=302,50, y=60,31, z=162,56], EntityCow['Cow'/151, l='MpServer', x=290,25, y=68,00, z=171,47], EntityCow['Cow'/171, l='MpServer', x=304,22, y=64,00, z=126,75], EntityChicken['Chicken'/170, l='MpServer', x=316,56, y=64,00, z=103,63], EntityChicken['Chicken'/169, l='MpServer', x=310,09, y=64,00, z=104,19], EntityCow['Cow'/168, l='MpServer', x=315,13, y=64,00, z=111,50], EntitySquid['Squid'/175, l='MpServer', x=305,50, y=60,00, z=162,50], EntitySquid['Squid'/174, l='MpServer', x=304,50, y=60,31, z=165,50], EntityBat['Bat'/311, l='MpServer', x=301,50, y=50,00, z=104,50], EntityCow['Cow'/173, l='MpServer', x=316,28, y=63,00, z=142,25], EntityCow['Cow'/172, l='MpServer', x=304,94, y=64,00, z=125,13], EntityBat['Bat'/313, l='MpServer', x=305,50, y=50,00, z=106,50], EntityClientPlayerMP['Larsg310'/262, l='MpServer', x=364,40, y=66,62, z=162,99], EntityBat['Bat'/314, l='MpServer', x=302,50, y=50,00, z=104,50], EntityBat['Bat'/316, l='MpServer', x=301,50, y=50,00, z=106,50], EntityBat['Bat'/187, l='MpServer', x=341,75, y=43,09, z=174,25], EntityChicken['Chicken'/184, l='MpServer', x=320,56, y=64,00, z=169,31], EntityChicken['Chicken'/185, l='MpServer', x=320,97, y=70,00, z=225,47], EntityBat['Bat'/191, l='MpServer', x=340,97, y=35,44, z=240,59], EntitySquid['Squid'/188, l='MpServer', x=347,13, y=52,00, z=195,50], EntityItem['item.item.dyePowder.black'/189, l='MpServer', x=346,38, y=51,13, z=193,88], EntityPig['Pig'/178, l='MpServer', x=335,31, y=65,00, z=88,13], EntityBat['Bat'/179, l='MpServer', x=334,75, y=27,03, z=94,22], EntityCow['Cow'/177, l='MpServer', x=333,38, y=66,00, z=87,53], EntityPig['Pig'/182, l='MpServer', x=321,03, y=64,00, z=118,97], EntityCow['Cow'/183, l='MpServer', x=328,03, y=64,00, z=131,09], EntityCow['Cow'/180, l='MpServer', x=331,50, y=65,00, z=99,63], EntityCow['Cow'/181, l='MpServer', x=320,91, y=64,00, z=107,22], EntityPig['Pig'/207, l='MpServer', x=391,25, y=77,00, z=117,09], EntityPig['Pig'/206, l='MpServer', x=387,16, y=76,00, z=98,91], EntityCow['Cow'/196, l='MpServer', x=353,72, y=64,00, z=118,72], EntityBat['Bat'/199, l='MpServer', x=370,78, y=42,09, z=172,25], EntityBat['Bat'/198, l='MpServer', x=369,25, y=41,09, z=170,25], EntityBat['Bat'/192, l='MpServer', x=343,47, y=35,00, z=239,53], EntityPig['Pig'/216, l='MpServer', x=405,75, y=74,00, z=85,94], EntityChicken['Chicken'/208, l='MpServer', x=388,47, y=78,00, z=122,34], EntityBat['Bat'/209, l='MpServer', x=391,00, y=28,94, z=185,75], EntityBat['Bat'/210, l='MpServer', x=392,25, y=57,09, z=199,47], EntityPig['Pig'/239, l='MpServer', x=439,53, y=64,00, z=212,31], EntityPig['Pig'/238, l='MpServer', x=432,09, y=64,00, z=176,91], EntityPig['Pig'/237, l='MpServer', x=439,97, y=65,00, z=139,09], EntityPig['Pig'/236, l='MpServer', x=433,31, y=64,00, z=125,88], EntityPig['Pig'/235, l='MpServer', x=437,47, y=64,00, z=118,56], EntityPig['Pig'/234, l='MpServer', x=434,94, y=68,00, z=95,97], EntityPig['Pig'/228, l='MpServer', x=431,44, y=63,00, z=221,75], EntityPig['Pig'/227, l='MpServer', x=427,75, y=64,00, z=175,50], EntityPig['Pig'/226, l='MpServer', x=429,72, y=64,00, z=164,31], EntityBat['Bat'/225, l='MpServer', x=421,00, y=53,00, z=128,59], EntitySquid['Squid'/224, l='MpServer', x=418,06, y=50,41, z=128,72], EntityPig['Pig'/242, l='MpServer', x=441,09, y=63,00, z=231,69], EntityPig['Pig'/240, l='MpServer', x=444,66, y=67,00, z=209,50]]

Retry entities: 0 total; []

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2414)

at net.minecraft.client.Minecraft.run(Minecraft.java:783)

at java.lang.Thread.run(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 8 (x86) version 6.2

Java Version: 1.7.0_21, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

Memory: 108893360 bytes (103 MB) / 240304128 bytes (229 MB) up to 259522560 bytes (247 MB)

JVM Flags: 0 total;

AABB Pool Size: 15750 (882000 bytes; 0 MB) allocated, 15750 (882000 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63

FML: MCP v7.51 FML v5.2.23.737 Minecraft Forge 7.8.1.737 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{5.2.23.737} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{7.8.1.737} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

bd{pre1b} [better Decorations] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

LWJGL: 2.4.2

OpenGL: AMD Radeon HD 7400G GL version 4.2.11931 Compatibility Profile Context, ATI Technologies Inc.

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: 37 (2072 bytes; 0 MB) allocated, 37 (2072 bytes; 0 MB) used

 

java.lang.NullPointerException

at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:999)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

at net.minecraft.client.Minecraft.run(Minecraft.java:760)

at java.lang.Thread.run(Unknown Source)

--- END ERROR REPORT 8b99da68 ----------

 

 

 

Error log:

 

---- Minecraft Crash Report ----

// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

 

Time: 29-6-13 17:37

Description: Unexpected error

 

java.lang.NullPointerException

at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:999)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

at net.minecraft.client.Minecraft.run(Minecraft.java:760)

at java.lang.Thread.run(Unknown Source)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Larsg310'/262, l='MpServer', x=364,40, y=66,62, z=162,99]]

Chunk stats: MultiplayerChunkCache: 185

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (256,64,252), Chunk: (at 0,4,12 in 16,15; contains blocks 256,0,240 to 271,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 175755 game time, 84869 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 60 total; [EntityCow['Cow'/138, l='MpServer', x=286,78, y=64,00, z=114,72], EntityChicken['Chicken'/135, l='MpServer', x=286,84, y=66,00, z=85,81], EntityChicken['Chicken'/152, l='MpServer', x=294,53, y=64,00, z=237,47], EntityCow['Cow'/144, l='MpServer', x=291,28, y=66,00, z=92,88], EntityCow['Cow'/145, l='MpServer', x=303,91, y=64,00, z=95,81], EntityCow['Cow'/146, l='MpServer', x=294,22, y=64,00, z=104,84], EntityCow['Cow'/147, l='MpServer', x=289,75, y=64,00, z=109,88], EntityCow['Cow'/148, l='MpServer', x=294,75, y=63,00, z=138,19], EntityCow['Cow'/149, l='MpServer', x=301,22, y=64,00, z=147,22], EntitySquid['Squid'/150, l='MpServer', x=302,50, y=60,31, z=162,56], EntityCow['Cow'/151, l='MpServer', x=290,25, y=68,00, z=171,47], EntityCow['Cow'/171, l='MpServer', x=304,22, y=64,00, z=126,75], EntityChicken['Chicken'/170, l='MpServer', x=316,56, y=64,00, z=103,63], EntityChicken['Chicken'/169, l='MpServer', x=310,09, y=64,00, z=104,19], EntityCow['Cow'/168, l='MpServer', x=315,13, y=64,00, z=111,50], EntitySquid['Squid'/175, l='MpServer', x=305,50, y=60,00, z=162,50], EntitySquid['Squid'/174, l='MpServer', x=304,50, y=60,31, z=165,50], EntityBat['Bat'/311, l='MpServer', x=301,50, y=50,00, z=104,50], EntityCow['Cow'/173, l='MpServer', x=316,28, y=63,00, z=142,25], EntityCow['Cow'/172, l='MpServer', x=304,94, y=64,00, z=125,13], EntityBat['Bat'/313, l='MpServer', x=305,50, y=50,00, z=106,50], EntityClientPlayerMP['Larsg310'/262, l='MpServer', x=364,40, y=66,62, z=162,99], EntityBat['Bat'/314, l='MpServer', x=302,50, y=50,00, z=104,50], EntityBat['Bat'/316, l='MpServer', x=301,50, y=50,00, z=106,50], EntityBat['Bat'/187, l='MpServer', x=341,75, y=43,09, z=174,25], EntityChicken['Chicken'/184, l='MpServer', x=320,56, y=64,00, z=169,31], EntityChicken['Chicken'/185, l='MpServer', x=320,97, y=70,00, z=225,47], EntityBat['Bat'/191, l='MpServer', x=340,97, y=35,44, z=240,59], EntitySquid['Squid'/188, l='MpServer', x=347,13, y=52,00, z=195,50], EntityItem['item.item.dyePowder.black'/189, l='MpServer', x=346,38, y=51,13, z=193,88], EntityPig['Pig'/178, l='MpServer', x=335,31, y=65,00, z=88,13], EntityBat['Bat'/179, l='MpServer', x=334,75, y=27,03, z=94,22], EntityCow['Cow'/177, l='MpServer', x=333,38, y=66,00, z=87,53], EntityPig['Pig'/182, l='MpServer', x=321,03, y=64,00, z=118,97], EntityCow['Cow'/183, l='MpServer', x=328,03, y=64,00, z=131,09], EntityCow['Cow'/180, l='MpServer', x=331,50, y=65,00, z=99,63], EntityCow['Cow'/181, l='MpServer', x=320,91, y=64,00, z=107,22], EntityPig['Pig'/207, l='MpServer', x=391,25, y=77,00, z=117,09], EntityPig['Pig'/206, l='MpServer', x=387,16, y=76,00, z=98,91], EntityCow['Cow'/196, l='MpServer', x=353,72, y=64,00, z=118,72], EntityBat['Bat'/199, l='MpServer', x=370,78, y=42,09, z=172,25], EntityBat['Bat'/198, l='MpServer', x=369,25, y=41,09, z=170,25], EntityBat['Bat'/192, l='MpServer', x=343,47, y=35,00, z=239,53], EntityPig['Pig'/216, l='MpServer', x=405,75, y=74,00, z=85,94], EntityChicken['Chicken'/208, l='MpServer', x=388,47, y=78,00, z=122,34], EntityBat['Bat'/209, l='MpServer', x=391,00, y=28,94, z=185,75], EntityBat['Bat'/210, l='MpServer', x=392,25, y=57,09, z=199,47], EntityPig['Pig'/239, l='MpServer', x=439,53, y=64,00, z=212,31], EntityPig['Pig'/238, l='MpServer', x=432,09, y=64,00, z=176,91], EntityPig['Pig'/237, l='MpServer', x=439,97, y=65,00, z=139,09], EntityPig['Pig'/236, l='MpServer', x=433,31, y=64,00, z=125,88], EntityPig['Pig'/235, l='MpServer', x=437,47, y=64,00, z=118,56], EntityPig['Pig'/234, l='MpServer', x=434,94, y=68,00, z=95,97], EntityPig['Pig'/228, l='MpServer', x=431,44, y=63,00, z=221,75], EntityPig['Pig'/227, l='MpServer', x=427,75, y=64,00, z=175,50], EntityPig['Pig'/226, l='MpServer', x=429,72, y=64,00, z=164,31], EntityBat['Bat'/225, l='MpServer', x=421,00, y=53,00, z=128,59], EntitySquid['Squid'/224, l='MpServer', x=418,06, y=50,41, z=128,72], EntityPig['Pig'/242, l='MpServer', x=441,09, y=63,00, z=231,69], EntityPig['Pig'/240, l='MpServer', x=444,66, y=67,00, z=209,50]]

Retry entities: 0 total; []

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2414)

at net.minecraft.client.Minecraft.run(Minecraft.java:783)

at java.lang.Thread.run(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 8 (x86) version 6.2

Java Version: 1.7.0_21, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

Memory: 108893360 bytes (103 MB) / 240304128 bytes (229 MB) up to 259522560 bytes (247 MB)

JVM Flags: 0 total;

AABB Pool Size: 15750 (882000 bytes; 0 MB) allocated, 15750 (882000 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63

FML: MCP v7.51 FML v5.2.23.737 Minecraft Forge 7.8.1.737 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{5.2.23.737} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{7.8.1.737} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

bd{pre1b} [better Decorations] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

LWJGL: 2.4.2

OpenGL: AMD Radeon HD 7400G GL version 4.2.11931 Compatibility Profile Context, ATI Technologies Inc.

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: 37 (2072 bytes; 0 MB) allocated, 37 (2072 bytes; 0 MB) used

 

Eclipse log:

 

2013-06-29 17:37:16 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.737 for Minecraft 1.5.2 loading

2013-06-29 17:37:16 [iNFO] [ForgeModLoader] Java is Java HotSpot Client VM, version 1.7.0_21, running on Windows 8:x86:6.2, installed at C:\Program Files (x86)\Java\jre7

2013-06-29 17:37:16 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

2013-06-29 17:37:19 [iNFO] [sTDOUT] 229 recipes

2013-06-29 17:37:19 [iNFO] [sTDOUT] 27 achievements

2013-06-29 17:37:19 [iNFO] [Minecraft-Client] Setting user: Larsg310

2013-06-29 17:37:19 [iNFO] [sTDOUT] (Session ID is -)

2013-06-29 17:37:19 [iNFO] [sTDERR] Client asked for parameter: server

2013-06-29 17:37:19 [iNFO] [Minecraft-Client] LWJGL Version: 2.4.2

2013-06-29 17:37:20 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization

2013-06-29 17:37:20 [iNFO] [sTDOUT] MinecraftForge v7.8.1.737 Initialized

2013-06-29 17:37:20 [iNFO] [ForgeModLoader] MinecraftForge v7.8.1.737 Initialized

2013-06-29 17:37:20 [iNFO] [sTDOUT] Replaced 85 ore recipies

2013-06-29 17:37:20 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization

2013-06-29 17:37:20 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Lars\Desktop\Modding-Development\mcp\jars\config\logging.properties

2013-06-29 17:37:20 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL

2013-06-29 17:37:21 [iNFO] [ForgeModLoader] Searching C:\Users\Lars\Desktop\Modding-Development\mcp\jars\mods for mods

2013-06-29 17:37:23 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load

2013-06-29 17:37:23 [iNFO] [mcp] Activating mod mcp

2013-06-29 17:37:23 [iNFO] [FML] Activating mod FML

2013-06-29 17:37:23 [iNFO] [Forge] Activating mod Forge

2013-06-29 17:37:23 [iNFO] [bd] Activating mod bd

2013-06-29 17:37:23 [iNFO] [ForgeModLoader] Registering Forge Packet Handler

2013-06-29 17:37:23 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler

2013-06-29 17:37:23 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0

2013-06-29 17:37:23 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file mods/bd/textures/blocks/tile.trafficLightRed.png, but that file does not exist. Ignoring.

2013-06-29 17:37:24 [iNFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled

2013-06-29 17:37:24 [iNFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt

2013-06-29 17:37:24 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt

2013-06-29 17:37:24 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods

2013-06-29 17:37:25 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file mods/bd/textures/blocks/tile.trafficLightRed.png, but that file does not exist. Ignoring.

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt

2013-06-29 17:37:25 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt

2013-06-29 17:37:29 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2

2013-06-29 17:37:29 [iNFO] [Minecraft-Server] Generating keypair

2013-06-29 17:37:30 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@fd50f6)

2013-06-29 17:37:30 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@fd50f6)

2013-06-29 17:37:30 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@fd50f6)

2013-06-29 17:37:30 [iNFO] [Minecraft-Server] Preparing start region for level 0

2013-06-29 17:37:31 [iNFO] [Minecraft-Server] Preparing spawn area: 68%

2013-06-29 17:37:32 [iNFO] [sTDOUT] loading single player

2013-06-29 17:37:32 [iNFO] [Minecraft-Server] Larsg310[/127.0.0.1:0] logged in with entity id 262 at (364.3972261761597, 65.0, 162.99346371427606)

2013-06-29 17:37:35 [iNFO] [Minecraft-Server] Stopping server

2013-06-29 17:37:35 [iNFO] [Minecraft-Server] Saving players

2013-06-29 17:37:35 [iNFO] [Minecraft-Server] Saving worlds

2013-06-29 17:37:35 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld

2013-06-29 17:37:35 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether

2013-06-29 17:37:35 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End

2013-06-29 17:37:37 [iNFO] [ForgeModLoader] Unloading dimension 0

2013-06-29 17:37:37 [iNFO] [ForgeModLoader] Unloading dimension -1

2013-06-29 17:37:37 [iNFO] [ForgeModLoader] Unloading dimension 1

2013-06-29 17:37:37 [iNFO] [sTDERR] java.lang.NullPointerException

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

2013-06-29 17:37:37 [iNFO] [sTDERR] at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:999)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

2013-06-29 17:37:37 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:760)

2013-06-29 17:37:37 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)

2013-06-29 17:37:47 [iNFO] [Minecraft-Client] Stopping!

2013-06-29 17:42:55 [iNFO] [sTDERR] Someone is closing me!

 

 

 

ItemTrafficLightRenderer.java:

 

package mod.larsg310.bd.render;

import mod.larsg310.bd.model.ModelTrafficLight;
import mod.larsg310.bd.tileentity.TileEntityTrafficLight;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;

public class ItemTrafficLightRenderer implements IItemRenderer
{
    private ModelTrafficLight model;
    
    public ItemTrafficLightRenderer()
    {
        model = new ModelTrafficLight();
    }
    @Override
    public boolean handleRenderType(ItemStack itemstack, ItemRenderType type)
    {
        return true;
    }
    @Override
    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
    {
        return true;
    }
    @Override
    public void renderItem(ItemRenderType type, ItemStack item, Object... data)
    {
        TileEntityRenderer.instance.renderTileEntityAt(new TileEntityTrafficLight(), 0.0D, 0.0D, 0.0D, 0.0F);
    }
}

 

 

TileEntityTrafficLightRenderer.java:

 

package mod.larsg310.bd.render;

import mod.larsg310.bd.lib.Strings;
import mod.larsg310.bd.model.ModelTrafficLight;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

import org.lwjgl.opengl.GL11;

public class TileEntityTrafficLightRenderer extends TileEntitySpecialRenderer
{
public static int meta;

    private ModelTrafficLight model;
    
    public TileEntityTrafficLightRenderer()
    {
        model = new ModelTrafficLight();
    }
    @Override
    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f)
    {
        bindTextureByName(Strings.MODEL_TEXTURE + "modelTrafficLight.png");
        GL11.glPushMatrix();
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
        GL11.glScalef(1.0F, -1F, -1F);
        int meta = te.getBlockMetadata();
        int rotation = 0;
        if(meta == 2){rotation = 180;}//SOUTH
        if(meta == 3){rotation = 0;}//NORTH
        if(meta == 4){rotation = -90;}//EAST
        if(meta == 5){rotation = 90;}//WEST
        GL11.glRotatef(rotation, 0, 1, 0);
        model.renderModel(0.0625F);
        GL11.glPopMatrix();
    }
}

 

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

In your file, you posted, the TileEntityTrafficLightRenderer.java

I think you need this imports:

import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

Try this:

 

package mod.larsg310.bd.render;

 

import mod.larsg310.bd.lib.Strings;

import mod.larsg310.bd.model.ModelTrafficLight;

import net.minecraft.block.Block;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;[/

 

import org.lwjgl.opengl.GL11;

 

public class TileEntityTrafficLightRenderer extends TileEntitySpecialRenderer

{

    private final ModelTrafficLight model;

   

    public TileEntityTrafficLightRenderer()

    {

        this.model = new ModelTrafficLight();

    }

    @Override

    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f)

    {

        GL11.glPushMatrix();

        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);

        int meta = te.getBlockMetadata();

        int rotation = 0;

        if(meta == 2){rotation = 180;}//SOUTH

        if(meta == 3){rotation = 0;}//NORTH

        if(meta == 4){rotation = -90;}//EAST

        if(meta == 5){rotation = 90;}//WEST

        GL11.glRotatef(rotation, 0, 1, 0);

        GL11.glScalef(1.0F, -1F, -1F);

        bindTextureByName(Strings.MODEL_TEXTURE + "modelTrafficLight.png");

        GL11.glPushMatrix();

        GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

        this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

        GL11.glPopMatrix();

        GL11.glPopMatrix();

 

    }

}

 

And try the CTRL + SHIFT + O

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Link to comment
Share on other sites

In your file, you posted, the TileEntityTrafficLightRenderer.java

I think you need this imports:

import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

Try this:

 

package mod.larsg310.bd.render;

 

import mod.larsg310.bd.lib.Strings;

import mod.larsg310.bd.model.ModelTrafficLight;

import net.minecraft.block.Block;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;[/

 

import org.lwjgl.opengl.GL11;

 

public class TileEntityTrafficLightRenderer extends TileEntitySpecialRenderer

{

    private final ModelTrafficLight model;

   

    public TileEntityTrafficLightRenderer()

    {

        this.model = new ModelTrafficLight();

    }

    @Override

    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f)

    {

        GL11.glPushMatrix();

        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);

        int meta = te.getBlockMetadata();

        int rotation = 0;

        if(meta == 2){rotation = 180;}//SOUTH

        if(meta == 3){rotation = 0;}//NORTH

        if(meta == 4){rotation = -90;}//EAST

        if(meta == 5){rotation = 90;}//WEST

        GL11.glRotatef(rotation, 0, 1, 0);

        GL11.glScalef(1.0F, -1F, -1F);

        bindTextureByName(Strings.MODEL_TEXTURE + "modelTrafficLight.png");

        GL11.glPushMatrix();

        GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

        this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

        GL11.glPopMatrix();

        GL11.glPopMatrix();

 

    }

}

 

And try the CTRL + SHIFT + O

 

It still gives me an error:

 

 

      Minecraft has crashed!     

      ----------------------     

 

Minecraft has stopped running because it encountered a problem; Unexpected error

 

A full error report has been saved to C:\Users\Lars\Desktop\Modding-Development\mcp\jars\.\crash-reports\crash-2013-06-29_19.51.19-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(

 

 

 

--- BEGIN ERROR REPORT 5684323d --------

Full report at:

C:\Users\Lars\Desktop\Modding-Development\mcp\jars\.\crash-reports\crash-2013-06-29_19.51.19-client.txt

Please show that file to Mojang, NOT just this screen!

 

Generated 29-6-13 19:51

 

-- Head --

Stacktrace:

at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Larsg310'/267, l='MpServer', x=364,40, y=66,62, z=162,99]]

Chunk stats: MultiplayerChunkCache: 165

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (256,64,252), Chunk: (at 0,4,12 in 16,15; contains blocks 256,0,240 to 271,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 175909 game time, 85023 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 60 total; [EntityCow['Cow'/138, l='MpServer', x=285,94, y=64,00, z=110,97], EntityChicken['Chicken'/135, l='MpServer', x=286,84, y=66,00, z=85,81], EntityCow['Cow'/152, l='MpServer', x=290,25, y=68,00, z=171,47], EntityChicken['Chicken'/153, l='MpServer', x=294,53, y=64,00, z=237,47], EntityCow['Cow'/145, l='MpServer', x=295,63, y=66,00, z=91,22], EntityCow['Cow'/146, l='MpServer', x=303,47, y=64,00, z=91,53], EntityBat['Bat'/147, l='MpServer', x=302,97, y=50,34, z=105,50], EntityCow['Cow'/148, l='MpServer', x=294,22, y=64,00, z=104,84], EntityCow['Cow'/149, l='MpServer', x=289,75, y=64,00, z=109,88], EntityCow['Cow'/150, l='MpServer', x=294,75, y=63,00, z=138,19], EntityCow['Cow'/151, l='MpServer', x=301,22, y=64,00, z=147,22], EntityBat['Bat'/171, l='MpServer', x=306,25, y=50,28, z=106,00], EntityBat['Bat'/170, l='MpServer', x=307,53, y=50,63, z=106,97], EntityBat['Bat'/169, l='MpServer', x=307,41, y=50,44, z=108,06], EntityCow['Cow'/175, l='MpServer', x=304,94, y=64,00, z=125,13], EntityCow['Cow'/174, l='MpServer', x=304,22, y=64,00, z=126,75], EntityChicken['Chicken'/173, l='MpServer', x=316,56, y=64,00, z=103,63], EntityChicken['Chicken'/172, l='MpServer', x=310,09, y=64,00, z=104,19], EntityClientPlayerMP['Larsg310'/267, l='MpServer', x=364,40, y=66,62, z=162,99], EntityCow['Cow'/186, l='MpServer', x=320,91, y=64,00, z=107,22], EntityPig['Pig'/187, l='MpServer', x=321,03, y=64,00, z=118,97], EntityPig['Pig'/184, l='MpServer', x=335,31, y=65,00, z=88,13], EntityCow['Cow'/185, l='MpServer', x=331,50, y=65,00, z=99,63], EntityChicken['Chicken'/190, l='MpServer', x=327,22, y=70,00, z=225,16], EntityCow['Cow'/188, l='MpServer', x=323,69, y=64,00, z=127,75], EntityChicken['Chicken'/189, l='MpServer', x=320,56, y=64,00, z=169,31], EntitySquid['Squid'/178, l='MpServer', x=305,50, y=60,34, z=164,47], EntitySquid['Squid'/179, l='MpServer', x=304,34, y=60,00, z=164,06], EntityCow['Cow'/176, l='MpServer', x=316,53, y=64,00, z=112,78], EntityCow['Cow'/177, l='MpServer', x=317,50, y=64,00, z=141,56], EntityBat['Bat'/182, l='MpServer', x=333,41, y=27,44, z=94,13], EntityCow['Cow'/183, l='MpServer', x=333,38, y=66,00, z=87,53], EntitySquid['Squid'/180, l='MpServer', x=304,50, y=60,19, z=161,78], EntityBat['Bat'/204, l='MpServer', x=370,78, y=42,09, z=172,25], EntityCow['Cow'/200, l='MpServer', x=353,72, y=64,00, z=118,72], EntityBat['Bat'/203, l='MpServer', x=369,25, y=41,09, z=170,25], EntityBat['Bat'/196, l='MpServer', x=345,75, y=34,97, z=242,75], EntitySquid['Squid'/193, l='MpServer', x=346,63, y=51,91, z=193,03], EntityBat['Bat'/192, l='MpServer', x=341,75, y=43,09, z=174,25], EntityBat['Bat'/195, l='MpServer', x=342,97, y=34,91, z=241,53], EntityItem['item.item.dyePowder.black'/194, l='MpServer', x=346,38, y=51,13, z=193,88], EntityPig['Pig'/220, l='MpServer', x=405,75, y=74,00, z=85,94], EntityPig['Pig'/212, l='MpServer', x=391,25, y=77,00, z=117,09], EntityChicken['Chicken'/213, l='MpServer', x=388,47, y=78,00, z=122,34], EntityBat['Bat'/214, l='MpServer', x=391,88, y=27,91, z=184,97], EntityBat['Bat'/215, l='MpServer', x=392,25, y=57,09, z=199,47], EntityPig['Pig'/211, l='MpServer', x=387,16, y=76,00, z=98,91], EntityPig['Pig'/234, l='MpServer', x=431,44, y=63,00, z=221,75], EntityPig['Pig'/233, l='MpServer', x=427,97, y=64,00, z=179,94], EntityPig['Pig'/232, l='MpServer', x=427,75, y=64,00, z=175,50], EntityPig['Pig'/231, l='MpServer', x=429,72, y=64,00, z=164,31], EntitySquid['Squid'/230, l='MpServer', x=417,50, y=50,38, z=130,50], EntityBat['Bat'/229, l='MpServer', x=418,06, y=52,00, z=131,44], EntityPig['Pig'/248, l='MpServer', x=441,09, y=63,00, z=231,69], EntityPig['Pig'/246, l='MpServer', x=444,66, y=67,00, z=209,50], EntityPig['Pig'/244, l='MpServer', x=438,91, y=65,00, z=139,19], EntityPig['Pig'/245, l='MpServer', x=439,53, y=64,00, z=212,31], EntityPig['Pig'/242, l='MpServer', x=437,47, y=64,00, z=118,56], EntityPig['Pig'/243, l='MpServer', x=433,31, y=64,00, z=125,88], EntityPig['Pig'/241, l='MpServer', x=434,94, y=68,00, z=95,97]]

Retry entities: 0 total; []

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2414)

at net.minecraft.client.Minecraft.run(Minecraft.java:783)

at java.lang.Thread.run(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 8 (x86) version 6.2

Java Version: 1.7.0_21, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

Memory: 97676944 bytes (93 MB) / 229113856 bytes (218 MB) up to 259522560 bytes (247 MB)

JVM Flags: 0 total;

AABB Pool Size: 15750 (882000 bytes; 0 MB) allocated, 15750 (882000 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63

FML: MCP v7.51 FML v5.2.23.737 Minecraft Forge 7.8.1.737 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{5.2.23.737} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{7.8.1.737} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

bd{pre1b} [better Decorations] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

LWJGL: 2.4.2

OpenGL: AMD Radeon HD 7400G GL version 4.2.11931 Compatibility Profile Context, ATI Technologies Inc.

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: 37 (2072 bytes; 0 MB) allocated, 37 (2072 bytes; 0 MB) used

 

java.lang.NullPointerException

at net.minecraft.tileentity.TileEntity.getBlockType(TileEntity.java:223)

at net.minecraft.tileentity.TileEntity.func_85027_a(TileEntity.java:282)

at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:178)

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:856)

at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:184)

at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:127)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:999)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

at net.minecraft.client.Minecraft.run(Minecraft.java:760)

at java.lang.Thread.run(Unknown Source)

--- END ERROR REPORT 2c44ce2f ----------

 

 

 

On the line 11 before the end it says:

at mod.larsg310.bd.render.ItemTrafficLightRenderer.renderItem(ItemTrafficLightRenderer.java:30)

And that is this line:

TileEntityRenderer.instance.renderTileEntityAt(new TileEntityTrafficLight(), 0.0D, 0.0D, 0.0D, 0.0F);

 

And thats in in the method:

@Override
    public void renderItem(ItemRenderType type, ItemStack item, Object... data)
    {
        TileEntityRenderer.instance.renderTileEntityAt(new TileEntityTrafficLight(), 0.0D, 0.0D, 0.0D, 0.0F);
    }

 

If anyone knows a solution, I would very appriciate that!

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

E, yes!

TileEntityRenderer.instance.renderTileEntityAt(new TileEntityTrafficLight(), 0.0D, 0.0D, 0.0D, 0.0F);

this is doing me error too!

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Link to comment
Share on other sites

E, yes!

TileEntityRenderer.instance.renderTileEntityAt(new TileEntityTrafficLight(), 0.0D, 0.0D, 0.0D, 0.0F);

this is doing me error too!

 

So if anyone knows a solution to that, I (we) would appriciate that.

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

E, yes!

TileEntityRenderer.instance.renderTileEntityAt(new TileEntityTrafficLight(), 0.0D, 0.0D, 0.0D, 0.0F);

this is doing me error too!

 

So if anyone knows a solution to that, I (we) would appriciate that.

 

It's kinda weird, that isn't the bugged line.

I changed this line of code:

int meta = te.getBlockMetadata();
int rotation = 0;
        if(meta == 2){rotation = 180;}//SOUTH
        if(meta == 3){rotation = 0;}//NORTH
        if(meta == 4){rotation = -90;}//EAST
        if(meta == 5){rotation = 90;}//WEST

to:

int meta = 0;
        if(te.worldObj != null)
        {
        	meta = te.worldObj.getBlockMetadata((int)x,(int)y,(int)z);
        }
        int rotation = 0;
        if(meta == 2){rotation = 180;}//SOUTH
        if(meta == 3){rotation = 0;}//NORTH
        if(meta == 4){rotation = -90;}//EAST
        if(meta == 5){rotation = 90;}//WEST

 

Now it doesn't crash anymore, but when I add:

System.out.println(meta);

and it seems like meta is always 0...

If anyone knows why that is

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

I dont, know, I am using this code for my custom model of my custom furnace, so I using the basic furnace metadata with side, where you placed, based on player looking.

It work for me pretty well. You need the rotating thing in the YourBlock class...

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

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.