Jump to content

Recommended Posts

Posted

So, hello ...

I created a Machine (Furnace based) and It require the Power Interface block at bottom.

It will only work if there is (more) 100 points of energy. I created a onBlockAdded in the InterfaceBlock but it not set the values of energyconsume and current energy. Classes are there too :

Interface Class

 

  Reveal hidden contents

 

Tile Entity of Interface:

 

  Reveal hidden contents

 

 

Things in the Machine class: (dont needed all thing in, it is lots(a lots of lots) lines  :) )

 

  Reveal hidden contents

 

TileEntity of Machine (I removed things that are unused in this problem)

 

  Reveal hidden contents

 

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

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

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

Posted

cool idea^^ you should not use onAddedBlock.

Use onBlockPlacedBy because that onAddedBlock activatet everytime you place a block around him that would make a view problems.

 

hmmm and you could make a transferfunction, That would help to than you can transfer the energy into the furnacemachine. And the furnacemachine would do less lag.

 

I hope that helps

Posted

Yes, thanks ...

I created the sending/receiving function, but on the paper momentally :)

Thanks for the help. I write If this will working...

 

//EDIT

So, it doesnt work, now it doesnt do nothing. .. Any things on memory ?

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

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

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

Posted

hmmm here:

 

Read the tileEntity and change it:

 

/**
 * Side Sensitive getBlockTileEntityFunction
 * @param par0 World
 * @param par1 xCoord
 * @param par2 yCoord
 * @param par3 zCoord
 * @param par4 Side
 * @return TileEntity of the tile entity
         */

now In your tile Entity Place something like that:

public void updateEntity()
{
     for(int i = 0; i<6;i++)
     {
           TileEntity tile = this.getTileEntity(worldObj, xCoord, yCoord, zCoord, i);
          if(tile != null && tile instanceof YourTile)
          {
                YourTile machine = (YourTile)tile;
                machine.fuel+= this.energy;
                this.energy-=this.energy;
          }
     }
}

 

so it is sending the whole energy to your machine.

This is only raw code. You have to make a view additions to it because that thing

will only sending power (if needed or not).

And by the way

Posted

Yes, I will try this, thanks...

I rewrited some functions, and I hope it will work as I need  :)

//EDIT

E, what tileEntity did you mean ?

the power interface or machine ?

///EDIT

More explanation: If I set the Energy to 100 in the TE_PowerInterface it works, but I cant do any operations with it:

It means: transfering and receiving energy... If I try to set the block energy when is placed ( .setEnergy(100) ) it dont work ...

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

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

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

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.