Move common code for iron machines into abstract class

This commit is contained in:
drcrazy 2019-08-30 14:26:23 +03:00
parent fbfa24b6ff
commit 7c4564b5ab
7 changed files with 289 additions and 381 deletions

View file

@ -68,14 +68,14 @@ public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity
checkTier();
}
public int getProgressScaled(final int scale) {
public int getProgressScaled(int scale) {
if (crafter != null && crafter.currentTickTime != 0) {
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
}
return 0;
}
// TilePowerAcceptor
// PowerAcceptorBlockEntity
@Override
public void tick() {
super.tick();
@ -115,7 +115,7 @@ public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity
return new ItemStack(toolDrop, 1);
}
// ItemHandlerProvider
// InventoryProvider
@Override
public RebornInventory<?> getInventory() {
return inventory;

View file

@ -0,0 +1,207 @@
package techreborn.blockentity.machine.iron;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.util.RebornInventory;
import techreborn.config.TechRebornConfig;
public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEntity implements InventoryProvider, IToolDrop {
public RebornInventory<?> inventory;
public int burnTime;
public int totalBurnTime;
public int progress;
public int totalCookingTime;
int fuelSlot;
Block toolDrop;
boolean active = false;
public AbstractIronMachineBlockEntity(BlockEntityType<?> blockEntityTypeIn, int fuelSlot, Block toolDrop) {
super(blockEntityTypeIn);
this.fuelSlot = fuelSlot;
// default value for vanilla smelting recipes is 200
this.totalCookingTime = (int) (200 / TechRebornConfig.cookingScale);
this.toolDrop = toolDrop;
}
/**
* Checks that we have all inputs and can put output into slot
* @return
*/
protected abstract boolean canSmelt();
/**
* Turn ingredients into the appropriate smelted
* item in the output slot
*/
protected abstract void smelt();
/**
* Returns the number of ticks that the supplied fuel item will keep the
* furnace burning, or 0 if the item isn't fuel
* @param stack Itemstack of fuel
* @return Integer Number of ticks
*/
private int getItemBurnTime(ItemStack stack) {
if (stack.isEmpty()) {
return 0;
}
return (int) (AbstractFurnaceBlockEntity.createFuelTimeMap().getOrDefault(stack.getItem(), 0) * TechRebornConfig.fuelScale);
}
/**
* Returns remaining fraction of fuel burn time
* @param scale Scale to use for burn time
* @return int scaled remaining fuel burn time
*/
public int getBurnTimeRemainingScaled(int scale) {
if (totalBurnTime == 0) {
return 0;
}
return burnTime * scale / totalBurnTime;
}
/**
* Returns crafting progress
* @param scale Scale to use for crafting progress
* @return int Scaled crafting progress
*/
public int getProgressScaled(int scale) {
if (totalCookingTime > 0) {
return progress * scale / totalCookingTime;
}
return 0;
}
/**
* Returns true if Iron Machine is burning fuel thus can do work
* @return Boolean True if machine is burning
*/
public boolean isBurning() {
return burnTime > 0;
}
private void updateState() {
BlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof BlockMachineBase) {
BlockMachineBase blockMachineBase = (BlockMachineBase) state.getBlock();
if (state.get(BlockMachineBase.ACTIVE) != burnTime > 0)
blockMachineBase.setActive(burnTime > 0, world, pos);
}
}
// MachineBaseBlockEntity
@Override
public void fromTag(CompoundTag compoundTag) {
super.fromTag(compoundTag);
burnTime = compoundTag.getInt("BurnTime");
totalBurnTime = compoundTag.getInt("TotalBurnTime");
progress = compoundTag.getInt("Progress");
}
@Override
public CompoundTag toTag(CompoundTag compoundTag) {
super.toTag(compoundTag);
compoundTag.putInt("BurnTime", burnTime);
compoundTag.putInt("TotalBurnTime", totalBurnTime);
compoundTag.putInt("Progress", progress);
return compoundTag;
}
@Override
public void tick() {
super.tick();
if(world.isClient){
return;
}
boolean isBurning = isBurning();
if (isBurning) {
--burnTime;
}
if (!isBurning && canSmelt()) {
burnTime = totalBurnTime = getItemBurnTime(inventory.getInvStack(fuelSlot));
if (burnTime > 0) {
// Fuel slot
ItemStack fuelStack = inventory.getInvStack(fuelSlot);
if (fuelStack.getItem().hasRecipeRemainder()) {
inventory.setInvStack(fuelSlot, new ItemStack(fuelStack.getItem().getRecipeRemainder()));
} else if (fuelStack.getCount() > 1) {
inventory.shrinkSlot(fuelSlot, 1);
} else if (fuelStack.getCount() == 1) {
inventory.setInvStack(fuelSlot, ItemStack.EMPTY);
}
}
}
if (isBurning() && canSmelt()) {
++progress;
if (progress == totalCookingTime) {
progress = 0;
smelt();
}
} else {
progress = 0;
}
if (isBurning != isBurning()) {
inventory.setChanged();
updateState();
}
if (inventory.hasChanged()) {
markDirty();
}
}
@Override
public boolean canBeUpgraded() {
return false;
}
// InventoryProvider
@Override
public RebornInventory<?> getInventory() {
return inventory;
}
// IToolDrop
@Override
public ItemStack getToolDrop(PlayerEntity entityPlayer) {
return new ItemStack(toolDrop);
}
public int getBurnTime() {
return this.burnTime;
}
public void setBurnTime(int burnTime) {
this.burnTime = burnTime;
}
public int getTotalBurnTime() {
return this.totalBurnTime;
}
public void setTotalBurnTime(int totalBurnTime) {
this.totalBurnTime = totalBurnTime;
}
public int getProgress() {
return progress;
}
public void setProgress(int progress) {
this.progress = progress;
}
}

View file

@ -24,19 +24,11 @@
package techreborn.blockentity.machine.iron;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.util.RebornInventory;
@ -44,93 +36,15 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity implements IContainerProvider {
public RebornInventory<IronAlloyFurnaceBlockEntity> inventory = new RebornInventory<>(4, "IronAlloyFurnaceBlockEntity", 64, this);
public int burnTime;
public int totalBurnTime;
public int progress;
int input1 = 0;
int input2 = 1;
int output = 2;
int fuel = 3;
public IronAlloyFurnaceBlockEntity() {
super(TRBlockEntities.IRON_ALLOY_FURNACE);
}
/**
* Returns the number of ticks that the supplied fuel item will keep the
* furnace burning, or 0 if the item isn't fuel
* @param stack Itemstack of fuel
* @return Integer Number of ticks
*/
public static int getItemBurnTime(ItemStack stack) {
if (stack.isEmpty()) {
return 0;
}
return AbstractFurnaceBlockEntity.createFuelTimeMap().getOrDefault(stack.getItem(), 0);
}
@Override
public void fromTag(CompoundTag compoundTag) {
super.fromTag(compoundTag);
burnTime = compoundTag.getInt("BurnTime");
totalBurnTime = compoundTag.getInt("TotalBurnTime");
progress = compoundTag.getInt("Progress");
}
@Override
public CompoundTag toTag(CompoundTag compoundTag) {
super.toTag(compoundTag);
compoundTag.putInt("BurnTime", burnTime);
compoundTag.putInt("TotalBurnTime", totalBurnTime);
compoundTag.putInt("Progress", progress);
return compoundTag;
}
@Override
public void tick() {
super.tick();
if(world.isClient){
return;
}
boolean isBurning = isBurning();
boolean updateInventory = false;
if (isBurning) {
--burnTime;
}
if (burnTime != 0 || !inventory.getInvStack(input1).isEmpty() && !inventory.getInvStack(fuel).isEmpty()) {
if (burnTime == 0 && canSmelt()) {
totalBurnTime = burnTime = getItemBurnTime(inventory.getInvStack(fuel));
if (burnTime > 0) {
updateInventory = true;
if (!inventory.getInvStack(fuel).isEmpty()) {
inventory.shrinkSlot(fuel, 1);
}
}
}
if (isBurning() && canSmelt()) {
++progress;
if (progress == 200) {
progress = 0;
smeltItem();
updateInventory = true;
}
} else {
progress = 0;
}
}
if (isBurning != isBurning()) {
updateInventory = true;
updateState();
}
if (updateInventory) {
markDirty();
}
super(TRBlockEntities.IRON_ALLOY_FURNACE, 3, TRContent.Machine.IRON_ALLOY_FURNACE.block);
this.inventory = new RebornInventory<>(4, "IronAlloyFurnaceBlockEntity", 64, this);
}
public boolean hasAllInputs(RebornRecipe recipeType) {
@ -150,7 +64,8 @@ public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
return true;
}
private boolean canSmelt() {
@Override
protected boolean canSmelt() {
if (inventory.getInvStack(input1).isEmpty() || inventory.getInvStack(input2).isEmpty()) {
return false;
}
@ -172,11 +87,8 @@ public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
return result <= inventory.getStackLimit() && result <= inventory.getInvStack(output).getMaxCount();
}
/**
* Turn one item from the furnace source stack into the appropriate smelted
* item in the furnace result stack
*/
public void smeltItem() {
@Override
protected void smelt() {
if (!canSmelt()) {
return;
}
@ -212,87 +124,16 @@ public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
}
}
/**
* Furnace isBurning
* @return Boolean True if furnace is burning
*/
public boolean isBurning() {
return burnTime > 0;
}
public int getBurnTimeRemainingScaled(int scale) {
if (totalBurnTime == 0) {
totalBurnTime = 200;
}
return burnTime * scale / totalBurnTime;
}
public int getCookProgressScaled(int scale) {
return progress * scale / 200;
}
public void updateState() {
BlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof BlockMachineBase) {
BlockMachineBase blockMachineBase = (BlockMachineBase) state.getBlock();
if (state.get(BlockMachineBase.ACTIVE) != burnTime > 0)
blockMachineBase.setActive(burnTime > 0, world, pos);
}
}
@Override
public Direction getFacing() {
return getFacingEnum();
}
@Override
public ItemStack getToolDrop(PlayerEntity entityPlayer) {
return TRContent.Machine.IRON_ALLOY_FURNACE.getStack();
}
@Override
public RebornInventory<IronAlloyFurnaceBlockEntity> getInventory() {
return inventory;
}
public int getBurnTime() {
return burnTime;
}
public void setBurnTime(int burnTime) {
this.burnTime = burnTime;
}
public int getTotalBurnTime() {
return totalBurnTime;
}
public void setTotalBurnTime(int currentItemBurnTime) {
this.totalBurnTime = currentItemBurnTime;
}
public int getCookTime() {
return progress;
}
public void setCookTime(int cookTime) {
this.progress = cookTime;
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.slot(0, 47, 17)
.slot(1, 65, 17)
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53).syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getCookTime, this::setCookTime)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this, syncID);
}
@Override
public boolean canBeUpgraded() {
return false;
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53)
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getProgress, this::setProgress)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime)
.addInventory().create(this, syncID);
}
}

View file

@ -26,8 +26,6 @@ package techreborn.blockentity.machine.iron;
import java.util.Optional;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.entity.ExperienceOrbEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@ -35,120 +33,23 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.recipe.RecipeType;
import net.minecraft.recipe.SmeltingRecipe;
import net.minecraft.server.network.ServerPlayerEntity;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
import techreborn.utils.RecipeUtils;
public class IronFurnaceBlockEntity extends MachineBaseBlockEntity
implements InventoryProvider, IContainerProvider {
public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity implements IContainerProvider {
public RebornInventory<IronFurnaceBlockEntity> inventory = new RebornInventory<>(3, "IronFurnaceBlockEntity", 64, this, getInvetoryAccess());
public int burnTime;
public int totalBurnTime;
public int progress;
public int fuelScale = 160;
int inputSlot = 0;
int outputSlot = 1;
int fuelSlot = 2;
boolean active = false;
public float experience;
public IronFurnaceBlockEntity() {
super(TRBlockEntities.IRON_FURNACE);
}
public static IInventoryAccess<IronFurnaceBlockEntity> getInvetoryAccess(){
return (slotID, stack, face, direction, blockEntity) -> {
if(direction == IInventoryAccess.AccessDirection.INSERT){
boolean isFuel = AbstractFurnaceBlockEntity.canUseAsFuel(stack);
if(isFuel){
ItemStack fuelSlotStack = blockEntity.inventory.getInvStack(blockEntity.fuelSlot);
if(fuelSlotStack.isEmpty() || ItemUtils.isItemEqual(stack, fuelSlotStack, true, true) && fuelSlotStack.getMaxCount() != fuelSlotStack.getCount()){
return slotID == blockEntity.fuelSlot;
}
}
return slotID != blockEntity.outputSlot;
}
return true;
};
}
public int gaugeProgressScaled(int scale) {
return progress * scale / fuelScale;
}
public int gaugeFuelScaled(int scale) {
if (totalBurnTime == 0) {
totalBurnTime = burnTime;
if (totalBurnTime == 0) {
totalBurnTime = fuelScale;
}
}
return burnTime * scale / totalBurnTime;
}
private void cookItems() {
if (!canSmelt()) {
return;
}
ItemStack inputStack = inventory.getInvStack(inputSlot);
ItemStack outputStack = getResultFor(inputStack);
float recipeExp = getExperienceFor(inputStack);
if (inventory.getInvStack(outputSlot).isEmpty()) {
inventory.setInvStack(outputSlot, outputStack.copy());
} else if (inventory.getInvStack(outputSlot).isItemEqualIgnoreDamage(outputStack)) {
inventory.getInvStack(outputSlot).increment(outputStack.getCount());
}
if (inputStack.getCount() > 1) {
inventory.shrinkSlot(inputSlot, 1);
} else {
inventory.setInvStack(inputSlot, ItemStack.EMPTY);
}
experience += recipeExp;
}
private boolean canSmelt() {
if (inventory.getInvStack(inputSlot).isEmpty()) {
return false;
}
ItemStack outputStack = getResultFor(inventory.getInvStack(inputSlot));
if (outputStack.isEmpty())
return false;
if (inventory.getInvStack(outputSlot).isEmpty())
return true;
if (!inventory.getInvStack(outputSlot).isItemEqualIgnoreDamage(outputStack))
return false;
int result = inventory.getInvStack(outputSlot).getCount() + outputStack.getCount();
return result <= inventory.getStackLimit() && result <= outputStack.getMaxCount();
}
public boolean isBurning() {
return burnTime > 0;
}
private ItemStack getResultFor(ItemStack stack) {
ItemStack result = RecipeUtils.getMatchingRecipes(world, RecipeType.SMELTING, stack);
if (!result.isEmpty()) {
return result.copy();
}
return ItemStack.EMPTY;
}
private float getExperienceFor(ItemStack stack) {
Optional<SmeltingRecipe> recipe = world.getRecipeManager().getFirstMatch(RecipeType.SMELTING, this, world);
if (recipe.isPresent()) {
return recipe.get().getExperience();
}
return 0;
super(TRBlockEntities.IRON_FURNACE, 2, TRContent.Machine.IRON_FURNACE.block);
this.inventory = new RebornInventory<>(3, "IronFurnaceBlockEntity", 64, this);
}
public void handleGuiInputFromClient(PlayerEntity playerIn) {
@ -164,117 +65,74 @@ public class IronFurnaceBlockEntity extends MachineBaseBlockEntity
experience = 0;
}
private void updateState() {
BlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof BlockMachineBase) {
BlockMachineBase blockMachineBase = (BlockMachineBase) state.getBlock();
if (state.get(BlockMachineBase.ACTIVE) != burnTime > 0)
blockMachineBase.setActive(burnTime > 0, world, pos);
private ItemStack getResultFor(ItemStack stack) {
ItemStack result = RecipeUtils.getMatchingRecipes(world, RecipeType.SMELTING, stack);
if (!result.isEmpty()) {
return result.copy();
}
return ItemStack.EMPTY;
}
private float getExperienceFor(ItemStack stack) {
Optional<SmeltingRecipe> recipe = world.getRecipeManager().getFirstMatch(RecipeType.SMELTING, this, world);
if (recipe.isPresent()) {
return recipe.get().getExperience();
}
return 0;
}
// AbstractIronMachineBlockEntity
@Override
protected void smelt() {
if (!canSmelt()) {
return;
}
ItemStack inputStack = inventory.getInvStack(inputSlot);
ItemStack resultStack = getResultFor(inputStack);
if (inventory.getInvStack(outputSlot).isEmpty()) {
inventory.setInvStack(outputSlot, resultStack.copy());
} else if (inventory.getInvStack(outputSlot).isItemEqualIgnoreDamage(resultStack)) {
inventory.getInvStack(outputSlot).increment(resultStack.getCount());
}
experience += getExperienceFor(inputStack);
if (inputStack.getCount() > 1) {
inventory.shrinkSlot(inputSlot, 1);
} else {
inventory.setInvStack(inputSlot, ItemStack.EMPTY);
}
}
// MachineBaseBlockEntity
@Override
protected boolean canSmelt() {
if (inventory.getInvStack(inputSlot).isEmpty()) {
return false;
}
ItemStack outputStack = getResultFor(inventory.getInvStack(inputSlot));
if (outputStack.isEmpty())
return false;
if (inventory.getInvStack(outputSlot).isEmpty())
return true;
if (!inventory.getInvStack(outputSlot).isItemEqualIgnoreDamage(outputStack))
return false;
int result = inventory.getInvStack(outputSlot).getCount() + outputStack.getCount();
return result <= inventory.getStackLimit() && result <= outputStack.getMaxCount();
}
@Override
public void fromTag(CompoundTag compoundTag) {
super.fromTag(compoundTag);
experience = compoundTag.getFloat("Experience");
burnTime = compoundTag.getInt("BurnTime");
totalBurnTime = compoundTag.getInt("TotalBurnTime");
progress = compoundTag.getInt("Progress");
}
@Override
public CompoundTag toTag(CompoundTag compoundTag) {
super.toTag(compoundTag);
compoundTag.putFloat("Experience", experience);
compoundTag.putInt("BurnTime", burnTime);
compoundTag.putInt("TotalBurnTime", totalBurnTime);
compoundTag.putInt("Progress", progress);
return compoundTag;
}
@Override
public void tick() {
super.tick();
if(world.isClient){
return;
}
boolean isBurning = isBurning();
boolean updateInventory = false;
if (isBurning) {
--burnTime;
}
if (burnTime <= 0 && canSmelt()) {
burnTime = totalBurnTime = (int) (AbstractFurnaceBlockEntity.createFuelTimeMap().getOrDefault(inventory.getInvStack(fuelSlot).getItem(), 0) * 1.25);
if (burnTime > 0) {
// Fuel slot
ItemStack fuelStack = inventory.getInvStack(fuelSlot);
if (fuelStack.getItem().hasRecipeRemainder()) {
inventory.setInvStack(fuelSlot, new ItemStack(fuelStack.getItem().getRecipeRemainder()));
} else if (fuelStack.getCount() > 1) {
inventory.shrinkSlot(fuelSlot, 1);
} else if (fuelStack.getCount() == 1) {
inventory.setInvStack(fuelSlot, ItemStack.EMPTY);
}
updateInventory = true;
}
}
if (isBurning() && canSmelt()) {
progress++;
if (progress >= fuelScale) {
progress = 0;
cookItems();
updateInventory = true;
}
} else {
progress = 0;
}
if (isBurning != isBurning()) {
updateInventory = true;
updateState();
}
if (updateInventory) {
markDirty();
}
}
@Override
public boolean canBeUpgraded() {
return false;
}
// InventoryProvider
@Override
public RebornInventory<IronFurnaceBlockEntity> getInventory() {
return this.inventory;
}
// IContainerProvider
public int getBurnTime() {
return this.burnTime;
}
public void setBurnTime(int burnTime) {
this.burnTime = burnTime;
}
public int getTotalBurnTime() {
return this.totalBurnTime;
}
public void setTotalBurnTime(int totalBurnTime) {
this.totalBurnTime = totalBurnTime;
}
public int getProgress() {
return progress;
}
public void setProgress(int progress) {
this.progress = progress;
}
public float getExperience() {
return experience;
}
@ -286,7 +144,8 @@ public class IronFurnaceBlockEntity extends MachineBaseBlockEntity
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
.addInventory().blockEntity(this)
.fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getProgress, this::setProgress)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime)

View file

@ -58,7 +58,7 @@ public class GuiAlloyFurnace extends GuiBase<BuiltContainer> {
super.drawForeground(mouseX, mouseY);
GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, blockEntity.getCookProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawBurnBar(this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
}
}

View file

@ -122,7 +122,7 @@ public class GuiIronFurnace extends GuiBase<BuiltContainer> {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, blockEntity.gaugeProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawBurnBar(this, blockEntity.gaugeFuelScaled(100), 100, 56, 36, mouseX, mouseY, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawBurnBar(this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
}
}

View file

@ -241,10 +241,6 @@ public class TechRebornConfig {
@Config(config = "items", category = "upgrades", key = "energy_storage", comment = "Energy storage behavior extra power")
public static double energyStoragePower = 40_000;
// Machines
@Config(config = "machines", category = "grinder", key = "GrinderInput", comment = "Grinder Max Input (Value in EU)")
public static int grinderMaxInput = 32;
@ -465,7 +461,12 @@ public class TechRebornConfig {
@Config(config = "machines", category = "solid_canning_machine", key = "solidCanningMachineMaxInput", comment = "Solid Canning Machine Max Energy (Value in EU)")
public static int solidCanningMachineMaxEnergy = 1_000;
@Config(config = "machines", category = "iron_machine", key = "fuel_scale", comment = "Multiplier for vanilla furnace item burn time")
public static double fuelScale = 1.25;
@Config(config = "machines", category = "iron_machine", key = "cooking_scale", comment = "Multiplier for vanilla furnace item cook time")
public static double cookingScale = 1.25;
// Misc
@Config(config = "misc", category = "general", key = "IC2TransformersStyle", comment = "Input from dots side, output from other sides, like in IC2.")
public static boolean IC2TransformersStyle = true;