Fixes due to PowerAcceptorBE changes.

This commit is contained in:
drcrazy 2020-10-20 17:21:27 +03:00
parent 09d9d6e7ea
commit df974ef5da
54 changed files with 79 additions and 100 deletions

View file

@ -56,6 +56,6 @@ public class DataDrivenGui extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -134,12 +134,9 @@ public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEn
} }
protected boolean tryAddingEnergy(int amount) { protected boolean tryAddingEnergy(int amount) {
if (getMaxPower() - getEnergy() >= amount) { if (getFreeSpace() > 0) {
addEnergy(amount); addEnergy(amount);
return true; return true;
} else if (getMaxPower() - getEnergy() > 0) {
addEnergy(getMaxPower() - getEnergy());
return true;
} }
return false; return false;

View file

@ -233,7 +233,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
.formatted(Formatting.GRAY) .formatted(Formatting.GRAY)
.append(": ") .append(": ")
.append( .append(
new LiteralText(PowerSystem.getLocaliszedPowerFormatted(getMaxPower())) new LiteralText(PowerSystem.getLocaliszedPowerFormatted(getMaxStoredPower()))
.formatted(Formatting.GOLD) .formatted(Formatting.GOLD)
) )
); );

View file

@ -49,13 +49,11 @@ public class DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
} }
private boolean tryAddingEnergy(int amount) { private boolean tryAddingEnergy(int amount) {
if (this.getMaxPower() - this.getEnergy() >= amount) { if (getFreeSpace() > 0) {
addEnergy(amount); addEnergy(amount);
return true; return true;
} else if (this.getMaxPower() - this.getEnergy() > 0) {
addEnergy(this.getMaxPower() - this.getEnergy());
return true;
} }
return false; return false;
} }

View file

@ -81,7 +81,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl
return; return;
} }
discharge(1); discharge(1);
if (getEnergy() < getMaxPower()) { if (getEnergy() < getMaxStoredPower()) {
if (burnTime > 0) { if (burnTime > 0) {
burnTime--; burnTime--;
addEnergy(TechRebornConfig.solidFuelGeneratorOutputAmount); addEnergy(TechRebornConfig.solidFuelGeneratorOutputAmount);
@ -118,7 +118,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl
final BlockState BlockStateContainer = world.getBlockState(pos); final BlockState BlockStateContainer = world.getBlockState(pos);
if (BlockStateContainer.getBlock() instanceof BlockMachineBase) { if (BlockStateContainer.getBlock() instanceof BlockMachineBase) {
final BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); final BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock();
boolean active = burnTime > 0 && getEnergy() < getMaxPower(); boolean active = burnTime > 0 && getFreeSpace() > 0.0f;
if (BlockStateContainer.get(BlockMachineBase.ACTIVE) != active) { if (BlockStateContainer.get(BlockMachineBase.ACTIVE) != active) {
blockMachineBase.setActive(active, world, pos); blockMachineBase.setActive(active, world, pos);
} }

View file

@ -43,6 +43,7 @@ import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import reborncore.common.util.StringUtils; import reborncore.common.util.StringUtils;
import reborncore.common.util.Torus; import reborncore.common.util.Torus;
import team.reborn.energy.EnergySide;
import techreborn.api.recipe.recipes.FusionReactorRecipe; import techreborn.api.recipe.recipes.FusionReactorRecipe;
import techreborn.blockentity.machine.GenericMachineBlockEntity; import techreborn.blockentity.machine.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
@ -240,7 +241,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity
if (!hasStartedCrafting) { if (!hasStartedCrafting) {
// Ignition! // Ignition!
if (canUseEnergy(currentRecipe.getStartEnergy())) { if (getStored(EnergySide.UNKNOWN) > currentRecipe.getStartEnergy()) {
useEnergy(currentRecipe.getStartEnergy()); useEnergy(currentRecipe.getStartEnergy());
hasStartedCrafting = true; hasStartedCrafting = true;
useInput(topStackSlot); useInput(topStackSlot);
@ -256,7 +257,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity
powerChange = (power); powerChange = (power);
crafingTickTime++; crafingTickTime++;
} else { // Power user } else { // Power user
if (canUseEnergy(currentRecipe.getPower())) { if (getStored(EnergySide.UNKNOWN) > currentRecipe.getPower()) {
setEnergy(getEnergy() - currentRecipe.getPower()); setEnergy(getEnergy() - currentRecipe.getPower());
crafingTickTime++; crafingTickTime++;
} }

View file

@ -46,6 +46,7 @@ import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.recipes.ExtendedRecipeRemainder; import reborncore.common.recipes.ExtendedRecipeRemainder;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
import techreborn.init.ModSounds; import techreborn.init.ModSounds;
import techreborn.init.TRBlockEntities; import techreborn.init.TRBlockEntities;
@ -265,7 +266,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
} }
} else { } else {
if (canMake(recipe)) { if (canMake(recipe)) {
if (canUseEnergy(euTick)) { if (getStored(EnergySide.UNKNOWN) > euTick) {
progress++; progress++;
if (progress == 1) { if (progress == 1) {
world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.AUTO_CRAFTING, world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.AUTO_CRAFTING,

View file

@ -40,6 +40,7 @@ import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.recipes.RecipeCrafter; import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities; import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -218,7 +219,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
craftRecipe(currentRecipe); craftRecipe(currentRecipe);
updateCurrentRecipe(); updateCurrentRecipe();
} else if (cookTime < cookTimeTotal) { } else if (cookTime < cookTimeTotal) {
if (canUseEnergy(getEuPerTick(EnergyPerTick))) { if (getStored(EnergySide.UNKNOWN) > getEuPerTick(EnergyPerTick)) {
useEnergy(getEuPerTick(EnergyPerTick)); useEnergy(getEuPerTick(EnergyPerTick));
cookTime++; cookTime++;
if (cookTime == 1 || cookTime % 20 == 0 && RecipeCrafter.soundHanlder != null) { if (cookTime == 1 || cookTime % 20 == 0 && RecipeCrafter.soundHanlder != null) {

View file

@ -41,6 +41,7 @@ import reborncore.common.blockentity.MultiblockWriter;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import techreborn.blocks.lighting.LampBlock; import techreborn.blocks.lighting.LampBlock;
import techreborn.blocks.misc.BlockRubberLog; import techreborn.blocks.misc.BlockRubberLog;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
@ -76,7 +77,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
|| block instanceof SugarCaneBlock || block instanceof SugarCaneBlock
|| block instanceof CactusBlock || block instanceof CactusBlock
) { ) {
if (canUseEnergy(TechRebornConfig.greenhouseControllerEnergyPerBonemeal)) { if (getStored(EnergySide.UNKNOWN) > TechRebornConfig.greenhouseControllerEnergyPerBonemeal) {
useEnergy(TechRebornConfig.greenhouseControllerEnergyPerBonemeal); useEnergy(TechRebornConfig.greenhouseControllerEnergyPerBonemeal);
blockState.scheduledTick((ServerWorld) world, blockPos, world.random); blockState.scheduledTick((ServerWorld) world, blockPos, world.random);
} }
@ -112,7 +113,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
} else if (block instanceof BlockRubberLog) { } else if (block instanceof BlockRubberLog) {
for (int y = 0; (blockState = world.getBlockState(blockPos.up(y))).getBlock() == block && y < 10; y++) { for (int y = 0; (blockState = world.getBlockState(blockPos.up(y))).getBlock() == block && y < 10; y++) {
if (blockState.get(BlockRubberLog.HAS_SAP) if (blockState.get(BlockRubberLog.HAS_SAP)
&& canUseEnergy(TechRebornConfig.greenhouseControllerEnergyPerHarvest) && (getStored(EnergySide.UNKNOWN) > TechRebornConfig.greenhouseControllerEnergyPerHarvest)
&& insertIntoInv(Collections.singletonList(TRContent.Parts.SAP.getStack())) && insertIntoInv(Collections.singletonList(TRContent.Parts.SAP.getStack()))
) { ) {
useEnergy(TechRebornConfig.greenhouseControllerEnergyPerHarvest); useEnergy(TechRebornConfig.greenhouseControllerEnergyPerHarvest);
@ -138,7 +139,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
if (world == null) { if (world == null) {
return false; return false;
} }
if (!canUseEnergy(TechRebornConfig.greenhouseControllerEnergyPerHarvest)){ if (getStored(EnergySide.UNKNOWN) < TechRebornConfig.greenhouseControllerEnergyPerHarvest){
return false; return false;
} }
if (insertIntoInv(Block.getDroppedStacks(blockState, (ServerWorld) world, blockPos, null))) { if (insertIntoInv(Block.getDroppedStacks(blockState, (ServerWorld) world, blockPos, null))) {
@ -195,7 +196,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
return; return;
} }
if (useEnergy(getEuPerTick(TechRebornConfig.greenhouseControllerEnergyPerTick)) != getEuPerTick(TechRebornConfig.greenhouseControllerEnergyPerTick)) { if (getStored(EnergySide.UNKNOWN) < getEuPerTick(TechRebornConfig.greenhouseControllerEnergyPerTick)) {
return; return;
} }

View file

@ -32,6 +32,7 @@ import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop; import reborncore.api.IToolDrop;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.WorldUtils; import reborncore.common.util.WorldUtils;
import team.reborn.energy.EnergySide;
import techreborn.blocks.machine.tier1.PlayerDetectorBlock; import techreborn.blocks.machine.tier1.PlayerDetectorBlock;
import techreborn.blocks.machine.tier1.PlayerDetectorBlock.PlayerDetectorType; import techreborn.blocks.machine.tier1.PlayerDetectorBlock.PlayerDetectorType;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
@ -59,7 +60,7 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
if (!world.isClient && world.getTime() % 20 == 0) { if (!world.isClient && world.getTime() % 20 == 0) {
boolean lastRedstone = redstone; boolean lastRedstone = redstone;
redstone = false; redstone = false;
if (canUseEnergy(TechRebornConfig.playerDetectorEuPerTick)) { if (getStored(EnergySide.UNKNOWN) > TechRebornConfig.playerDetectorEuPerTick) {
for (PlayerEntity player : world.getPlayers()) { for (PlayerEntity player : world.getPlayers()) {
if (player.distanceTo(player) <= 256.0D) { if (player.distanceTo(player) <= 256.0D) {
PlayerDetectorType type = world.getBlockState(pos).get(PlayerDetectorBlock.TYPE); PlayerDetectorType type = world.getBlockState(pos).get(PlayerDetectorBlock.TYPE);

View file

@ -40,6 +40,7 @@ import reborncore.common.blockentity.SlotConfiguration;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities; import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -106,7 +107,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
final BlockState BlockStateContainer = world.getBlockState(pos); final BlockState BlockStateContainer = world.getBlockState(pos);
if (BlockStateContainer.getBlock() instanceof BlockMachineBase) { if (BlockStateContainer.getBlock() instanceof BlockMachineBase) {
final BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); final BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock();
boolean shouldBurn = isBurning || (canRecycle() && canUseEnergy(getEuPerTick(cost))); boolean shouldBurn = isBurning || (canRecycle() && (getStored(EnergySide.UNKNOWN) > getEuPerTick(cost)));
if (BlockStateContainer.get(BlockMachineBase.ACTIVE) != shouldBurn) { if (BlockStateContainer.get(BlockMachineBase.ACTIVE) != shouldBurn) {
blockMachineBase.setActive(isBurning, world, pos); blockMachineBase.setActive(isBurning, world, pos);
} }
@ -126,7 +127,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
if (canRecycle() && !isBurning() && getEnergy() != 0) { if (canRecycle() && !isBurning() && getEnergy() != 0) {
setBurning(true); setBurning(true);
} else if (isBurning()) { } else if (isBurning()) {
if (useEnergy(getEuPerTick(cost)) != getEuPerTick(cost)) { if (getStored(EnergySide.UNKNOWN) < getEuPerTick(cost)) {
this.setBurning(false); this.setBurning(false);
} }
progress++; progress++;

View file

@ -43,6 +43,7 @@ import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import techreborn.api.recipe.recipes.RollingMachineRecipe; import techreborn.api.recipe.recipes.RollingMachineRecipe;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes; import techreborn.init.ModRecipes;
@ -160,7 +161,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
tickTime = 0; tickTime = 0;
} }
if (!currentRecipeOutput.isEmpty()) { if (!currentRecipeOutput.isEmpty()) {
if (canUseEnergy(getEuPerTick(TechRebornConfig.rollingMachineEnergyPerTick)) if (getStored(EnergySide.UNKNOWN) > getEuPerTick(TechRebornConfig.rollingMachineEnergyPerTick)
&& tickTime < Math.max((int) (TechRebornConfig.rollingMachineRunTime * (1.0 - getSpeedMultiplier())), 1) && tickTime < Math.max((int) (TechRebornConfig.rollingMachineRunTime * (1.0 - getSpeedMultiplier())), 1)
&& canMake(craftMatrix)) { && canMake(craftMatrix)) {
useEnergy(getEuPerTick(TechRebornConfig.rollingMachineEnergyPerTick)); useEnergy(getEuPerTick(TechRebornConfig.rollingMachineEnergyPerTick));

View file

@ -35,6 +35,7 @@ import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import techreborn.config.TechRebornConfig; import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities; import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent; import techreborn.init.TRContent;
@ -134,7 +135,7 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
if (!stack.isEmpty() && spaceForOutput()) { if (!stack.isEmpty() && spaceForOutput()) {
final int amp = getValue(stack); final int amp = getValue(stack);
final int euNeeded = amp * TechRebornConfig.matterFabricatorEnergyPerAmp; final int euNeeded = amp * TechRebornConfig.matterFabricatorEnergyPerAmp;
if (amp != 0 && this.canUseEnergy(euNeeded)) { if (amp != 0 && getStored(EnergySide.UNKNOWN) > euNeeded) {
useEnergy(euNeeded); useEnergy(euNeeded);
amplifier += amp; amplifier += amp;
inventory.shrinkSlot(i, 1); inventory.shrinkSlot(i, 1);

View file

@ -72,13 +72,7 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity
return; return;
} }
if (!inventory.getStack(0).isEmpty()) { if (!inventory.getStack(0).isEmpty()) {
ItemStack stack = inventory.getStack(0); discharge(0);
if (Energy.valid(stack)) {
Energy.of(this)
.into(Energy.of(stack))
.move(tier.getMaxInput());
}
} }
if (!inventory.getStack(1).isEmpty()) { if (!inventory.getStack(1).isEmpty()) {
charge(1); charge(1);

View file

@ -73,9 +73,9 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
} }
@Override @Override
public double useEnergy(double extract, boolean simulate) { public void useEnergy(double extract) {
if (ownerUdid == null || ownerUdid.isEmpty()) { if (ownerUdid == null || ownerUdid.isEmpty()) {
return 0.0; return;
} }
if (world.isClient) { if (world.isClient) {
throw new UnsupportedOperationException("cannot set energy on the client!"); throw new UnsupportedOperationException("cannot set energy on the client!");
@ -84,21 +84,10 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
if (extract > energy) { if (extract > energy) {
extract = energy; extract = energy;
} }
if (!simulate) {
setEnergy(energy - extract);
}
return extract;
}
@Override setStored(energy - extract);
public boolean canUseEnergy(double input) {
if (ownerUdid == null || ownerUdid.isEmpty()) { return;
return false;
}
if (world.isClient) {
throw new UnsupportedOperationException("cannot set energy on the client!");
}
return input <= IDSUManager.getPlayer(world, ownerUdid).getEnergy();
} }
@Override @Override
@ -125,7 +114,7 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
} }
@Override @Override
public boolean shouldHanldeEnergyNBT() { protected boolean shouldHandleEnergyNBT() {
return false; return false;
} }
} }

View file

@ -73,8 +73,6 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity
this.maxOutput = tier.getMaxOutput(); this.maxOutput = tier.getMaxOutput();
this.maxStorage = tier.getMaxInput() * 2; this.maxStorage = tier.getMaxInput() * 2;
// Should always be 4, except if we're tier MICRO, in which it will be 1.
super.setMaxPacketsPerTick(tier.getMaxOutput() / ouputTier.getMaxInput());
} }
// TilePowerAcceptor // TilePowerAcceptor
@ -109,11 +107,6 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity
return inputTier.getMaxInput(); return inputTier.getMaxInput();
} }
@Override
public EnergyTier getPushingTier() {
return ouputTier;
}
@Override @Override
public void checkTier() { public void checkTier() {
//Nope //Nope

View file

@ -78,7 +78,7 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
RenderSystem.scaled(0.6, 0.6, 1); RenderSystem.scaled(0.6, 0.6, 1);
Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy())) Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()))
.append("/") .append("/")
.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxPower())) .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxStoredPower()))
.append(" ") .append(" ")
.append(PowerSystem.getDisplayPower().abbreviation); .append(PowerSystem.getDisplayPower().abbreviation);
@ -86,7 +86,7 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
RenderSystem.popMatrix(); RenderSystem.popMatrix();
} }
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void onClick(int amount) { public void onClick(int amount) {

View file

@ -62,6 +62,6 @@ public class GuiAlloySmelter extends GuiBase<BuiltScreenHandler> {
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -63,6 +63,6 @@ public class GuiAssemblingMachine extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -66,7 +66,7 @@ public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
final Layer layer = Layer.FOREGROUND; final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntityAutoCraftingTable.getProgress(), blockEntityAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntityAutoCraftingTable.getProgress(), blockEntityAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 26, (int) blockEntityAutoCraftingTable.getEnergy(), (int) blockEntityAutoCraftingTable.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 26, (int) blockEntityAutoCraftingTable.getEnergy(), (int) blockEntityAutoCraftingTable.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
@Override @Override

View file

@ -62,7 +62,7 @@ public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
RenderSystem.scaled(0.6, 0.6, 5); RenderSystem.scaled(0.6, 0.6, 5);
Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy())) Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()))
.append("/") .append("/")
.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxPower())) .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxStoredPower()))
.append(" ") .append(" ")
.append(PowerSystem.getDisplayPower().abbreviation); .append(PowerSystem.getDisplayPower().abbreviation);
@ -71,6 +71,6 @@ public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
RenderSystem.popMatrix(); RenderSystem.popMatrix();
} }
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -85,7 +85,7 @@ public class GuiBlastFurnace extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void onClick(GuiButtonExtended button, Double x, Double y) { public void onClick(GuiButtonExtended button, Double x, Double y) {

View file

@ -64,6 +64,6 @@ public class GuiCentrifuge extends GuiBase<BuiltScreenHandler> {
final Layer layer = Layer.FOREGROUND; final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -57,6 +57,6 @@ public class GuiChargeBench extends GuiBase<BuiltScreenHandler> {
super.drawForeground(matrixStack, mouseX, mouseY); super.drawForeground(matrixStack, mouseX, mouseY);
final Layer layer = Layer.FOREGROUND; final Layer layer = Layer.FOREGROUND;
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -61,6 +61,6 @@ public class GuiChemicalReactor extends GuiBase<BuiltScreenHandler> {
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -59,6 +59,6 @@ public class GuiCompressor extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
this.builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); this.builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
this.builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); this.builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -59,7 +59,7 @@ public class GuiDieselGenerator extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer); builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
} }

View file

@ -73,7 +73,7 @@ public class GuiDistillationTower extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }

View file

@ -59,6 +59,6 @@ public class GuiElectricFurnace extends GuiBase<BuiltScreenHandler> {
Layer layer = Layer.FOREGROUND; Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -59,6 +59,6 @@ public class GuiExtractor extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -77,7 +77,7 @@ public class GuiFluidReplicator extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
// GuiScreen // GuiScreen

View file

@ -115,7 +115,7 @@ public class GuiFusionReactor extends GuiBase<BuiltScreenHandler> {
drawTextWithShadow(matrixStack, client.textRenderer, new LiteralText("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF); drawTextWithShadow(matrixStack, client.textRenderer, new LiteralText("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF);
drawTextWithShadow(matrixStack, client.textRenderer, new LiteralText(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF); drawTextWithShadow(matrixStack, client.textRenderer, new LiteralText(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) this.blockEntity.getEnergy(), (int) this.blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) this.blockEntity.getEnergy(), (int) this.blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void hologramToggle(GuiButtonExtended button, double x, double y) { public void hologramToggle(GuiButtonExtended button, double x, double y) {

View file

@ -56,7 +56,7 @@ public class GuiGasTurbine extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer); builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
} }

View file

@ -57,6 +57,6 @@ public class GuiGenerator extends GuiBase<BuiltScreenHandler> {
final Layer layer = Layer.FOREGROUND; final Layer layer = Layer.FOREGROUND;
builder.drawBurnBar(matrixStack, this, blockEntity.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer); builder.drawBurnBar(matrixStack, this, blockEntity.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -101,7 +101,7 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
} }
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void onClick(GuiButtonExtended button, Double x, Double y) { public void onClick(GuiButtonExtended button, Double x, Double y) {

View file

@ -63,14 +63,14 @@ public class GuiIDSU extends GuiBase<BuiltScreenHandler> {
Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) idsu.getEnergy())) Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) idsu.getEnergy()))
.append("/") .append("/")
.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) idsu.getMaxPower())) .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) idsu.getMaxStoredPower()))
.append(" ") .append(" ")
.append(PowerSystem.getDisplayPower().abbreviation); .append(PowerSystem.getDisplayPower().abbreviation);
drawCentredText(matrixStack, text, 35, 0, 58, layer); drawCentredText(matrixStack, text, 35, 0, 58, layer);
RenderSystem.popMatrix(); RenderSystem.popMatrix();
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) idsu.getEnergy(), (int) idsu.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) idsu.getEnergy(), (int) idsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -76,7 +76,7 @@ public class GuiImplosionCompressor extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }

View file

@ -61,7 +61,7 @@ public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }

View file

@ -80,7 +80,7 @@ public class GuiIndustrialGrinder extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void onClick(GuiButtonExtended button, double mouseX, double mouseY) { public void onClick(GuiButtonExtended button, double mouseX, double mouseY) {

View file

@ -79,7 +79,7 @@ public class GuiIndustrialSawmill extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) { public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {

View file

@ -60,10 +60,10 @@ public class GuiLESU extends GuiBase<BuiltScreenHandler> {
RenderSystem.pushMatrix(); RenderSystem.pushMatrix();
RenderSystem.scaled(0.6, 0.6, 1); RenderSystem.scaled(0.6, 0.6, 1);
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()) + "/" drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()) + "/"
+ PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxPower()) + " " + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxStoredPower()) + " "
+ PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer); + PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer);
RenderSystem.popMatrix(); RenderSystem.popMatrix();
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -63,7 +63,7 @@ public class GuiMFE extends GuiBase<BuiltScreenHandler> {
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getEnergy())) drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getEnergy()))
.append("/") .append("/")
.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getMaxPower())) .append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getMaxStoredPower()))
.append(" ") .append(" ")
.append(PowerSystem.getDisplayPower().abbreviation) .append(PowerSystem.getDisplayPower().abbreviation)
, 35, 0, 58, layer); , 35, 0, 58, layer);
@ -71,6 +71,6 @@ public class GuiMFE extends GuiBase<BuiltScreenHandler> {
RenderSystem.popMatrix(); RenderSystem.popMatrix();
} }
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfe.getEnergy(), (int) mfe.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfe.getEnergy(), (int) mfe.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -59,9 +59,9 @@ public class GuiMFSU extends GuiBase<BuiltScreenHandler> {
RenderSystem.pushMatrix(); RenderSystem.pushMatrix();
RenderSystem.scaled(0.6, 0.6, 1); RenderSystem.scaled(0.6, 0.6, 1);
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfsu.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfsu.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer); drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfsu.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfsu.getMaxStoredPower()) + " " + PowerSystem.getDisplayPower().abbreviation), 35, 0, 58, layer);
RenderSystem.popMatrix(); RenderSystem.popMatrix();
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -63,6 +63,6 @@ public class GuiMatterFabricator extends GuiBase<BuiltScreenHandler> {
final Layer layer = Layer.FOREGROUND; final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -67,7 +67,7 @@ public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer); builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
} }

View file

@ -57,6 +57,6 @@ public class GuiRecycler extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -71,7 +71,7 @@ public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, rollingMachine.getProgressScaled(100), 100, 92, 43, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, rollingMachine.getProgressScaled(100), 100, 92, 43, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 17, (int) rollingMachine.getEnergy(), (int) rollingMachine.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 17, (int) rollingMachine.getEnergy(), (int) rollingMachine.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
@Override @Override

View file

@ -61,6 +61,6 @@ public class GuiScrapboxinator extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -56,7 +56,7 @@ public class GuiSemifluidGenerator extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer); builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
} }

View file

@ -52,7 +52,7 @@ public class GuiSolar extends GuiBase<BuiltScreenHandler> {
super.drawForeground(matrixStack, mouseX, mouseY); super.drawForeground(matrixStack, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawMultiEnergyBar(matrixStack, this, 156, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 156, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
switch (blockEntity.getSunState()) { switch (blockEntity.getSunState()) {
case SolarPanelBlockEntity.DAYGEN: case SolarPanelBlockEntity.DAYGEN:

View file

@ -62,6 +62,6 @@ public class GuiSolidCanningMachine extends GuiBase<BuiltScreenHandler> {
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }

View file

@ -56,7 +56,7 @@ public class GuiThermalGenerator extends GuiBase<BuiltScreenHandler> {
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer); builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
} }

View file

@ -73,7 +73,7 @@ public class GuiVacuumFreezer extends GuiBase<BuiltScreenHandler> {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick); addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer); builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
} }
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) { public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {

View file

@ -63,6 +63,6 @@ public class GuiWireMill extends GuiBase<BuiltScreenHandler> {
final Layer layer = Layer.FOREGROUND; final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer); builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
} }
} }