mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 14:53:05 +00:00
#666 Refactor error states, display multiple error states
This commit is contained in:
1 parent
5d9175a00d
commit
ff00017586
64 files changed
+1152
-1041
No files matched your search
@@ -141,13 +141,17 @@ public class EnergyManager implements IEnergyHandler {
|
||||
* @return true if the energy to do work was consumed
|
||||
*/
|
||||
public boolean consumeEnergyToDoWork() {
|
||||
if (energyStorage.getEnergyStored() < energyPerWork) {
|
||||
if (!hasEnergyToDoWork()) {
|
||||
return false;
|
||||
}
|
||||
energyStorage.modifyEnergyStored(-energyPerWork);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasEnergyToDoWork() {
|
||||
return energyStorage.getEnergyStored() >= energyPerWork;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends as much energy as it can to the tile at orientation.
|
||||
* For power sources. Ignores canExtract()
|
||||
|
||||
Reference in new issue
Block a user