• 0

    posted a message on Problem with entity held items.
    Ok so I tried giving one of my custom entity a held item (like zombie pigmen have) but it didnt work. Thats not the problem though as now any entity that has a held item wont spawn or render. So I cant see endermen or zombie pigmen. Is there anyway I can fix this?
    Posted in: Modification Development
  • 0

    posted a message on 2 GUI Questions
    Quote from Friedi4321

    Try this.
    It's the answer for your question and I haven't to explain it to you ;) .

    http://www.minecraft...h-minecraft-11/

    Nope, sorry I already know all this stuff, I just need to learn how to get it to start up when I start a game. (I learnt the other thing...)
    Posted in: Modification Development
  • 0

    posted a message on 2 GUI Questions
    bump
    Posted in: Modification Development
  • 0

    posted a message on DECENT MODDER WANTED
    As dealman said there needs to be a bit more info however if you were to give me an idea of what you want I will be glad to help. Ive recently finished a first release big project and if you want you can get an early release of it to see some of my work.

    I can code:
    -Weapons, tools, armour, bows, semi-auto guns etc.
    -Mobs
    -Button gui (learning slots atm)
    -New game mechanics

    If theres anything particular you need I'll be willing to learn it.

    I hope I can be of some service to your mod, just ill need some details...
    Posted in: Modification Development
  • 0

    posted a message on 2 GUI Questions
    First question is how do I make my gui open when I first start a new world and secondly how do I make it give me an item when I click one of the gui's buttons.
    Posted in: Modification Development
  • 0

    posted a message on Can I make a gui open with a keybinding?
    I did have a look but couldnt seem to find any articles concerning opening a gui with a keybinding
    Posted in: Modification Development
  • 0

    posted a message on Can I make a gui open with a keybinding?
    How can I do it? Thats basically all im asking.
    Posted in: Modification Development
  • 0

    posted a message on Bullet entity crashing game
    Quote from starlightdrive

    Try adding a damage source function, without doing that you are basically calling the damage source for the EntityArrow which doesn't know what your bullet is.

    Here is the function I added in my EntityBullet, see if this helps.
    	// Declare a damage source for the bullet entity.
    	public static DamageSource causeBulletDamage(EntityBullet par0EntityBullet, Entity par1Entity)
    	{
    		return (new EntityDamageSourceIndirect("bullet", par0EntityBullet, par1Entity)).setProjectile();
    	}


    this is the main fuction that starts on the line.
    if (shootingEntity == null)
    			    {
    				    damagesource = DamageSource.causePistolDamage(this, this);
    			    }
    			    else
    			    {
    				    damagesource = DamageSource.causePistolDamage(this, shootingEntity);
    			    }
    Posted in: Modification Development
  • 0

    posted a message on Bullet entity crashing game
    Quote from starlightdrive

    Try adding a damage source function, without doing that you are basically calling the damage source for the EntityArrow which doesn't know what your bullet is.

    Here is the function I added in my EntityBullet, see if this helps.
    	// Declare a damage source for the bullet entity.
    	public static DamageSource causeBulletDamage(EntityBullet par0EntityBullet, Entity par1Entity)
    	{
    		return (new EntityDamageSourceIndirect("bullet", par0EntityBullet, par1Entity)).setProjectile();
    	}



    Im still getting the same error...
    Posted in: Modification Development
  • 0

    posted a message on Bullet entity crashing game
    Game crashes when I shoot bullet at a mob...

    EntityBullet:
    package net.minecraft.src;
    import java.util.List;
    import java.util.Random;
    public class EntityBullet extends Entity
    {
        private int xTile;
        private int yTile;
        private int zTile;
        private int inTile;
        private int inData;
        private boolean inGround;
        public boolean doesArrowBelongToPlayer;
        /** Seems to be some sort of timer for animating an arrow. */
        public int arrowShake;
        /** The owner of this arrow. */
        public Entity shootingEntity;
        private int ticksInGround;
        private int ticksInAir;
        private double damage;
        private int field_46027_au;
        /** Is this arrow a critical hit? (Controls particles and damage) */
        public boolean arrowCritical;
        public EntityBullet(World par1World)
        {
    	    super(par1World);
    	    xTile = -1;
    	    yTile = -1;
    	    zTile = -1;
    	    inTile = 0;
    	    inData = 0;
    	    inGround = false;
    	    doesArrowBelongToPlayer = false;
    	    arrowShake = 0;
    	    ticksInAir = 0;
    	    damage = 2D;
    	    arrowCritical = false;
    	    setSize(0.5F, 0.5F);
        }
        public EntityBullet(World par1World, double par2, double par4, double par6)
        {
    	    super(par1World);
    	    xTile = -1;
    	    yTile = -1;
    	    zTile = -1;
    	    inTile = 0;
    	    inData = 0;
    	    inGround = false;
    	    doesArrowBelongToPlayer = false;
    	    arrowShake = 0;
    	    ticksInAir = 0;
    	    damage = 2D;
    	    arrowCritical = false;
    	    setSize(0.5F, 0.5F);
    	    setPosition(par2, par4, par6);
    	    yOffset = 0.0F;
        }
        public EntityBullet(World par1World, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving, float par4, float par5)
        {
    	    super(par1World);
    	    xTile = -1;
    	    yTile = -1;
    	    zTile = -1;
    	    inTile = 0;
    	    inData = 0;
    	    inGround = false;
    	    doesArrowBelongToPlayer = false;
    	    arrowShake = 0;
    	    ticksInAir = 0;
    	    damage = 2D;
    	    arrowCritical = false;
    	    shootingEntity = par2EntityLiving;
    	    doesArrowBelongToPlayer = par2EntityLiving instanceof EntityPlayer;
    	    posY = (par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight()) - 0.10000000149011612D;
    	    double d = par3EntityLiving.posX - par2EntityLiving.posX;
    	    double d1 = (par3EntityLiving.posY + (double)par3EntityLiving.getEyeHeight()) - 0.69999998807907104D - posY;
    	    double d2 = par3EntityLiving.posZ - par2EntityLiving.posZ;
    	    double d3 = MathHelper.sqrt_double(d * d + d2 * d2);
    	    if (d3 < 9.9999999999999995E-008D)
    	    {
    		    return;
    	    }
    	    else
    	    {
    		    float f = (float)((Math.atan2(d2, d) * 180D) / Math.PI) - 90F;
    		    float f1 = (float)(-((Math.atan2(d1, d3) * 180D) / Math.PI));
    		    double d4 = d / d3;
    		    double d5 = d2 / d3;
    		    setLocationAndAngles(par2EntityLiving.posX + d4, posY, par2EntityLiving.posZ + d5, f, f1);
    		    yOffset = 0.0F;
    		    float f2 = (float)d3 * 0.2F;
    		    setArrowHeading(d, d1 + (double)f2, d2, par4, par5);
    		    return;
    	    }
        }
        public EntityBullet(World par1World, EntityLiving par2EntityLiving, float par3)
        {
    	    super(par1World);
    	    xTile = -1;
    	    yTile = -1;
    	    zTile = -1;
    	    inTile = 0;
    	    inData = 0;
    	    inGround = false;
    	    doesArrowBelongToPlayer = false;
    	    arrowShake = 0;
    	    ticksInAir = 0;
    	    damage = 2D;
    	    arrowCritical = false;
    	    shootingEntity = par2EntityLiving;
    	    doesArrowBelongToPlayer = par2EntityLiving instanceof EntityPlayer;
    	    setSize(0.5F, 0.5F);
    	    setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch);
    	    posX -= MathHelper.cos((rotationYaw / 180F) * (float)Math.PI) * 0.16F;
    	    posY -= 0.10000000149011612D;
    	    posZ -= MathHelper.sin((rotationYaw / 180F) * (float)Math.PI) * 0.16F;
    	    setPosition(posX, posY, posZ);
    	    yOffset = 0.0F;
    	    motionX = -MathHelper.sin((rotationYaw / 180F) * (float)Math.PI) * MathHelper.cos((rotationPitch / 180F) * (float)Math.PI);
    	    motionZ = MathHelper.cos((rotationYaw / 180F) * (float)Math.PI) * MathHelper.cos((rotationPitch / 180F) * (float)Math.PI);
    	    motionY = -MathHelper.sin((rotationPitch / 180F) * (float)Math.PI);
    	    setArrowHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
        }
        protected void entityInit()
        {
        }
        /**
    	 * Uses the provided coordinates as a heading and determines the velocity from it with the set force and random
    	 * variance. Args: x, y, z, force, forceVariation
    	 */
        public void setArrowHeading(double par1, double par3, double par5, float par7, float par8)
        {
    	    float f = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);
    	    par1 /= f;
    	    par3 /= f;
    	    par5 /= f;
    	    par1 += rand.nextGaussian() * 0.0074999998323619366D * (double)par8;
    	    par3 += rand.nextGaussian() * 0.0074999998323619366D * (double)par8;
    	    par5 += rand.nextGaussian() * 0.0074999998323619366D * (double)par8;
    	    par1 *= par7;
    	    par3 *= par7;
    	    par5 *= par7;
    	    motionX = par1;
    	    motionY = par3;
    	    motionZ = par5;
    	    float f1 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
    	    prevRotationYaw = rotationYaw = (float)((Math.atan2(par1, par5) * 180D) / Math.PI);
    	    prevRotationPitch = rotationPitch = (float)((Math.atan2(par3, f1) * 180D) / Math.PI);
    	    ticksInGround = 0;
        }
        /**
    	 * Sets the velocity to the args. Args: x, y, z
    	 */
        public void setVelocity(double par1, double par3, double par5)
        {
    	    motionX = par1;
    	    motionY = par3;
    	    motionZ = par5;
    	    if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
    	    {
    		    float f = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
    		    prevRotationYaw = rotationYaw = (float)((Math.atan2(par1, par5) * 180D) / Math.PI);
    		    prevRotationPitch = rotationPitch = (float)((Math.atan2(par3, f) * 180D) / Math.PI);
    		    prevRotationPitch = rotationPitch;
    		    prevRotationYaw = rotationYaw;
    		    setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
    		    ticksInGround = 0;
    	    }
        }
        /**
    	 * Called to update the entity's position/logic.
    	 */
        public void onUpdate()
        {
    	    super.onUpdate();
    	    if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
    	    {
    		    float f = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
    		    prevRotationYaw = rotationYaw = (float)((Math.atan2(motionX, motionZ) * 180D) / Math.PI);
    		    prevRotationPitch = rotationPitch = (float)((Math.atan2(motionY, f) * 180D) / Math.PI);
    	    }
    	    int i = worldObj.getBlockId(xTile, yTile, zTile);
    	    if (i > 0)
    	    {
    		    Block.blocksList[i].setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile);
    		    AxisAlignedBB axisalignedbb = Block.blocksList[i].getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile);
    		    if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3D.createVector(posX, posY, posZ)))
    		    {
    			    inGround = true;
    		    }
    	    }
    	    if (arrowShake > 0)
    	    {
    		    arrowShake--;
    	    }
    	    if (inGround)
    	    {
    		    int j = worldObj.getBlockId(xTile, yTile, zTile);
    		    int k = worldObj.getBlockMetadata(xTile, yTile, zTile);
    		    if (j != inTile || k != inData)
    		    {
    			    inGround = false;
    			    motionX *= rand.nextFloat() * 0.2F;
    			    motionY *= rand.nextFloat() * 0.2F;
    			    motionZ *= rand.nextFloat() * 0.2F;
    			    ticksInGround = 0;
    			    ticksInAir = 0;
    			    return;
    		    }
    		    ticksInGround++;
    		    if (ticksInGround == 1200)
    		    {
    			    setDead();
    		    }
    		    return;
    	    }
    	    ticksInAir++;
    	    Vec3D vec3d = Vec3D.createVector(posX, posY, posZ);
    	    Vec3D vec3d1 = Vec3D.createVector(posX + motionX, posY + motionY, posZ + motionZ);
    	    MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks_do_do(vec3d, vec3d1, false, true);
    	    vec3d = Vec3D.createVector(posX, posY, posZ);
    	    vec3d1 = Vec3D.createVector(posX + motionX, posY + motionY, posZ + motionZ);
    	    if (movingobjectposition != null)
    	    {
    		    vec3d1 = Vec3D.createVector(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
    	    }
    	    Entity entity = null;
    	    List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
    	    double d = 0.0D;
    	    for (int l = 0; l < list.size(); l++)
    	    {
    		    Entity entity1 = (Entity)list.get(l);
    		    if (!entity1.canBeCollidedWith() || entity1 == shootingEntity && ticksInAir < 5)
    		    {
    			    continue;
    		    }
    		    float f5 = 0.3F;
    		    AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f5, f5, f5);
    		    MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d, vec3d1);
    		    if (movingobjectposition1 == null)
    		    {
    			    continue;
    		    }
    		    double d1 = vec3d.distanceTo(movingobjectposition1.hitVec);
    		    if (d1 < d || d == 0.0D)
    		    {
    			    entity = entity1;
    			    d = d1;
    		    }
    	    }
    	    if (entity != null)
    	    {
    		    movingobjectposition = new MovingObjectPosition(entity);
    	    }
    	    if (movingobjectposition != null)
    	    {
    		    if (movingobjectposition.entityHit != null)
    		    {
    			    float f1 = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ);
    			    int j1 = (int)Math.ceil((double)f1 * damage);
    			    if (arrowCritical)
    			    {
    				    j1 += rand.nextInt(j1 / 2 + 2);
    			    }
    			    DamageSource damagesource = null;
    			    if (shootingEntity == null)
    			    {
    				    damagesource = DamageSource.causeBulletDamage(this, this);
    			    }
    			    else
    			    {
    				    damagesource = DamageSource.causeBulletDamage(this, shootingEntity);
    			    }
    			    if (isBurning())
    			    {
    				    movingobjectposition.entityHit.setFire(5);
    			    }
    			    if (movingobjectposition.entityHit.attackEntityFrom(damagesource, j1))
    			    {
    				    if (movingobjectposition.entityHit instanceof EntityLiving)
    				    {
    					    ((EntityLiving)movingobjectposition.entityHit).arrowHitTempCounter++;
    					    if (field_46027_au > 0)
    					    {
    						    float f7 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
    						    if (f7 > 0.0F)
    						    {
    							    movingobjectposition.entityHit.addVelocity((motionX * (double)field_46027_au * 0.60000002384185791D) / (double)f7, 0.10000000000000001D, (motionZ * (double)field_46027_au * 0.60000002384185791D) / (double)f7);
    						    }
    					    }
    				    }
    				    worldObj.playSoundAtEntity(this, "random.bowhit", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F));
    				    setDead();
    			    }
    			    else
    			    {
    				    motionX *= -0.10000000149011612D;
    				    motionY *= -0.10000000149011612D;
    				    motionZ *= -0.10000000149011612D;
    				    rotationYaw += 180F;
    				    prevRotationYaw += 180F;
    				    ticksInAir = 0;
    			    }
    		    }
    		    else
    		    {
    			    xTile = movingobjectposition.blockX;
    			    yTile = movingobjectposition.blockY;
    			    zTile = movingobjectposition.blockZ;
    			    inTile = worldObj.getBlockId(xTile, yTile, zTile);
    			    inData = worldObj.getBlockMetadata(xTile, yTile, zTile);
    			    motionX = (float)(movingobjectposition.hitVec.xCoord - posX);
    			    motionY = (float)(movingobjectposition.hitVec.yCoord - posY);
    			    motionZ = (float)(movingobjectposition.hitVec.zCoord - posZ);
    			    float f2 = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ);
    			    posX -= (motionX / (double)f2) * 0.05000000074505806D;
    			    posY -= (motionY / (double)f2) * 0.05000000074505806D;
    			    posZ -= (motionZ / (double)f2) * 0.05000000074505806D;
    			    worldObj.playSoundAtEntity(this, "random.bowhit", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F));
    			    inGround = true;
    			    arrowShake = 7;
    			    arrowCritical = false;
    		    }
    	    }
    	    if (arrowCritical)
    	    {
    		    for (int i1 = 0; i1 < 4; i1++)
    		    {
    			    worldObj.spawnParticle("crit", posX + (motionX * (double)i1) / 4D, posY + (motionY * (double)i1) / 4D, posZ + (motionZ * (double)i1) / 4D, -motionX, -motionY + 0.20000000000000001D, -motionZ);
    		    }
    	    }
    	    posX += motionX;
    	    posY += motionY;
    	    posZ += motionZ;
    	    float f3 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
    	    rotationYaw = (float)((Math.atan2(motionX, motionZ) * 180D) / Math.PI);
    	    for (rotationPitch = (float)((Math.atan2(motionY, f3) * 180D) / Math.PI); rotationPitch - prevRotationPitch < -180F; prevRotationPitch -= 360F) { }
    	    for (; rotationPitch - prevRotationPitch >= 180F; prevRotationPitch += 360F) { }
    	    for (; rotationYaw - prevRotationYaw < -180F; prevRotationYaw -= 360F) { }
    	    for (; rotationYaw - prevRotationYaw >= 180F; prevRotationYaw += 360F) { }
    	    rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F;
    	    rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F;
    	    float f4 = 0.99F;
    	    float f6 = 0.05F;
    	    if (isInWater())
    	    {
    		    for (int k1 = 0; k1 < 4; k1++)
    		    {
    			    float f8 = 0.25F;
    			    worldObj.spawnParticle("bubble", posX - motionX * (double)f8, posY - motionY * (double)f8, posZ - motionZ * (double)f8, motionX, motionY, motionZ);
    		    }
    		    f4 = 0.8F;
    	    }
    	    motionX *= f4;
    	    motionY *= f4;
    	    motionZ *= f4;
    	    motionY -= f6;
    	    setPosition(posX, posY, posZ);
        }
        /**
    	 * (abstract) Protected helper method to write subclass entity data to NBT.
    	 */
        public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
        {
    	    par1NBTTagCompound.setShort("xTile", (short)xTile);
    	    par1NBTTagCompound.setShort("yTile", (short)yTile);
    	    par1NBTTagCompound.setShort("zTile", (short)zTile);
    	    par1NBTTagCompound.setByte("inTile", (byte)inTile);
    	    par1NBTTagCompound.setByte("inData", (byte)inData);
    	    par1NBTTagCompound.setByte("shake", (byte)arrowShake);
    	    par1NBTTagCompound.setByte("inGround", (byte)(inGround ? 1 : 0));
    	    par1NBTTagCompound.setBoolean("player", doesArrowBelongToPlayer);
    	    par1NBTTagCompound.setDouble("damage", damage);
        }
        /**
    	 * (abstract) Protected helper method to read subclass entity data from NBT.
    	 */
        public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
        {
    	    xTile = par1NBTTagCompound.getShort("xTile");
    	    yTile = par1NBTTagCompound.getShort("yTile");
    	    zTile = par1NBTTagCompound.getShort("zTile");
    	    inTile = par1NBTTagCompound.getByte("inTile") & 0xff;
    	    inData = par1NBTTagCompound.getByte("inData") & 0xff;
    	    arrowShake = par1NBTTagCompound.getByte("shake") & 0xff;
    	    inGround = par1NBTTagCompound.getByte("inGround") == 1;
    	    doesArrowBelongToPlayer = par1NBTTagCompound.getBoolean("player");
    	    if (par1NBTTagCompound.hasKey("damage"))
    	    {
    		    damage = par1NBTTagCompound.getDouble("damage");
    	    }
        }
        /**
    	 * Called by a player entity when they collide with an entity
    	 */
        public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
        {
    	    if (worldObj.isRemote)
    	    {
    		    return;
    	    }
    	    if (inGround && doesArrowBelongToPlayer && arrowShake <= 0 && par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1)))
    	    {
    		    worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
    		    par1EntityPlayer.onItemPickup(this, 1);
    		    setDead();
    	    }
        }
        public float getShadowSize()
        {
    	    return 0.0F;
        }
        public void setDamage(double par1)
        {
    	    damage = par1;
        }
        public double getDamage()
        {
    	    return damage;
        }
        public void func_46023_b(int par1)
        {
    	    field_46027_au = par1;
        }
        /**
    	 * If returns false, the item will not inflict any damage against entities.
    	 */
        public boolean canAttackWithItem()
        {
    	    return false;
        }
    }


    ERROR:
    java.lang.NullPointerException
    at net.minecraft.src.EntityLiving.attackEntityFrom(EntityLiving.java:847)
    at net.minecraft.src.EntityMob.attackEntityFrom(EntityMob.java:69)
    at net.minecraft.src.EntityBullet.onUpdate(EntityBullet.java:318)
    at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2195)
    at net.minecraft.src.World.updateEntity(World.java:2163)
    at net.minecraft.src.World.updateEntities(World.java:2037)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1897)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
    at net.minecraft.client.Minecraft.run(Minecraft.java:801)
    at java.lang.Thread.run(Unknown Source)
    --- END ERROR REPORT fec367a0 ----------
    Posted in: Modification Development
  • 0

    posted a message on GUI: Multiple Slots Crash Game
    Quote from Adam715

    What's line 107 of TileEntityCompactor?

    NOTHING. Thats my problem...
    Posted in: Modification Development
  • 0

    posted a message on GUI: Multiple Slots Crash Game
    BUMP
    Posted in: Modification Development
  • 0

    posted a message on GUI: Multiple Slots Crash Game
    I dont know why this is happening but here's the tile entity and the crash report Im hoping someone can help...

    TileEntityCompactor
    package net.minecraft.src;
    
    public class TileEntityCompactor extends TileEntity implements IInventory{
    
        public ItemStack compactorItemStacks[];
       
     
       
    public TileEntityCompactor(){
        compactorItemStacks = new ItemStack[4];
    
    }
    	 
    	    public int getSizeInventory()
    	    {	 
    			    return  compactorItemStacks.length;
    	    }
     
    	    public ItemStack getStackInSlot(int i) {
    			    return compactorItemStacks[i];
    	    }
    	    public ItemStack decrStackSize(int i, int j) {
    	    if (compactorItemStacks[i] != null)
    	    {
    		    if (compactorItemStacks[i].stackSize <= j)
    		    {
    			    ItemStack itemstack = compactorItemStacks[i];
    			    compactorItemStacks[i] = null;
    			    return itemstack;
    		    }
    		    ItemStack itemstack1 = compactorItemStacks[i].splitStack(j);
    		    if (compactorItemStacks[i].stackSize == 0)
    		    {
    			    compactorItemStacks[i] = null;
    		    }
    		    return itemstack1;
    	    }
    	    else
    	    {
    		    return null;
    	    }
    	    }
    	    public void setInventorySlotContents(int i, ItemStack itemstack) {
    	    compactorItemStacks[i] = itemstack;
    	
    	    if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
    	    {
    		    itemstack.stackSize = getInventoryStackLimit();
    	    }
    	    }
    
     
        public String getInvName()
        {
    	    return "meh";
        }
    	    public int getInventoryStackLimit() {
    			    // TODO Auto-generated method stub
    			    return 64;
    	    }
    
    	
    	    public void openChest() {
    			  
    	    }
    
    	
    	    public void closeChest() {
    			    // TODO Auto-generated method stub
    			  
    	    }
    	    public boolean copper = false;
    	    public boolean tin = false;
    	  
    	    public void updateEntity()
    	    {
    		   ItemStack itemstack = compactorItemStacks[0];
    		   ItemStack itemstack1 = compactorItemStacks[1];
    		   ItemStack itemstack2 = compactorItemStacks[2];
    			  if (itemstack != null)
    			  {
    		  
    					    int i = itemstack.getItem().shiftedIndex;
    						   if(i == Item.stick.shiftedIndex)
    								   {
    							   
    							 copper = true;
    				   }
    				  
    								   }
    			  if (itemstack1 != null)
    			  {
    		  
    					    int i = itemstack.getItem().shiftedIndex;
    						   if(i == Item.book.shiftedIndex)
    								   {
    							   
    							 tin = true;
    				   }
    				  
    								   }
    		   
    								   }
    			 
    
    			
    			
    	  
    				   
    				   
    	  
    	  
    				   
    
    	   
    	  
    		   
    		  
    		   public boolean isUseableByPlayer(EntityPlayer entityplayer)
    		    {
    			    if(worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this)
    			    {
    				    return false;
    			    }
    			    return entityplayer.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64D;
    		    }
    
      public ItemStack getStackInSlotOnClosing(int i) {
       // TODO Auto-generated method stub
       return null;
      }
    
    }


    Error Report
    --- BEGIN ERROR REPORT 1159a603 --------
    Generated 8/05/12 7:32 PM
    Minecraft: Minecraft 1.2.5
    OS: Windows 7 (amd64) version 6.1
    Java: 1.7.0_01, Oracle Corporation
    VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    LWJGL: 2.4.2
    OpenGL: Intel(R) HD Graphics version 2.1.0 - Build 8.15.10.2086, Intel
    java.lang.NullPointerException
    at net.minecraft.src.TileEntityCompactor.updateEntity(TileEntityCompactor.java:107)
    at net.minecraft.src.World.updateEntities(World.java:2074)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1897)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
    at net.minecraft.client.Minecraft.run(Minecraft.java:801)
    at java.lang.Thread.run(Unknown Source)
    --- END ERROR REPORT b47dc091 ----------
    Posted in: Modification Development
  • 0

    posted a message on GUI Multiple Slots question
    BUMP
    Posted in: Modification Development
  • 0

    posted a message on GUI Not working for some reason...
    Quote from Xenarthran

    I'm just skimming through, but it seems like you need to add the drawscreen() method into the init() method cases?


    Ok, thank you for the reply but im a bit new to gui so could you maybe explain that a bit more indepth?
    Posted in: Modification Development
  • To post a comment, please .