Jump to content

[1.7.10] Duplicate EnergyStorage Instance Help


Roomofr

Recommended Posts

	protected EnergyStorage localEnergyStorage;
private int transferRate;
private int capacity;
public int level;
public int lastUsed;

        public TileEntityExtruder() {
this.transferRate = 100000;
this.capacity = 100000;
	if (this.localEnergyStorage == null) {
		localEnergyStorage = new EnergyStorage(this.capacity, this.transferRate);
	}
}
@Override
public boolean canConnectEnergy(ForgeDirection from) {
	return true;
}

@Override
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
	int used = localEnergyStorage.receiveEnergy(maxReceive, simulate);
	if (used > 0 && !simulate) {
		this.markDirty();
	}
	return used;
}

@Override
public int getEnergyStored(ForgeDirection from) {
	return localEnergyStorage.getEnergyStored();
}

@Override
public int getMaxEnergyStored(ForgeDirection from) {
	return localEnergyStorage.getMaxEnergyStored();
}
        public void updateEntity() {System.out.println("-" + getEnergyStored(null));} //My problem 

 

For some reason in the console I get this:

 

-10000
-0
-10000
-0
-10000
-0
-10000
-0

 

Thanks in advance ;) (I probably forgot to do something stupid)

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.