Skip to content

Commit

Permalink
Fix Wireless Terminal IEnergyHost implementation (fixes #7077) (#7081)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla authored and Technici4n committed May 22, 2023
1 parent fa1c924 commit 09210df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/appeng/helpers/WirelessTerminalMenuHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ public MEStorage getInventory() {
@Override
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier) {
if (this.terminal != null) {
final double extracted = Math.min(amt, this.terminal.getAECurrentPower(getItemStack()));

if (mode == Actionable.SIMULATE) {
return this.terminal.hasPower(getPlayer(), amt, getItemStack()) ? amt : 0;
return extracted;
}
return this.terminal.usePower(getPlayer(), amt, getItemStack()) ? amt : 0;

return this.terminal.usePower(getPlayer(), extracted, getItemStack()) ? extracted : 0;
}
return 0.0;
}
Expand Down

0 comments on commit 09210df

Please sign in to comment.