Jump to content

Creating Energy Conduits


Tikaji

Recommended Posts

So I'm creating a mod that has a power system in it and I'm having an issue creating conduits. I'm using the RedstoneFlux-API and power will bounce back and forth between the capacitor (storage entity) and the conduits. I figure its the way I'm transferring power between entities and wanted to come here to see if any one had a better way to do it than I have.

 

This is the way I'm passing power between entities:

 

 

@Override

public void updateEntity()

{

if(!worldObj.isRemote)

{

LogHelper.info(storage.getEnergyStored());

for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)

{

TileEntity entity = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);

 

if (entity instanceof IEnergyHandler)

{

storage.extractEnergy(((IEnergyHandler) entity).receiveEnergy(dir.getOpposite(), storage.extractEnergy(storage.getMaxExtract(), true), false), false);

}

}

}

}

 

 

 

Feel free to ask for more info.

My GitHub for this project:

https://github.com/Tikaji/HaloCraft

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.