Add flat taxing to PowerHandler for King Lemming
This should be a non-breaking API change.
This commit is contained in:
parent
a52437b618
commit
6c76a9a8d6
1 changed files with 13 additions and 0 deletions
|
@ -82,6 +82,17 @@ public final class PowerHandler {
|
|||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
/**
|
||||
* Taxes a flat rate on all incoming power.
|
||||
*
|
||||
* Defaults to 0% tax rate.
|
||||
*
|
||||
* @return percent of input to tax
|
||||
*/
|
||||
public float getTaxPercent() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator();
|
||||
private float minEnergyReceived;
|
||||
|
@ -347,6 +358,8 @@ public final class PowerHandler {
|
|||
}
|
||||
|
||||
updateSources(from);
|
||||
|
||||
used -= used * getPerdition().getTaxPercent();
|
||||
|
||||
used = addEnergy(used);
|
||||
|
||||
|
|
Loading…
Reference in a new issue