Skip to content

Commit

Permalink
remove exception, instead calculate (#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueWeabo committed Jan 7, 2023
1 parent b34471f commit 18139b7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 171 deletions.
8 changes: 4 additions & 4 deletions src/main/java/gregtech/api/util/GT_OverclockCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,19 @@ private void calculateOverclock() {
/**
* @return The consumtipn after overclock has been calculated
*/
public long getConsumption() throws Exception {
public long getConsumption() {
if (!calculated) {
throw new Exception("Tried to get consumption before calculating!");
calculate();
}
return mRecipeEUt;
}

/**
* @return The duration of the recipe after overclock has been calculated
*/
public int getDuration() throws Exception {
public int getDuration() {
if (!calculated) {
throw new Exception("Tried to get duration before calculating!");
calculate();
}
return mDuration;
}
Expand Down
Loading

0 comments on commit 18139b7

Please sign in to comment.