Jump to content

[1.6.4] Creating new chest problem......texture {Solved}


ASHninja1997

Recommended Posts

Hello,

 

I came to the forums today to ask for some help with making a new chest. So far everything is working as it should besides the fact that my texture won't load. The new chest I made generates a new chest with the default skin not the skin or texture I made for it. Now the strange part is when I break it the particles resulting from the break take the form of the texture I made. I will list some pictures of what I mean.

 

What you see for both the regular and crystal chests

33dwpxf.png

 

On break regular chest

9zomyh.png

 

On break crystal chest

1679ykh.png

 

And here is a look at my Minecraft eclipse project folder

2rqk4gm.jpg

 

 

Below is a list of the class files I have used to make the Crystal Chest

 

Main

 

public static Block orb_crystal_chest;

 

orb_crystal_chest = new OrbChest(2092, 0).setUnlocalizedName("orb_crystal_chest").setHardness(24.0F).setStepSound(Block.soundMetalFootstep).setResistance(2000.0F);

GameRegistry.registerBlock(orb_crystal_chest, modid + (orb_crystal_chest.getUnlocalizedName().substring(5)));

LanguageRegistry.addName(orb_crystal_chest, "Crystal Chest");

 

GameRegistry.registerTileEntity(TileEntityOrbChest.class, "tileentityorbchest");

 

ClientProxy.registerRenderThings();

 

 

ClientProxy

 

package Crystalorb;

 

import net.minecraftforge.client.MinecraftForgeClient;

import cpw.mods.fml.client.registry.ClientRegistry;

 

public class ClientProxy {

 

public static void registerRenderThings(){

 

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOrbChest.class, new TileEntityOrbChestRender());

MinecraftForgeClient.registerItemRenderer(Main.orb_crystal_chest.blockID, new ItemOrbChestRender());

}

}

 

 

ItemOrbChestRender

 

package Crystalorb;

 

import net.minecraft.client.model.ModelChest;

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

import net.minecraft.item.ItemStack;

import net.minecraftforge.client.IItemRenderer;

 

public class ItemOrbChestRender implements IItemRenderer {

 

private ModelChest chestModel;

 

public ItemOrbChestRender(){

chestModel = new ModelChest();

}

 

@Override

public boolean handleRenderType(ItemStack item, ItemRenderType type) {

// TODO Auto-generated method stub

return true;

}

 

@Override

public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,

ItemRendererHelper helper) {

// TODO Auto-generated method stub

return true;

}

 

@Override

public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

 

TileEntityRenderer.instance.renderTileEntityAt(new TileEntityOrbChest(), 0.0D, 0.0D, 0.0D, 0.0f);

 

}

 

}

 

 

TileEntityorbChest

 

package Crystalorb;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import java.util.Iterator;

import java.util.List;

 

import net.minecraft.block.Block;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.ContainerChest;

import net.minecraft.inventory.IInventory;

import net.minecraft.inventory.InventoryLargeChest;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.nbt.NBTTagList;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.AxisAlignedBB;

 

public class TileEntityOrbChest extends TileEntity implements IInventory

{

    private ItemStack[] chestContents = new ItemStack[36];

 

    /** Determines if the check for adjacent chests has taken place. */

    public boolean adjacentChestChecked;

 

    /** Contains the chest tile located adjacent to this one (if any) */

    public TileEntityOrbChest adjacentChestZNeg;

 

    /** Contains the chest tile located adjacent to this one (if any) */

    public TileEntityOrbChest adjacentChestXPos;

 

    /** Contains the chest tile located adjacent to this one (if any) */

    public TileEntityOrbChest adjacentChestXNeg;

 

    /** Contains the chest tile located adjacent to this one (if any) */

    public TileEntityOrbChest adjacentChestZPosition;

 

    /** The current angle of the lid (between 0 and 1) */

    public float lidAngle;

 

    /** The angle of the lid last tick */

    public float prevLidAngle;

 

    /** The number of players currently using this chest */

    public int numUsingPlayers;

 

    /** Server sync counter (once per 20 ticks) */

    private int ticksSinceSync;

    private int cachedChestType;

    private String customName;

 

    public TileEntityOrbChest()

    {

        this.cachedChestType = -1;

    }

 

    @SideOnly(Side.CLIENT)

    public TileEntityOrbChest(int par1)

    {

        this.cachedChestType = par1;

    }

 

    /**

    * Returns the number of slots in the inventory.

    */

    public int getSizeInventory()

    {

        return 27;

    }

 

    /**

    * Returns the stack in slot i

    */

    public ItemStack getStackInSlot(int par1)

    {

        return this.chestContents[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.chestContents[par1] != null)

        {

            ItemStack itemstack;

 

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

            {

                itemstack = this.chestContents[par1];

                this.chestContents[par1] = null;

                this.onInventoryChanged();

                return itemstack;

            }

            else

            {

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

 

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

                {

                    this.chestContents[par1] = null;

                }

 

                this.onInventoryChanged();

                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.chestContents[par1] != null)

        {

            ItemStack itemstack = this.chestContents[par1];

            this.chestContents[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.chestContents[par1] = par2ItemStack;

 

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

        {

            par2ItemStack.stackSize = this.getInventoryStackLimit();

        }

 

        this.onInventoryChanged();

    }

 

    /**

    * Returns the name of the inventory.

    */

    public String getInvName()

    {

        return this.isInvNameLocalized() ? this.customName : "Crystal Chest";

    }

 

    /**

    * 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.customName != null && this.customName.length() > 0;

    }

 

    /**

    * Sets the custom display name to use when opening a GUI for this specific TileEntityChest.

    */

    public void setChestGuiName(String par1Str)

    {

        this.customName = par1Str;

    }

 

    /**

    * Reads a tile entity from NBT.

    */

    public void readFromNBT(NBTTagCompound par1NBTTagCompound)

    {

        super.readFromNBT(par1NBTTagCompound);

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

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

 

        if (par1NBTTagCompound.hasKey("Crystal Chest"))

        {

            this.customName = par1NBTTagCompound.getString("Crystal Chest");

        }

 

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

        {

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

            int j = nbttagcompound1.getByte("Slot") & 255;

 

            if (j >= 0 && j < this.chestContents.length)

            {

                this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);

            }

        }

    }

 

    /**

    * Writes a tile entity to NBT.

    */

    public void writeToNBT(NBTTagCompound par1NBTTagCompound)

    {

        super.writeToNBT(par1NBTTagCompound);

        NBTTagList nbttaglist = new NBTTagList();

 

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

        {

            if (this.chestContents != null)

            {

                NBTTagCompound nbttagcompound1 = new NBTTagCompound();

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

                this.chestContents.writeToNBT(nbttagcompound1);

                nbttaglist.appendTag(nbttagcompound1);

            }

        }

 

        par1NBTTagCompound.setTag("Items", nbttaglist);

 

        if (this.isInvNameLocalized())

        {

            par1NBTTagCompound.setString("Crystal Chest", this.customName);

        }

    }

 

    /**

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

    }

 

    /**

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

    }

 

    /**

    * Causes the TileEntity to reset all it's cached values for it's container block, blockID, metaData and in the case

    * of chests, the adjcacent chest check

    */

    public void updateContainingBlockInfo()

    {

        super.updateContainingBlockInfo();

        this.adjacentChestChecked = false;

    }

 

    private void func_90009_a(TileEntityOrbChest par1TileEntityChest, int par2)

    {

        if (par1TileEntityChest.isInvalid())

        {

            this.adjacentChestChecked = false;

        }

        else if (this.adjacentChestChecked)

        {

            switch (par2)

            {

                case 0:

                    if (this.adjacentChestZPosition != par1TileEntityChest)

                    {

                        this.adjacentChestChecked = false;

                    }

 

                    break;

                case 1:

                    if (this.adjacentChestXNeg != par1TileEntityChest)

                    {

                        this.adjacentChestChecked = false;

                    }

 

                    break;

                case 2:

                    if (this.adjacentChestZNeg != par1TileEntityChest)

                    {

                        this.adjacentChestChecked = false;

                    }

 

                    break;

                case 3:

                    if (this.adjacentChestXPos != par1TileEntityChest)

                    {

                        this.adjacentChestChecked = false;

                    }

            }

        }

    }

 

    /**

    * Performs the check for adjacent chests to determine if this chest is double or not.

    */

    public void checkForAdjacentChests()

    {

        if (!this.adjacentChestChecked)

        {

            this.adjacentChestChecked = true;

            this.adjacentChestZNeg = null;

            this.adjacentChestXPos = null;

            this.adjacentChestXNeg = null;

            this.adjacentChestZPosition = null;

 

            if (this.func_94044_a(this.xCoord - 1, this.yCoord, this.zCoord))

            {

                this.adjacentChestXNeg = (TileEntityOrbChest)this.worldObj.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord);

            }

 

            if (this.func_94044_a(this.xCoord + 1, this.yCoord, this.zCoord))

            {

                this.adjacentChestXPos = (TileEntityOrbChest)this.worldObj.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord);

            }

 

            if (this.func_94044_a(this.xCoord, this.yCoord, this.zCoord - 1))

            {

                this.adjacentChestZNeg = (TileEntityOrbChest)this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1);

            }

 

            if (this.func_94044_a(this.xCoord, this.yCoord, this.zCoord + 1))

            {

                this.adjacentChestZPosition = (TileEntityOrbChest)this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1);

            }

 

            if (this.adjacentChestZNeg != null)

            {

                this.adjacentChestZNeg.func_90009_a(this, 0);

            }

 

            if (this.adjacentChestZPosition != null)

            {

                this.adjacentChestZPosition.func_90009_a(this, 2);

            }

 

            if (this.adjacentChestXPos != null)

            {

                this.adjacentChestXPos.func_90009_a(this, 1);

            }

 

            if (this.adjacentChestXNeg != null)

            {

                this.adjacentChestXNeg.func_90009_a(this, 3);

            }

        }

    }

 

    private boolean func_94044_a(int par1, int par2, int par3)

    {

        Block block = Block.blocksList[this.worldObj.getBlockId(par1, par2, par3)];

        return block != null && block instanceof OrbChest ? ((OrbChest)block).chestType == this.getChestType() : false;

    }

 

    /**

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

    {

        super.updateEntity();

        this.checkForAdjacentChests();

        ++this.ticksSinceSync;

        float f;

 

        if (!this.worldObj.isRemote && this.numUsingPlayers != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0)

        {

            this.numUsingPlayers = 0;

            f = 5.0F;

            List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)this.xCoord - f), (double)((float)this.yCoord - f), (double)((float)this.zCoord - f), (double)((float)(this.xCoord + 1) + f), (double)((float)(this.yCoord + 1) + f), (double)((float)(this.zCoord + 1) + f)));

            Iterator iterator = list.iterator();

 

            while (iterator.hasNext())

            {

                EntityPlayer entityplayer = (EntityPlayer)iterator.next();

 

                if (entityplayer.openContainer instanceof ContainerChest)

                {

                    IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory();

 

                    if (iinventory == this || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).isPartOfLargeChest(this))

                    {

                        ++this.numUsingPlayers;

                    }

                }

            }

        }

 

        this.prevLidAngle = this.lidAngle;

        f = 0.1F;

        double d0;

 

        if (this.numUsingPlayers > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null)

        {

            double d1 = (double)this.xCoord + 0.5D;

            d0 = (double)this.zCoord + 0.5D;

 

            if (this.adjacentChestZPosition != null)

            {

                d0 += 0.5D;

            }

 

            if (this.adjacentChestXPos != null)

            {

                d1 += 0.5D;

            }

 

            this.worldObj.playSoundEffect(d1, (double)this.yCoord + 0.5D, d0, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);

        }

 

        if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F)

        {

            float f1 = this.lidAngle;

 

            if (this.numUsingPlayers > 0)

            {

                this.lidAngle += f;

            }

            else

            {

                this.lidAngle -= f;

            }

 

            if (this.lidAngle > 1.0F)

            {

                this.lidAngle = 1.0F;

            }

 

            float f2 = 0.5F;

 

            if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null)

            {

                d0 = (double)this.xCoord + 0.5D;

                double d2 = (double)this.zCoord + 0.5D;

 

                if (this.adjacentChestZPosition != null)

                {

                    d2 += 0.5D;

                }

 

                if (this.adjacentChestXPos != null)

                {

                    d0 += 0.5D;

                }

 

                this.worldObj.playSoundEffect(d0, (double)this.yCoord + 0.5D, d2, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);

            }

 

            if (this.lidAngle < 0.0F)

            {

                this.lidAngle = 0.0F;

            }

        }

    }

 

    /**

    * Called when a client event is received with the event number and argument, see World.sendClientEvent

    */

    public boolean receiveClientEvent(int par1, int par2)

    {

        if (par1 == 1)

        {

            this.numUsingPlayers = par2;

            return true;

        }

        else

        {

            return super.receiveClientEvent(par1, par2);

        }

    }

 

    public void openChest()

    {

        if (this.numUsingPlayers < 0)

        {

            this.numUsingPlayers = 0;

        }

 

        ++this.numUsingPlayers;

        this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID, 1, this.numUsingPlayers);

        this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID);

        this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType().blockID);

    }

 

    public void closeChest()

    {

        if (this.getBlockType() != null && this.getBlockType() instanceof OrbChest)

        {

            --this.numUsingPlayers;

            this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID, 1, this.numUsingPlayers);

            this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID);

            this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType().blockID);

        }

    }

 

    /**

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

    */

    public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack)

    {

        return true;

    }

 

    /**

    * invalidates a tile entity

    */

    public void invalidate()

    {

        super.invalidate();

        this.updateContainingBlockInfo();

        this.checkForAdjacentChests();

    }

 

    public int getChestType()

    {

        if (this.cachedChestType == -1)

        {

            if (this.worldObj == null || !(this.getBlockType() instanceof OrbChest))

            {

                return 0;

            }

 

            this.cachedChestType = ((OrbChest)this.getBlockType()).chestType;

        }

 

        return this.cachedChestType;

    }

}

 

 

 

OrbChest

 

package Crystalorb;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import java.util.Iterator;

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.creativetab.CreativeTabs;

import net.minecraft.entity.EntityLivingBase;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.entity.passive.EntityOcelot;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.inventory.Container;

import net.minecraft.inventory.IInventory;

import net.minecraft.inventory.InventoryLargeChest;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.AxisAlignedBB;

import net.minecraft.util.MathHelper;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

 

import static net.minecraftforge.common.ForgeDirection.*;

 

public class OrbChest extends BlockContainer

{

    private final Random random = new Random();

 

    /** 1 for trapped chests, 0 for normal chests. */

    public final int chestType;

 

    protected OrbChest(int par1, int par2)

    {

        super(par1, Material.wood);

        this.chestType = par2;

        this.setCreativeTab(CreativeTabs.tabDecorations);

        this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);

    }

 

    /**

    * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two

    * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.

    */

    public boolean isOpaqueCube()

    {

        return false;

    }

 

    /**

    * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)

    */

    public boolean renderAsNormalBlock()

    {

        return false;

    }

 

    /**

    * The type of render function that is called for this block

    */

    public int getRenderType()

    {

        return 22;

    }

 

    /**

    * Updates the blocks bounds based on its current state. Args: world, x, y, z

    */

    public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)

    {

        if (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID)

        {

            this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);

        }

        else if (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID)

        {

            this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);

        }

        else if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID)

        {

            this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);

        }

        else if (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID)

        {

            this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);

        }

        else

        {

            this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);

        }

    }

 

    /**

    * 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.unifyAdjacentChests(par1World, par2, par3, par4);

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

 

        if (l == this.blockID)

        {

            this.unifyAdjacentChests(par1World, par2, par3, par4 - 1);

        }

 

        if (i1 == this.blockID)

        {

            this.unifyAdjacentChests(par1World, par2, par3, par4 + 1);

        }

 

        if (j1 == this.blockID)

        {

            this.unifyAdjacentChests(par1World, par2 - 1, par3, par4);

        }

 

        if (k1 == this.blockID)

        {

            this.unifyAdjacentChests(par1World, par2 + 1, par3, par4);

        }

    }

 

    /**

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

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

 

        if (l1 == 0)

        {

            b0 = 2;

        }

 

        if (l1 == 1)

        {

            b0 = 5;

        }

 

        if (l1 == 2)

        {

            b0 = 3;

        }

 

        if (l1 == 3)

        {

            b0 = 4;

        }

 

        if (l != this.blockID && i1 != this.blockID && j1 != this.blockID && k1 != this.blockID)

        {

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

        }

        else

        {

            if ((l == this.blockID || i1 == this.blockID) && (b0 == 4 || b0 == 5))

            {

                if (l == this.blockID)

                {

                    par1World.setBlockMetadataWithNotify(par2, par3, par4 - 1, b0, 3);

                }

                else

                {

                    par1World.setBlockMetadataWithNotify(par2, par3, par4 + 1, b0, 3);

                }

 

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

            }

 

            if ((j1 == this.blockID || k1 == this.blockID) && (b0 == 2 || b0 == 3))

            {

                if (j1 == this.blockID)

                {

                    par1World.setBlockMetadataWithNotify(par2 - 1, par3, par4, b0, 3);

                }

                else

                {

                    par1World.setBlockMetadataWithNotify(par2 + 1, par3, par4, b0, 3);

                }

 

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

            }

        }

 

        if (par6ItemStack.hasDisplayName())

        {

            ((TileEntityOrbChest)par1World.getBlockTileEntity(par2, par3, par4)).setChestGuiName(par6ItemStack.getDisplayName());

        }

    }

 

    /**

    * Turns the adjacent chests to a double chest.

    */

    public void unifyAdjacentChests(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);

            boolean flag = true;

            int l1;

            int i2;

            boolean flag1;

            byte b0;

            int j2;

 

            if (l != this.blockID && i1 != this.blockID)

            {

                if (j1 != this.blockID && k1 != this.blockID)

                {

                    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;

                    }

                }

                else

                {

                    l1 = par1World.getBlockId(j1 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 - 1);

                    i2 = par1World.getBlockId(j1 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 + 1);

                    b0 = 3;

                    flag1 = true;

 

                    if (j1 == this.blockID)

                    {

                        j2 = par1World.getBlockMetadata(par2 - 1, par3, par4);

                    }

                    else

                    {

                        j2 = par1World.getBlockMetadata(par2 + 1, par3, par4);

                    }

 

                    if (j2 == 2)

                    {

                        b0 = 2;

                    }

 

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

                    {

                        b0 = 3;

                    }

 

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

                    {

                        b0 = 2;

                    }

                }

            }

            else

            {

                l1 = par1World.getBlockId(par2 - 1, par3, l == this.blockID ? par4 - 1 : par4 + 1);

                i2 = par1World.getBlockId(par2 + 1, par3, l == this.blockID ? par4 - 1 : par4 + 1);

                b0 = 5;

                flag1 = true;

 

                if (l == this.blockID)

                {

                    j2 = par1World.getBlockMetadata(par2, par3, par4 - 1);

                }

                else

                {

                    j2 = par1World.getBlockMetadata(par2, par3, par4 + 1);

                }

 

                if (j2 == 4)

                {

                    b0 = 4;

                }

 

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

                {

                    b0 = 5;

                }

 

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

                {

                    b0 = 4;

                }

            }

 

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

        }

    }

 

    /**

    * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z

    */

    public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)

    {

        int l = 0;

 

        if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID)

        {

            ++l;

        }

 

        if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)

        {

            ++l;

        }

 

        if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID)

        {

            ++l;

        }

 

        if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID)

        {

            ++l;

        }

 

        return l > 1 ? false : (this.isThereANeighborChest(par1World, par2 - 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2 + 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2, par3, par4 - 1) ? false : !this.isThereANeighborChest(par1World, par2, par3, par4 + 1))));

    }

 

    /**

    * Checks the neighbor blocks to see if there is a chest there. Args: world, x, y, z

    */

    private boolean isThereANeighborChest(World par1World, int par2, int par3, int par4)

    {

        return par1World.getBlockId(par2, par3, par4) != this.blockID ? false : (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID ? true : (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID ? true : (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID ? true : par1World.getBlockId(par2, par3, par4 + 1) == this.blockID)));

    }

 

    /**

    * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are

    * their own) Args: x, y, z, neighbor blockID

    */

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

    {

        super.onNeighborBlockChange(par1World, par2, par3, par4, par5);

        TileEntityOrbChest tileentitychest = (TileEntityOrbChest)par1World.getBlockTileEntity(par2, par3, par4);

 

        if (tileentitychest != null)

        {

            tileentitychest.updateContainingBlockInfo();

        }

    }

 

    /**

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

    {

        TileEntityOrbChest tileentitychest = (TileEntityOrbChest)par1World.getBlockTileEntity(par2, par3, par4);

 

        if (tileentitychest != null)

        {

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

            {

                ItemStack itemstack = tileentitychest.getStackInSlot(j1);

 

                if (itemstack != null)

                {

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

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

                    EntityItem entityitem;

 

                    for (float f2 = this.random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem))

                    {

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

 

                        if (k1 > itemstack.stackSize)

                        {

                            k1 = itemstack.stackSize;

                        }

 

                        itemstack.stackSize -= k1;

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

                        float f3 = 0.05F;

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

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

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

 

                        if (itemstack.hasTagCompound())

                        {

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

                        }

                    }

                }

            }

 

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

        }

 

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

    }

 

    /**

    * 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

        {

            IInventory iinventory = this.getInventory(par1World, par2, par3, par4);

 

            if (iinventory != null)

            {

                par5EntityPlayer.displayGUIChest(iinventory);

            }

 

            return true;

        }

    }

 

    /**

    * Gets the inventory of the chest at the specified coords, accounting for blocks or ocelots on top of the chest,

    * and double chests.

    */

    public IInventory getInventory(World par1World, int par2, int par3, int par4)

    {

        Object object = (TileEntityOrbChest)par1World.getBlockTileEntity(par2, par3, par4);

 

        if (object == null)

        {

            return null;

        }

        else if (par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN))

        {

            return null;

        }

        else if (isOcelotBlockingChest(par1World, par2, par3, par4))

        {

            return null;

        }

        else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4)))

        {

            return null;

        }

        else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4)))

        {

            return null;

        }

        else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1)))

        {

            return null;

        }

        else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1)))

        {

            return null;

        }

        else

        {

            if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID)

            {

                object = new InventoryLargeChest("Crystal Large Chest", (TileEntityOrbChest)par1World.getBlockTileEntity(par2 - 1, par3, par4), (IInventory)object);

            }

 

            if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)

            {

                object = new InventoryLargeChest("Crystal Large Chest", (IInventory)object, (TileEntityOrbChest)par1World.getBlockTileEntity(par2 + 1, par3, par4));

            }

 

            if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID)

            {

                object = new InventoryLargeChest("Crystal Large Chest", (TileEntityOrbChest)par1World.getBlockTileEntity(par2, par3, par4 - 1), (IInventory)object);

            }

 

            if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID)

            {

                object = new InventoryLargeChest("Crystal Large Chest", (IInventory)object, (TileEntityOrbChest)par1World.getBlockTileEntity(par2, par3, par4 + 1));

            }

 

            return (IInventory)object;

        }

    }

 

    /**

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

    */

    public TileEntity createNewTileEntity(World par1World)

    {

        TileEntityOrbChest tileentitychest = new TileEntityOrbChest();

        return tileentitychest;

    }

 

    /**

    * Can this block provide power. Only wire currently seems to have this change based on its state.

    */

    public boolean canProvidePower()

    {

        return this.chestType == 1;

    }

 

    /**

    * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube

    * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X,

    * Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.

    */

    public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)

    {

        if (!this.canProvidePower())

        {

            return 0;

        }

        else

        {

            int i1 = ((TileEntityOrbChest)par1IBlockAccess.getBlockTileEntity(par2, par3, par4)).numUsingPlayers;

            return MathHelper.clamp_int(i1, 0, 15);

        }

    }

 

    /**

    * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z,

    * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.

    */

    public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)

    {

        return par5 == 1 ? this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5) : 0;

    }

 

    /**

    * Looks for a sitting ocelot within certain bounds. Such an ocelot is considered to be blocking access to the

    * chest.

    */

    public static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3)

    {

        Iterator iterator = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getAABBPool().getAABB((double)par1, (double)(par2 + 1), (double)par3, (double)(par1 + 1), (double)(par2 + 2), (double)(par3 + 1))).iterator();

        EntityOcelot entityocelot;

 

        do

        {

            if (!iterator.hasNext())

            {

                return false;

            }

 

            EntityOcelot entityocelot1 = (EntityOcelot)iterator.next();

            entityocelot = (EntityOcelot)entityocelot1;

        }

        while (!entityocelot.isSitting());

 

        return true;

    }

 

    /**

    * 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(this.getInventory(par1World, par2, par3, par4));

    }

 

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

    }

}

 

 

 

 

OrbPacketHandler

 

 

package Crystalorb;

 

import java.io.ByteArrayInputStream;

import java.io.DataInputStream;

import java.io.IOException;

 

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

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

import net.minecraft.network.INetworkManager;

import net.minecraft.network.packet.Packet250CustomPayload;

 

public class OrbPacketHandler implements IPacketHandler {

 

@Override

public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player){

if(packet.channel.equals("CrystalMod")){

handlePacket(packet);

}

}

 

public void handlePacket(Packet250CustomPayload packet){

DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));

 

 

int randomInt1;

int randomInt2;

 

try{

randomInt1 = inputStream.readInt();

randomInt2 = inputStream.readInt();

} catch(IOException e){

e.printStackTrace();

return;

}

 

System.out.println(randomInt1 + "" + randomInt2);

}

 

}

 

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

Sooo...you have an IItemRenderer

But....you don't have a TileEntitySpecialRenderer

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Well to be precise I am very new to forge and Minecraft client modding. Now being as it may that I am new to client modding I do know Java (just in case you were going to say go learn Java then come back xD). Basically, I am trying to create a new chest, but I am having some difficulty with the Rendering.

 

Being that I am still learning, I will welcome any message you have to suggest.

 

Thanks :D

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

You need TileEntitySpecialRenderer.  The default chest renderer is going to use the default chest texture.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

You need TileEntitySpecialRenderer.  The default chest renderer is going to use the default chest texture.

 

So would I delete the TileEntityOrbChestRender class and in replace make a new class exactly like the TileEntitySpecialRenderer?

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

Yes, just use a TESR like this.

 

That works just fine with the vanilla chest render id 22, except you will get a chest rendering in the inventory rather than your custom texture. Looks like you already took care of that though.

 

Be sure to register your TESR on the client side:

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChestLocked.class, new RenderTileEntityChestLocked());

Link to comment
Share on other sites

You need TileEntitySpecialRenderer.  The default chest renderer is going to use the default chest texture.

 

So would I delete the TileEntityOrbChestRender class and in replace make a new class exactly like the TileEntitySpecialRenderer?

 

You don't have a TileEntityOrbChestRender.  Or if you do, you never put it in your original post and never registered it in your client proxy.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

TileEntityOrbChestRender

 

package Crystalorb;

 

import cpw.mods.fml.common.FMLLog;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import java.util.Calendar;

import net.minecraft.block.Block;

import net.minecraft.block.BlockChest;

import net.minecraft.client.model.ModelChest;

import net.minecraft.client.model.ModelLargeChest;

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

import net.minecraft.tileentity.TileEntity;

import net.minecraft.tileentity.TileEntityChest;

import net.minecraft.util.ResourceLocation;

 

import org.lwjgl.opengl.GL11;

import org.lwjgl.opengl.GL12;

 

@SideOnly(Side.CLIENT)

public class TileEntityOrbChestRender extends TileEntitySpecialRenderer

{

    private static final ResourceLocation RES_TRAPPED_DOUBLE = new ResourceLocation("textures/entity/chest/trapped_double.png");

    private static final ResourceLocation RES_CHRISTMAS_DOUBLE = new ResourceLocation("textures/entity/chest/christmas_double.png");

    private static final ResourceLocation RES_NORMAL_DOUBLE = new ResourceLocation("textures/entity/chest/normal_double.png");

    private static final ResourceLocation RES_TRAPPED_SINGLE = new ResourceLocation("textures/entity/chest/trapped.png");

    private static final ResourceLocation RES_CHRISTMAS_SINGLE = new ResourceLocation("textures/entity/chest/christmas.png");

    private static final ResourceLocation RES_NORMAL_SINGLE = new ResourceLocation("textures/entity/chest/normal.png");

    private static final ResourceLocation RES_NORMAL_CRYSTAL = new ResourceLocation("textures/entity/chest/crystal_chest.png");

    private static final ResourceLocation RES_TRAPPED_CRYSTAL = new ResourceLocation("textures/entity/chest/crystal_chest.png");

    private static final ResourceLocation RES_CHRISTMAS_CRYSTAL = new ResourceLocation("textures/entity/chest/crystal_chest.png");

 

    /** The normal small chest model. */

    private ModelChest chestModel = new ModelChest();

 

    /** The large double chest model. */

    private ModelChest largeChestModel = new ModelLargeChest();

 

    /** If true, chests will be rendered with the Christmas present textures. */

    private boolean isChristmas;

 

    public TileEntityOrbChestRender()

    {

        Calendar calendar = Calendar.getInstance();

 

        if (calendar.get(2) + 1 == 12 && calendar.get(5) >= 24 && calendar.get(5) <= 26)

        {

            this.isChristmas = true;

        }

    }

 

    /**

    * Renders the TileEntity for the chest at a position.

    */

    public void renderTileEntityChestAt(TileEntityChest par1TileEntityChest, double par2, double par4, double par6, float par8)

    {

        int i;

 

        if (!par1TileEntityChest.hasWorldObj())

        {

            i = 0;

        }

        else

        {

            Block block = par1TileEntityChest.getBlockType();

            i = par1TileEntityChest.getBlockMetadata();

 

            if (block instanceof BlockChest && i == 0)

            {

                try

                {

                    ((BlockChest)block).unifyAdjacentChests(par1TileEntityChest.getWorldObj(), par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);

                }

                catch (ClassCastException e)

                {

                    FMLLog.severe("Attempted to render a chest at %d,  %d, %d that was not a chest",

                            par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);

                }

                i = par1TileEntityChest.getBlockMetadata();

            }

 

            par1TileEntityChest.checkForAdjacentChests();

        }

 

        if (par1TileEntityChest.adjacentChestZNeg == null && par1TileEntityChest.adjacentChestXNeg == null)

        {

            ModelChest modelchest;

 

            if (par1TileEntityChest.adjacentChestXPos == null && par1TileEntityChest.adjacentChestZPosition == null)

            {

                modelchest = this.chestModel;

 

                if (par1TileEntityChest.getChestType() == 1)

                {

                    this.bindTexture(RES_TRAPPED_CRYSTAL);

                }

                else if (this.isChristmas)

                {

                    this.bindTexture(RES_CHRISTMAS_CRYSTAL);

                }

                else

                {

                    this.bindTexture(RES_NORMAL_CRYSTAL);

                }

            }

            else

            {

                modelchest = this.largeChestModel;

 

                if (par1TileEntityChest.getChestType() == 1)

                {

                    this.bindTexture(RES_TRAPPED_CRYSTAL);

                }

                else if (this.isChristmas)

                {

                    this.bindTexture(RES_CHRISTMAS_CRYSTAL);

                }

                else

                {

                    this.bindTexture(RES_NORMAL_CRYSTAL);

                }

            }

 

            GL11.glPushMatrix();

            GL11.glEnable(GL12.GL_RESCALE_NORMAL);

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

            GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F);

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

            GL11.glTranslatef(0.5F, 0.5F, 0.5F);

            short short1 = 0;

 

            if (i == 2)

            {

                short1 = 180;

            }

 

            if (i == 3)

            {

                short1 = 0;

            }

 

            if (i == 4)

            {

                short1 = 90;

            }

 

            if (i == 5)

            {

                short1 = -90;

            }

 

            if (i == 2 && par1TileEntityChest.adjacentChestXPos != null)

            {

                GL11.glTranslatef(1.0F, 0.0F, 0.0F);

            }

 

            if (i == 5 && par1TileEntityChest.adjacentChestZPosition != null)

            {

                GL11.glTranslatef(0.0F, 0.0F, -1.0F);

            }

 

            GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F);

            GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

            float f1 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;

            float f2;

 

            if (par1TileEntityChest.adjacentChestZNeg != null)

            {

                f2 = par1TileEntityChest.adjacentChestZNeg.prevLidAngle + (par1TileEntityChest.adjacentChestZNeg.lidAngle - par1TileEntityChest.adjacentChestZNeg.prevLidAngle) * par8;

 

                if (f2 > f1)

                {

                    f1 = f2;

                }

            }

 

            if (par1TileEntityChest.adjacentChestXNeg != null)

            {

                f2 = par1TileEntityChest.adjacentChestXNeg.prevLidAngle + (par1TileEntityChest.adjacentChestXNeg.lidAngle - par1TileEntityChest.adjacentChestXNeg.prevLidAngle) * par8;

 

                if (f2 > f1)

                {

                    f1 = f2;

                }

            }

 

            f1 = 1.0F - f1;

            f1 = 1.0F - f1 * f1 * f1;

            modelchest.chestLid.rotateAngleX = -(f1 * (float)Math.PI / 2.0F);

            modelchest.renderAll();

            GL11.glDisable(GL12.GL_RESCALE_NORMAL);

            GL11.glPopMatrix();

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

        }

    }

 

    public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)

    {

        this.renderTileEntityChestAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8);

    }

}

 

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

Oh, I am getting this error when I try to test the mod. It tries to upload, then it closes.

 

Error

 

Jan 30, 2014 8:47:51 PM net.minecraft.launchwrapper.LogWrapper log

INFO: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

Jan 30, 2014 8:47:51 PM net.minecraft.launchwrapper.LogWrapper log

INFO: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

Jan 30, 2014 8:47:51 PM net.minecraft.launchwrapper.LogWrapper log

INFO: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Forge Mod Loader version 6.4.45.953 for Minecraft 1.6.4 loading

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Java is Java HotSpot 64-Bit Server VM, version 1.7.0_09, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

2014-01-30 20:47:51 [iNFO] [ForgeModLoader] Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

2014-01-30 20:47:51 [iNFO] [sTDOUT] Loaded 40 rules from AccessTransformer config file fml_at.cfg

2014-01-30 20:47:51 [sEVERE] [ForgeModLoader] The binary patch set is missing. Either you are in a development environment, or things are not going to work!

2014-01-30 20:47:52 [iNFO] [ForgeModLoader] Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

2014-01-30 20:47:52 [iNFO] [sTDOUT] Loaded 110 rules from AccessTransformer config file forge_at.cfg

2014-01-30 20:47:52 [iNFO] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

2014-01-30 20:47:52 [iNFO] [ForgeModLoader] Launching wrapped minecraft {net.minecraft.client.main.Main}

2014-01-30 20:47:53 [iNFO] [Minecraft-Client] Setting user: Player833

2014-01-30 20:47:54 [iNFO] [Minecraft-Client] LWJGL Version: 2.9.0

2014-01-30 20:47:54 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default

2014-01-30 20:47:56 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization

2014-01-30 20:47:56 [iNFO] [sTDOUT] MinecraftForge v9.11.1.953 Initialized

2014-01-30 20:47:56 [iNFO] [ForgeModLoader] MinecraftForge v9.11.1.953 Initialized

2014-01-30 20:47:56 [iNFO] [sTDOUT] Replaced 112 ore recipies

2014-01-30 20:47:56 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization

2014-01-30 20:47:56 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\ASH\Desktop\MCP\forge\mcp\jars\config\logging.properties

2014-01-30 20:47:56 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL

2014-01-30 20:47:56 [iNFO] [ForgeModLoader] Searching C:\Users\ASH\Desktop\MCP\forge\mcp\jars\mods for mods

2014-01-30 20:47:58 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load

2014-01-30 20:47:58 [iNFO] [mcp] Activating mod mcp

2014-01-30 20:47:58 [iNFO] [FML] Activating mod FML

2014-01-30 20:47:58 [iNFO] [Forge] Activating mod Forge

2014-01-30 20:47:58 [iNFO] [crystalchest] Activating mod crystalchest

2014-01-30 20:47:58 [WARNING] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well

2014-01-30 20:47:58 [WARNING] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well

2014-01-30 20:47:58 [WARNING] [Crystal Orb Mod] Mod Crystal Orb Mod is missing a pack.mcmeta file, things may not work well

2014-01-30 20:47:58 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Crystal Orb Mod

2014-01-30 20:47:58 [iNFO] [ForgeModLoader] Registering Forge Packet Handler

2014-01-30 20:47:58 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler

2014-01-30 20:47:59 [sEVERE] [ForgeModLoader] The mod crystalchest appears to reject its own version number (v1.4) in its version handling. This is likely a severe bug in the mod!

2014-01-30 20:47:59 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0

2014-01-30 20:48:00 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue

2014-01-30 20:48:00 [sEVERE] [ForgeModLoader]

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

FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized

Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized

crystalchest{v1.4} [Crystal Orb Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored

2014-01-30 20:48:00 [sEVERE] [ForgeModLoader] The following problems were captured during this phase

2014-01-30 20:48:00 [sEVERE] [ForgeModLoader] Caught exception from crystalchest

java.lang.NullPointerException

at Crystalorb.ClientProxy.registerRenderThings(ClientProxy.java:12)

at Crystalorb.Main.load(Main.java:106)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)

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

at net.minecraft.client.main.Main.main(Main.java:93)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)

at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

2014-01-30 20:48:00 [iNFO] [sTDOUT] ---- Minecraft Crash Report ----

2014-01-30 20:48:00 [iNFO] [sTDOUT] // On the bright side, I bought you a teddy bear!

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT] Time: 1/30/14 8:48 PM

2014-01-30 20:48:00 [iNFO] [sTDOUT] Description: Initializing game

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT] java.lang.NullPointerException

2014-01-30 20:48:00 [iNFO] [sTDOUT] at Crystalorb.ClientProxy.registerRenderThings(ClientProxy.java:12)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at Crystalorb.Main.load(Main.java:106)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:808)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows:

2014-01-30 20:48:00 [iNFO] [sTDOUT] ---------------------------------------------------------------------------------------

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT] -- Head --

2014-01-30 20:48:00 [iNFO] [sTDOUT] Stacktrace:

2014-01-30 20:48:00 [iNFO] [sTDOUT] at Crystalorb.ClientProxy.registerRenderThings(ClientProxy.java:12)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at Crystalorb.Main.load(Main.java:106)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT] -- Initialization --

2014-01-30 20:48:00 [iNFO] [sTDOUT] Details:

2014-01-30 20:48:00 [iNFO] [sTDOUT] Stacktrace:

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:808)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)

2014-01-30 20:48:00 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

2014-01-30 20:48:00 [iNFO] [sTDOUT]

2014-01-30 20:48:00 [iNFO] [sTDOUT] -- System Details --

2014-01-30 20:48:00 [iNFO] [sTDOUT] Details:

2014-01-30 20:48:00 [iNFO] [sTDOUT] Minecraft Version: 1.6.4

2014-01-30 20:48:00 [iNFO] [sTDOUT] Operating System: Windows 7 (amd64) version 6.1

2014-01-30 20:48:00 [iNFO] [sTDOUT] Java Version: 1.7.0_09, Oracle Corporation

2014-01-30 20:48:00 [iNFO] [sTDOUT] Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

2014-01-30 20:48:00 [iNFO] [sTDOUT] Memory: 844296720 bytes (805 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

2014-01-30 20:48:00 [iNFO] [sTDOUT] JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

2014-01-30 20:48:00 [iNFO] [sTDOUT] AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

2014-01-30 20:48:00 [iNFO] [sTDOUT] Suspicious classes: FML and Forge are installed

2014-01-30 20:48:00 [iNFO] [sTDOUT] IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

2014-01-30 20:48:00 [iNFO] [sTDOUT] FML: MCP v8.11 FML v6.4.45.953 Minecraft Forge 9.11.1.953 4 mods loaded, 4 mods active

2014-01-30 20:48:00 [iNFO] [sTDOUT] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

2014-01-30 20:48:00 [iNFO] [sTDOUT] FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized

2014-01-30 20:48:00 [iNFO] [sTDOUT] Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized

2014-01-30 20:48:00 [iNFO] [sTDOUT] crystalchest{v1.4} [Crystal Orb Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored

2014-01-30 20:48:00 [iNFO] [sTDOUT] Launched Version: 1.6

2014-01-30 20:48:00 [iNFO] [sTDOUT] LWJGL: 2.9.0

2014-01-30 20:48:00 [iNFO] [sTDOUT] OpenGL: AMD Radeon HD 6530D Graphics GL version 4.1.11079 Compatibility Profile Context, ATI Technologies Inc.

2014-01-30 20:48:00 [iNFO] [sTDOUT] Is Modded: Definitely; Client brand changed to 'fml,forge'

2014-01-30 20:48:00 [iNFO] [sTDOUT] Type: Client (map_client.txt)

2014-01-30 20:48:00 [iNFO] [sTDOUT] Resource Pack: Default

2014-01-30 20:48:00 [iNFO] [sTDOUT] Current Language: English (US)

2014-01-30 20:48:00 [iNFO] [sTDOUT] Profiler Position: N/A (disabled)

2014-01-30 20:48:00 [iNFO] [sTDOUT] Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

2014-01-30 20:48:00 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\ASH\Desktop\MCP\forge\mcp\jars\.\crash-reports\crash-2014-01-30_20.48.00-client.txt

 

 

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

Hi

 

Do you have some experience with reading the error log and debugging errors?

If not this link might help

http://www.terryanderson.ca/debugging/run.html

 

A null pointer exception at

  at Crystalorb.ClientProxy.registerRenderThings(ClientProxy.java:12)

probably means you have forgotten to initialise something before you use it.

 

-TGG

 

 

Link to comment
Share on other sites

I know its a NullPointerException and I found the line that caused the error.....but I just can't figure out what I am missing or what I forgot to installize.

 

Based on what I have posted above do you think you might be able to figure it out?

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

Sorry for the delaied reply.

 

ClientProxy

 

package Crystalorb;

 

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

import net.minecraftforge.client.MinecraftForgeClient;

import cpw.mods.fml.client.registry.ClientRegistry;

 

public class ClientProxy {

 

  public static void registerRenderThings(){

     

  ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOrbChest.class, new TileEntityOrbChestRender());

      MinecraftForgeClient.registerItemRenderer(Main.orb_crystal_chest.blockID, new ItemOrbChestRender());

  }

}

 

 

12th line

MinecraftForgeClient.registerItemRenderer(Main.orb_crystal_chest.blockID, new ItemOrbChestRender());

 

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

Main.orb_crystal_chest is probably the null object.

 

Check on that.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Ok, I got minecraft to start, but whenever I go into the decorations blocks tab where my new chest is located and scroll down just a little the game crashes.

Here is the source of the error

 

ItemOrbChestRender

 

package Crystalorb;

 

import net.minecraft.client.model.ModelChest;

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

import net.minecraft.item.ItemStack;

import net.minecraftforge.client.IItemRenderer;

 

public class ItemOrbChestRender implements IItemRenderer {

 

  private ModelChest chestModel;

 

  public ItemOrbChestRender(){

      chestModel = new ModelChest();

  }

 

  @Override

  public boolean handleRenderType(ItemStack item, ItemRenderType type) {

      // TODO Auto-generated method stub

      return true;

  }

 

  @Override

  public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,

        ItemRendererHelper helper) {

      // TODO Auto-generated method stub

      return true;

  }

 

  @Override

  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

     

      TileEntityRenderer.instance.renderTileEntityAt(new TileEntityOrbChest(), 0.0D, 0.0D, 0.0D, 0.0f);

 

  }

 

 

Error

TileEntityRenderer.instance.renderTileEntityAt(new TileEntityOrbChest(), 0.0D, 0.0D, 0.0D, 0.0f);

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

Without the full crash log, it's difficult to say, but I'm guessing that your TESR is trying to use something from the TileEntity, which of course will not be available when you are viewing the block in the inventory. That's why IItemRenderer and the like render Items, not TileEntities.

 

I'm guessing you must not have looked at the link I posted earlier. Anyway, this is how I render my custom chest in the inventory, using the ISimpleBlockRenderingHandler.

 

Of course you need to register it:

RenderingRegistry.registerBlockHandler(new RenderChestLocked());

 

And in your Block class, return the appropriate render type:

@Override
public int getRenderType() { return RenderChestLocked.renderId; }

 

That's it. This will not adversely affect your TESR either, which is responsible for rendering the block when it is actually in the world, so long as you set it up correctly in the first place. Here is my TESR for my custom chest.

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.