Power system re-write, recipe fixes.

Please note that this version breaks all wires placed in worlds before.
This commit is contained in:
Dragon2488 2016-07-18 11:57:52 +07:00
parent 25c581e129
commit d982cc4028
33 changed files with 507 additions and 859 deletions

View file

@ -13,6 +13,7 @@ import reborncore.common.util.ItemUtils;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.init.ModBlocks;
import techreborn.power.PowerNet;
public class TileEntityFusionController extends TilePowerAcceptor implements IInventoryProvider
{
@ -36,8 +37,7 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
}
@Override
public double getMaxPower()
{
public double getMaxPower() {
return 100000000;
}
@ -64,10 +64,8 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
}
@Override
public double getMaxInput()
{
if (hasStartedCrafting)
{
public double getMaxInput() {
if (hasStartedCrafting) {
return 0;
}
return 8192;
@ -275,6 +273,12 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
{
inventory.hasChanged = false;
}
if (!worldObj.isRemote && getEnergy() > 0 && hasStartedCrafting) {
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
}
}
private boolean validateRecipe()