All users will need to merge their Minecraft Forum account with a new or existing Twitch account starting October 23rd. You can merge your accounts by clicking here. Have questions? Learn more here.
Dismiss
  • 0

    posted a message on [Forge][1.4.7]Multiblock Structures
    Erm, that's not what I meant. I know how to do something on interact: what I need to do is detect if the structure is complete. Yes, I have a complete tile entity, just by the way (except for the structure check, obviously). If you use railcraft, I mean something like the coke oven.
    Posted in: Modification Development
  • 0

    posted a message on [Forge][1.4.7]Multiblock Structures
    Anyone?
    Posted in: Modification Development
  • 0

    posted a message on [Forge][1.4.7]Multiblock Structures
    Hello!
    I’m making a mod that is going to need multi-block structures. By this, I mean something like Railcraft’s coke oven, where it doesn’t work unless in a specific configuration. In my case, I need a structure to only work when in a 5x5 platform. Any ideas on how to do this? (By the way, I AM using tile entities, and I have a general IDEA of what to do, but I’m having trouble executing it)

    Thanks!
    Posted in: Modification Development
  • 0

    posted a message on [forge] How to increase a block's update frequency
    Thanks to both of you!

    For CHEESEBOT (love the signature, by the way), I want to hold off on a tile entity momentarily, but if gegy's doesn't work, I'll use that.

    For gegy, where do I put this code? In the block? In the tile entity? Main class? Where? I put it in the block code (with @Override), and put in a system.out.println statement, but that isn't running, so it's not ticking.
    Posted in: Modification Development
  • 0

    posted a message on [forge] How to increase a block's update frequency
    Hello!

    I'm working on a mod using forge, and I'm wondering how to make a block update more frequently, not just when a neighbor updates or something. Meaning, I want a block to update every tick, or maybe every 10 ticks or so, or even every five seconds. I'm working on getting something similar to the coke oven in railcraft, and by that I mean a structure that you build in the world. I have it planned out, but I only need to increase the update frequency of one block to get it to (completely) work. (I'm using forge on MC 1.4.7, just by the way)

    If anyone has any ideas on this, that'd be great. Thanks!
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    I found somebody on the forge forums with the same problem, and when he updated to 1.4.2 it fixed itself. Obviously, that didn't work for me... :(
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    Umm, it turns out that's what I already have in there. (And the velocity variables were uncommented with @SideOnly(Side.Client) (It's a forge thing) around them. So... that's not it.

    I'll probably get a forge.net account and ask there, for teh heck of it.
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    K. I'll try later, don't have time now. Thanks though!
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    Like I said, that is pretty much what I did. Any other ideas? Did I register the entity right? Do I need to add a tracker to it? Etc.

    (Nice signature!)
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    Umm, I copied the exact method from Entity.java without the lines involving fire (can't see it because of privacy), forge custom data, and something about the id, and it doesn't work. Doesn't save the entity. Here's just my methods:

    protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
        {
         par1NBTTagCompound.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ}));
            par1NBTTagCompound.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
            par1NBTTagCompound.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch}));
            par1NBTTagCompound.setFloat("FallDistance", this.fallDistance);
            par1NBTTagCompound.setShort("Air", (short)this.getAir());
            par1NBTTagCompound.setBoolean("OnGround", this.onGround);
            par1NBTTagCompound.setInteger("Dimension", this.dimension);
            this.writeEntityToNBT(par1NBTTagCompound);
        }
    
        /**
         * (abstract) Protected helper method to read subclass entity data from NBT.
         */
        protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
        {
         NBTTagList var2 = par1NBTTagCompound.getTagList("Pos");
            NBTTagList var3 = par1NBTTagCompound.getTagList("Motion");
            NBTTagList var4 = par1NBTTagCompound.getTagList("Rotation");
            this.motionX = ((NBTTagDouble)var3.tagAt(0)).data;
            this.motionY = ((NBTTagDouble)var3.tagAt(1)).data;
            this.motionZ = ((NBTTagDouble)var3.tagAt(2)).data;
    
            if (Math.abs(this.motionX) > 10.0D)
            {
                this.motionX = 0.0D;
            }
    
            if (Math.abs(this.motionY) > 10.0D)
            {
                this.motionY = 0.0D;
            }
    
            if (Math.abs(this.motionZ) > 10.0D)
            {
                this.motionZ = 0.0D;
            }
    
            this.prevPosX = this.lastTickPosX = this.posX = ((NBTTagDouble)var2.tagAt(0)).data;
            this.prevPosY = this.lastTickPosY = this.posY = ((NBTTagDouble)var2.tagAt(1)).data;
            this.prevPosZ = this.lastTickPosZ = this.posZ = ((NBTTagDouble)var2.tagAt(2)).data;
            this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var4.tagAt(0)).data;
            this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var4.tagAt(1)).data;
            this.fallDistance = par1NBTTagCompound.getFloat("FallDistance");
            this.setAir(par1NBTTagCompound.getShort("Air"));
            this.onGround = par1NBTTagCompound.getBoolean("OnGround");
            this.dimension = par1NBTTagCompound.getInteger("Dimension");
            this.setPosition(this.posX, this.posY, this.posZ);
            this.setRotation(this.rotationYaw, this.rotationPitch);
            this.readEntityFromNBT(par1NBTTagCompound);
        }
    Sorry, didn't see your reply there, but that's pretty much what I did.
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    Yes, it's a lot of code. I copied the boat code and modified it a bit. Would it be like this?


    protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    {
    super.writeToNBT(par1NBTTagCompound);
    par1NBTTagCompound.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ}));
    }
    If it is, then good! If not, then I'm confuzzled :)
    BTW, I updated to 1.4.2.
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    By the way, the absence of the model is on purpose: I haven't tried to add it yet. :)
    Posted in: Modification Development
  • 0

    posted a message on Entity not Saving [Forge 1.3.2]
    Hello! I'm working on a mod with MC Forge for MC 1.3.2 (yes I know, I'll be upgrading) and I've got an entity. No model yet, just a white box. However, when I log out of the world and come back, it's gone. In other words, the entity doesn't save itself. Here's my entity code:

    EntityMech.java
    package nerdicus.fwc;
    
    import java.util.Iterator;
    import java.util.List;
    
    import net.minecraft.src.AxisAlignedBB;
    import net.minecraft.src.Block;
    import net.minecraft.src.DamageSource;
    import net.minecraft.src.Entity;
    import net.minecraft.src.EntityBoat;
    import net.minecraft.src.EntityPlayer;
    import net.minecraft.src.EntityTracker;
    import net.minecraft.src.Item;
    import net.minecraft.src.Material;
    import net.minecraft.src.MathHelper;
    import net.minecraft.src.NBTTagCompound;
    import net.minecraft.src.NBTTagDouble;
    import net.minecraft.src.NBTTagFloat;
    import net.minecraft.src.NBTTagList;
    import net.minecraft.src.World;
    import cpw.mods.fml.common.Side;
    import cpw.mods.fml.common.asm.SideOnly;
    
    public class EntityMech extends Entity
    {
    private boolean field_70279_a;
    private double field_70276_b;
    private int mechPosRotationIncrements;
    private double mechX;
    private double mechY;
    private double mechZ;
    private double mechYaw;
    private double mechPitch;
    @SideOnly(Side.CLIENT)
    private double velocityX;
    @SideOnly(Side.CLIENT)
    private double velocityY;
    @SideOnly(Side.CLIENT)
    private double velocityZ;
    
    public EntityMech(World par1World)
    {
    super(par1World);
    this.field_70279_a = true;
    this.field_70276_b = 0.07D;
    this.preventEntitySpawning = true;
    this.setSize(1.5F, 0.6F);
    this.yOffset = this.height / 2.0F;
    }
    
    /**
    * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
    * prevent them from trampling crops
    */
    protected boolean canTriggerWalking()
    {
    return true;
    }
    
    protected void entityInit()
    {
    this.dataWatcher.addObject(16, new Byte((byte)0));
    this.dataWatcher.addObject(17, new Integer(0));
    this.dataWatcher.addObject(18, new Integer(1));
    this.dataWatcher.addObject(19, new Integer(0));
    
    this.dataWatcher.addObject(20, new Byte((byte)1));
    }
    
    /**
    * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be
    * pushable on contact, like boats or minecarts.
    */
    public AxisAlignedBB getCollisionBox(Entity par1Entity)
    {
    return par1Entity.boundingBox;
    }
    
    /**
    * returns the bounding box for this entity
    */
    public AxisAlignedBB getBoundingBox()
    {
    return this.boundingBox;
    }
    
    /**
    * Returns true if this entity should push and be pushed by other entities when colliding.
    */
    public boolean canBePushed()
    {
    return true;
    }
    
    public EntityMech(World par1World, double par2, double par4, double par6)
    {
    this(par1World);
    this.setPosition(par2, par4 + (double)this.yOffset, par6);
    this.motionX = 0.0D;
    this.motionY = 0.0D;
    this.motionZ = 0.0D;
    this.prevPosX = par2;
    this.prevPosY = par4;
    this.prevPosZ = par6;
    }
    
    /**
    * Returns the Y offset from the entity's position for any entity riding this one.
    */
    public double getMountedYOffset()
    {
    return (double)this.height * 0.0D - 0.30000001192092896D;
    }
    
    /**
    * Called when the entity is attacked.
    */
    public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
    {
    if (!this.worldObj.isRemote && !this.isDead)
    {
    this.setForwardDirection(-this.getForwardDirection());
    this.setTimeSinceHit(10);
    this.setDamageTaken(this.getDamageTaken() + par2 * 10);
    this.setBeenAttacked();
    
    if (par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode)
    {
    this.setDamageTaken(100);
    }
    
    if (this.getDamageTaken() > 40)
    {
    if (this.riddenByEntity != null)
    {
    this.riddenByEntity.mountEntity(this);
    }
    
    this.dropItemWithOffset(Item.boat.shiftedIndex, 1, 0.0F);
    this.setDead();
    }
    
    return true;
    }
    else
    {
    return true;
    }
    }
    
    @SideOnly(Side.CLIENT)
    
    /**
    * Setups the entity to do the hurt animation. Only used by packets in multiplayer.
    */
    public void performHurtAnimation()
    {
    this.setForwardDirection(-this.getForwardDirection());
    this.setTimeSinceHit(10);
    this.setDamageTaken(this.getDamageTaken() * 11);
    }
    
    /**
    * Returns true if other Entities should be prevented from moving through this Entity.
    */
    public boolean canBeCollidedWith()
    {
    return !this.isDead;
    }
    
    @SideOnly(Side.CLIENT)
    
    /**
    * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
    * posY, posZ, yaw, pitch
    */
    public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
    {
    if (this.field_70279_a)
    {
    this.mechPosRotationIncrements = par9 + 5;
    }
    else
    {
    double var10 = par1 - this.posX;
    double var12 = par3 - this.posY;
    double var14 = par5 - this.posZ;
    double var16 = var10 * var10 + var12 * var12 + var14 * var14;
    
    if (var16 <= 1.0D)
    {
    return;
    }
    
    this.mechPosRotationIncrements = 3;
    }
    
    this.mechX = par1;
    this.mechY = par3;
    this.mechZ = par5;
    this.mechYaw = (double)par7;
    this.mechPitch = (double)par8;
    this.motionX = this.velocityX;
    this.motionY = this.velocityY;
    this.motionZ = this.velocityZ;
    }
    
    @SideOnly(Side.CLIENT)
    
    /**
    * Sets the velocity to the args. Args: x, y, z
    */
    public void setVelocity(double par1, double par3, double par5)
    {
    this.velocityX = this.motionX = par1;
    this.velocityY = this.motionY = par3;
    this.velocityZ = this.motionZ = par5;
    }
    
    /**
    * Called to update the entity's position/logic.
    */
    public void onUpdate()
    {
    super.onUpdate();
    
    if (this.getTimeSinceHit() > 0)
    {
    this.setTimeSinceHit(this.getTimeSinceHit() - 1);
    }
    
    if (this.getDamageTaken() > 0)
    {
    this.setDamageTaken(this.getDamageTaken() - 1);
    }
    
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;
    byte var1 = 5;
    double var2 = 0.0D;
    
    for (int var4 = 0; var4 < var1; ++var4)
    {
    double var5 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 0) / (double)var1 - 0.125D;
    double var7 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 1) / (double)var1 - 0.125D;
    AxisAlignedBB var9 = AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(this.boundingBox.minX, var5, this.boundingBox.minZ, this.boundingBox.maxX, var7, this.boundingBox.maxZ);
    
    if (this.worldObj.isAABBInMaterial(var9, Material.water))
    {
    var2 += 1.0D / (double)var1;
    }
    }
    
    double var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
    double var6;
    double var8;
    
    if (var24 > 0.26249999999999996D)
    {
    var6 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D);
    var8 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D);
    
    for (int var10 = 0; (double)var10 < 1.0D + var24 * 60.0D; ++var10)
    {
    double var11 = (double)(this.rand.nextFloat() * 2.0F - 1.0F);
    double var13 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D;
    double var15;
    double var17;
    
    if (this.rand.nextBoolean())
    {
    var15 = this.posX - var6 * var11 * 0.8D + var8 * var13;
    var17 = this.posZ - var8 * var11 * 0.8D - var6 * var13;
    this.worldObj.spawnParticle("splash", var15, this.posY - 0.125D, var17, this.motionX, this.motionY, this.motionZ);
    }
    else
    {
    var15 = this.posX + var6 + var8 * var11 * 0.7D;
    var17 = this.posZ + var8 - var6 * var11 * 0.7D;
    this.worldObj.spawnParticle("splash", var15, this.posY - 0.125D, var17, this.motionX, this.motionY, this.motionZ);
    }
    }
    }
    
    double var12;
    double var26;
    
    if (this.worldObj.isRemote && this.field_70279_a)
    {
    if (this.mechPosRotationIncrements > 0)
    {
    var6 = this.posX + (this.mechX - this.posX) / (double)this.mechPosRotationIncrements;
    var8 = this.posY + (this.mechY - this.posY) / (double)this.mechPosRotationIncrements;
    var26 = this.posZ + (this.mechZ - this.posZ) / (double)this.mechPosRotationIncrements;
    var12 = MathHelper.wrapAngleTo180_double(this.mechYaw - (double)this.rotationYaw);
    this.rotationYaw = (float)((double)this.rotationYaw + var12 / (double)this.mechPosRotationIncrements);
    this.rotationPitch = (float)((double)this.rotationPitch + (this.mechPitch - (double)this.rotationPitch) / (double)this.mechPosRotationIncrements);
    --this.mechPosRotationIncrements;
    this.setPosition(var6, var8, var26);
    this.setRotation(this.rotationYaw, this.rotationPitch);
    }
    else
    {
    var6 = this.posX + this.motionX;
    var8 = this.posY + this.motionY;
    var26 = this.posZ + this.motionZ;
    this.setPosition(var6, var8, var26);
    
    if (this.onGround)
    {
    this.motionX *= 0.5D;
    this.motionY *= 0.5D;
    this.motionZ *= 0.5D;
    }
    
    this.motionX *= 0.9900000095367432D;
    this.motionY *= 0.949999988079071D;
    this.motionZ *= 0.9900000095367432D;
    }
    }
    else
    {
    if (var2 < 1.0D)
    {
    var6 = var2 * 2.0D - 1.0D;
    this.motionY += 0.03999999910593033D * var6;
    }
    else
    {
    if (this.motionY < 0.0D)
    {
    this.motionY /= 2.0D;
    }
    
    this.motionY += 0.007000000216066837D;
    }
    
    if (this.riddenByEntity != null)
    {
    this.motionX += this.riddenByEntity.motionX * this.field_70276_b;
    this.motionZ += this.riddenByEntity.motionZ * this.field_70276_b;
    }
    
    var6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
    
    if (var6 > 0.35D)
    {
    var8 = 0.35D / var6;
    this.motionX *= var8;
    this.motionZ *= var8;
    var6 = 0.35D;
    }
    
    if (var6 > var24 && this.field_70276_b < 0.35D)
    {
    this.field_70276_b += (0.35D - this.field_70276_B) / 35.0D;
    
    if (this.field_70276_b > 0.35D)
    {
    this.field_70276_b = 0.35D;
    }
    }
    else
    {
    this.field_70276_b -= (this.field_70276_b - 0.07D) / 35.0D;
    
    if (this.field_70276_b < 0.07D)
    {
    this.field_70276_b = 0.07D;
    }
    }
    
    if (this.onGround)
    {
    this.motionX *= 0.5D;
    this.motionY *= 0.5D;
    this.motionZ *= 0.5D;
    }
    
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    
    if (this.isCollidedHorizontally && var24 > 0.2D)
    {
    if (!this.worldObj.isRemote)
    {
    this.setDead();
    int var25;
    
    for (var25 = 0; var25 < 3; ++var25)
    {
    this.dropItemWithOffset(Block.planks.blockID, 1, 0.0F);
    }
    
    for (var25 = 0; var25 < 2; ++var25)
    {
    this.dropItemWithOffset(Item.stick.shiftedIndex, 1, 0.0F);
    }
    }
    }
    else
    {
    this.motionX *= 0.9900000095367432D;
    this.motionY *= 0.949999988079071D;
    this.motionZ *= 0.9900000095367432D;
    }
    
    this.rotationPitch = 0.0F;
    var8 = (double)this.rotationYaw;
    var26 = this.prevPosX - this.posX;
    var12 = this.prevPosZ - this.posZ;
    
    if (var26 * var26 + var12 * var12 > 0.001D)
    {
    var8 = (double)((float)(Math.atan2(var12, var26) * 180.0D / Math.PI));
    }
    
    double var14 = MathHelper.wrapAngleTo180_double(var8 - (double)this.rotationYaw);
    
    if (var14 > 20.0D)
    {
    var14 = 20.0D;
    }
    
    if (var14 < -20.0D)
    {
    var14 = -20.0D;
    }
    
    this.rotationYaw = (float)((double)this.rotationYaw + var14);
    this.setRotation(this.rotationYaw, this.rotationPitch);
    
    if (!this.worldObj.isRemote)
    {
    List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
    
    if (var16 != null && !var16.isEmpty())
    {
    Iterator var28 = var16.iterator();
    
    while (var28.hasNext())
    {
    Entity var18 = (Entity)var28.next();
    
    if (var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat)
    {
    var18.applyEntityCollision(this);
    }
    }
    }
    
    for (int var27 = 0; var27 < 4; ++var27)
    {
    int var29 = MathHelper.floor_double(this.posX + ((double)(var27 % 2) - 0.5D) * 0.8D);
    int var19 = MathHelper.floor_double(this.posZ + ((double)(var27 / 2) - 0.5D) * 0.8D);
    
    for (int var20 = 0; var20 < 2; ++var20)
    {
    int var21 = MathHelper.floor_double(this.posY) + var20;
    int var22 = this.worldObj.getBlockId(var29, var21, var19);
    int var23 = this.worldObj.getBlockMetadata(var29, var21, var19);
    
    if (var22 == Block.snow.blockID)
    {
    this.worldObj.setBlockWithNotify(var29, var21, var19, 0);
    }
    else if (var22 == Block.waterlily.blockID)
    {
    Block.waterlily.dropBlockAsItemWithChance(this.worldObj, var29, var21, var19, var23, 0.3F, 0);
    this.worldObj.setBlockWithNotify(var29, var21, var19, 0);
    }
    }
    }
    
    if (this.riddenByEntity != null && this.riddenByEntity.isDead)
    {
    this.riddenByEntity = null;
    }
    }
    }
    }
    
    public void updateRiderPosition()
    {
    if (this.riddenByEntity != null)
    {
    //double var1 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.2D;
    //double var3 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.2D;
    this.riddenByEntity.setPosition(this.posX/* + var1*/, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + 0.5, this.posZ/* + var3*/);
    }
    }
    
    /**
    * (abstract) Protected helper method to write subclass entity data to NBT.
    */
    protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    {
    super.writeToNBT(par1NBTTagCompound);
    }
    
    /**
    * (abstract) Protected helper method to read subclass entity data from NBT.
    */
    protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
    {
    super.readFromNBT(par1NBTTagCompound);
    }
    
    @SideOnly(Side.CLIENT)
    public float getShadowSize()
    {
    return 0.0F;
    }
    
    /**
    * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
    */
    public boolean interact(EntityPlayer par1EntityPlayer) //Handles mounting of the Mech
    {
    if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer)
    {
    return true;
    }
    else
    {
    //if (!this.worldObj.isRemote)
    //{
    par1EntityPlayer.mountEntity(this);
    //}
    
    return true;
    }
    }
    
    /**
    * Sets the damage taken from the last hit.
    */
    public void setDamageTaken(int par1)
    {
    this.dataWatcher.updateObject(19, Integer.valueOf(par1));
    }
    
    /**
    * Gets the damage taken from the last hit.
    */
    public int getDamageTaken()
    {
    return this.dataWatcher.getWatchableObjectInt(19);
    }
    
    /**
    * Sets the time to count down from since the last time entity was hit.
    */
    public void setTimeSinceHit(int par1)
    {
    this.dataWatcher.updateObject(17, Integer.valueOf(par1));
    }
    
    /**
    * Gets the time since the last hit.
    */
    public int getTimeSinceHit()
    {
    return this.dataWatcher.getWatchableObjectInt(17);
    }
    
    /**
    * Sets the forward direction of the entity.
    */
    public void setForwardDirection(int par1)
    {
    this.dataWatcher.updateObject(18, Integer.valueOf(par1));
    }
    
    /**
    * Gets the forward direction of the entity.
    */
    public int getForwardDirection()
    {
    return this.dataWatcher.getWatchableObjectInt(18);
    }
    
    public void setCanBeControlled(int par1)
    {
    this.dataWatcher.updateObject(20, Byte.valueOf((byte)(par1)));
    }
    
    public int getCanBeControlled()
    {
    return this.dataWatcher.getWatchableObjectByte(20);
    }
    
    @SideOnly(Side.CLIENT)
    public void func_70270_d(boolean par1)
    {
    this.field_70279_a = par1;
    }
    }

    Here's my mod file (- the unneccesary stuff like items, etc.)

    FutureWarCraft.java
    package nerdicus.fwc; //Change this to your package
    
    import net.minecraft.src.Block;
    import net.minecraft.src.EnumCreatureType;
    import net.minecraft.src.FurnaceRecipes;
    import net.minecraft.src.Item;
    import net.minecraft.src.ItemStack;
    import net.minecraft.src.ModLoader;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.Init;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.network.NetworkMod;
    import cpw.mods.fml.common.registry.EntityRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.common.registry.LanguageRegistry;
    
    @NetworkMod(clientSideRequired=true, serverSideRequired=false)
    @Mod(modid="FWC", name="Future Warcraft", version="Alpha v0.1")
    
    public class FutureWarCraft
    {
    @Instance
    public FutureWarCraft instance;
    
    @Init
    public void FWCInit(FMLInitializationEvent initEvent)
    {
    EntityRegistry.registerModEntity(EntityMech.class, "Mech", 0, this, 64, 4, false); // NO, this doesn't save the entity correctly for some reason.
    }
    }


    Please help me! Thanks!
    Posted in: Modification Development
  • 0

    posted a message on [1.4.7][forge]Blaueseichoern's GUI Tutorial
    I tried copying and pasting the containerfurnace code that displays the players slots (with proper edits, of course) and I still get the same problem. Any ideas, or is it a MC/Forge problem?
    Posted in: Tutorials
  • 0

    posted a message on [1.4.7][forge]Blaueseichoern's GUI Tutorial
    I'm not using your tutorial, and I'm doing MC 1.2.5, but I'm getting a problem with displaying the player's inventory. If I click on the top row of the inventory, no items get picked up but the item on the top row is highlighted. If i click on the second row down, the item on the second row is highlighted, but the item from the top row gets picked up, and so on. Also, I can't pick up anything from the hotbar. Help!

    Example:
    [ ] <- This gets picked up
    [ ] <- If I click here

    Code (for the player inventory part only)

    public ContainerMech(IInventory iinventory, EntityMech entitymech)
    {
    player = iinventory;
    for (int i = 0; i < 3; i++)
    {
    for (int k = 0; k < 9; k++)
    {
    	addSlot(new Slot(player, k + i * 9 + 9, 8 + k * 18, 84 + i * 18));
    }
    }
    for (int j = 0; j < 9; j++)
    {
    addSlot(new Slot(player, j, 8 + j * 18, 142));
    }
    }

    Yes the player variable is declared as
    private IInventory player;
    Posted in: Tutorials
  • To post a comment, please or register a new account.