Frinn38 / Custom-Machinery

A Minecraft Mod about creating cutom machines that works
GNU Lesser General Public License v3.0
45 stars 17 forks source link

Fix auto-input voiding energy of the neighbor energy storage #109

Closed andriihorpenko closed 8 months ago

andriihorpenko commented 8 months ago

Description

When auto-input is enabled, the machine will void all energy from the neighbor energy storage.

Cause

Currently, ForgeEnergyHandler extracts everything the neighbor energy storage can provide, instead of extracting precisely the amount a machine can except. We know how much energy a machine can accept according to maxInserted, so we should extract exactly that amount instead of maxAmount, which is Integer.MAX_VALUE and makes neighbor energy storage extract virtually everything into the void.