Skip to content

Commit

Permalink
无线能源仓和无线激光仓添加能量输入速度限制
Browse files Browse the repository at this point in the history
  • Loading branch information
liansishen committed Jul 17, 2024
1 parent b872134 commit 10cb847
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void updateEnergy() {
private void useEnergy() {
var currentStored = energyContainer.getEnergyStored();
var maxStored = energyContainer.getEnergyCapacity();
var changeStored = maxStored - currentStored;
var changeStored = Math.min(maxStored - currentStored,energyContainer.getInputVoltage() * energyContainer.getInputVoltage());
if (changeStored <= 0) return;
if (!WirelessEnergyManager.addEUToGlobalEnergyMap(this.owner_uuid,-changeStored)) return;
energyContainer.setEnergyStored(maxStored);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void updateEnergy() {
private void useEnergy() {
var currentStored = energyContainer.getEnergyStored();
var maxStored = energyContainer.getEnergyCapacity();
var changeStored = maxStored - currentStored;
var changeStored = Math.min(maxStored - currentStored,energyContainer.getInputVoltage() * energyContainer.getInputVoltage());
if (changeStored <= 0) return;
if (!WirelessEnergyManager.addEUToGlobalEnergyMap(this.owner_uuid,-changeStored)) return;
energyContainer.setEnergyStored(maxStored);
Expand Down

0 comments on commit 10cb847

Please sign in to comment.