From 0dba7cb5841c9bc32b9c11a76f54f0ab97313142 Mon Sep 17 00:00:00 2001 From: Xander Date: Sat, 20 Apr 2019 13:38:41 +0800 Subject: [PATCH] use getters & setters for InfuseStorage (#5416) * use getters & setters for InfuseStorage to prevent type/amount discrepancies * Fix a few checks when reading from network/NBT * Fix some spacing I screwed up by accident * fix metallurgic infuser gui texture for dark gauge --- .../java/mekanism/client/gui/GuiFactory.java | 6 +- .../client/gui/GuiMetallurgicInfuser.java | 8 +-- .../MetallurgicInfuserRecipeCategory.java | 2 +- .../MetallurgicInfuserRecipeWrapper.java | 6 +- .../java/mekanism/common/InfuseStorage.java | 59 +++++++++++++++++- .../java/mekanism/common/base/IFactory.java | 2 +- .../commands/MekRecipesCommand.java | 4 +- .../helpers/IngredientHelper.java | 2 +- .../inventory/container/ContainerFactory.java | 2 +- .../ContainerMetallurgicInfuser.java | 6 +- .../common/recipe/inputs/InfusionInput.java | 10 +-- .../common/tile/TileEntityFactory.java | 57 ++++++++--------- .../tile/TileEntityMetallurgicInfuser.java | 58 +++++++++-------- .../mekanism/gui/guimetallurgicinfuser.png | Bin 17162 -> 4215 bytes 14 files changed, 135 insertions(+), 87 deletions(-) diff --git a/src/main/java/mekanism/client/gui/GuiFactory.java b/src/main/java/mekanism/client/gui/GuiFactory.java index d41d80a3b..7ae50bad6 100644 --- a/src/main/java/mekanism/client/gui/GuiFactory.java +++ b/src/main/java/mekanism/client/gui/GuiFactory.java @@ -76,8 +76,8 @@ public class GuiFactory extends GuiMekanismTile { + ": " + tileEntity.gasTank.getStored() : LangUtils.localize("gui.none"), xAxis, yAxis); } else if (tileEntity.getRecipeType() == RecipeType.INFUSING) { drawHoveringText( - tileEntity.infuseStored.type != null ? tileEntity.infuseStored.type.getLocalizedName() + ": " - + tileEntity.infuseStored.amount : LangUtils.localize("gui.empty"), xAxis, yAxis); + tileEntity.infuseStored.getType() != null ? tileEntity.infuseStored.getType().getLocalizedName() + ": " + + tileEntity.infuseStored.getAmount() : LangUtils.localize("gui.empty"), xAxis, yAxis); } } super.drawGuiContainerForegroundLayer(mouseX, mouseY); @@ -116,7 +116,7 @@ public class GuiFactory extends GuiMekanismTile { } } else if (tileEntity.getRecipeType() == RecipeType.INFUSING) { if (tileEntity.getScaledInfuseLevel(160) > 0) { - displayGauge(8, 78, tileEntity.getScaledInfuseLevel(160), 5, tileEntity.infuseStored.type.sprite); + displayGauge(8, 78, tileEntity.getScaledInfuseLevel(160), 5, tileEntity.infuseStored.getType().sprite); } } super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY); diff --git a/src/main/java/mekanism/client/gui/GuiMetallurgicInfuser.java b/src/main/java/mekanism/client/gui/GuiMetallurgicInfuser.java index a38276def..276e0fad1 100644 --- a/src/main/java/mekanism/client/gui/GuiMetallurgicInfuser.java +++ b/src/main/java/mekanism/client/gui/GuiMetallurgicInfuser.java @@ -71,8 +71,8 @@ public class GuiMetallurgicInfuser extends GuiMekanismTile= 7 && xAxis <= 11 && yAxis >= 17 && yAxis <= 69) { drawHoveringText( - tileEntity.infuseStored.type != null ? tileEntity.infuseStored.type.getLocalizedName() + ": " - + tileEntity.infuseStored.amount : LangUtils.localize("gui.empty"), xAxis, yAxis); + tileEntity.infuseStored.getType() != null ? tileEntity.infuseStored.getType().getLocalizedName() + ": " + + tileEntity.infuseStored.getAmount() : LangUtils.localize("gui.empty"), xAxis, yAxis); } super.drawGuiContainerForegroundLayer(mouseX, mouseY); } @@ -84,11 +84,11 @@ public class GuiMetallurgicInfuser extends GuiMekanismTile inputStacks = Collections.singletonList(recipe.recipeInput.inputStack); - List infuseStacks = MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.type); + List infuseStacks = MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.getType()); ingredients.setInput(VanillaTypes.ITEM, recipe.recipeInput.inputStack); ingredients.setInputLists(VanillaTypes.ITEM, Arrays.asList(inputStacks, infuseStacks)); ingredients.setOutput(VanillaTypes.ITEM, recipe.recipeOutput.output); @@ -37,7 +37,7 @@ public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper { public void drawInfo(Minecraft mc, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { if (mc.currentScreen != null) { mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture()); - mc.currentScreen.drawTexturedModalRect(2, 2, recipe.getInput().infuse.type.sprite, 4, 52); + mc.currentScreen.drawTexturedModalRect(2, 2, recipe.getInput().infuse.getType().sprite, 4, 52); } } @@ -45,7 +45,7 @@ public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper { public List getTooltipStrings(int mouseX, int mouseY) { if (mouseX >= 2 && mouseX < 6 && mouseY >= 2 && mouseY < 54) { InfuseStorage infuse = recipe.getInput().infuse; - return Collections.singletonList(infuse.type.getLocalizedName() + ": " + infuse.amount); + return Collections.singletonList(infuse.getType().getLocalizedName() + ": " + infuse.getAmount()); } return Collections.emptyList(); } diff --git a/src/main/java/mekanism/common/InfuseStorage.java b/src/main/java/mekanism/common/InfuseStorage.java index 4ccf5ba1a..263fc5937 100644 --- a/src/main/java/mekanism/common/InfuseStorage.java +++ b/src/main/java/mekanism/common/InfuseStorage.java @@ -1,5 +1,6 @@ package mekanism.common; +import mekanism.api.infuse.InfuseObject; import mekanism.api.infuse.InfuseRegistry; import mekanism.api.infuse.InfuseType; import mekanism.common.base.ISustainedData; @@ -8,9 +9,9 @@ import net.minecraft.item.ItemStack; public class InfuseStorage implements ISustainedData { - public InfuseType type; + private InfuseType type; - public int amount; + private int amount; public InfuseStorage() { } @@ -30,6 +31,32 @@ public class InfuseStorage implements ISustainedData { } else if (type == storage.type) { amount = 0; } + if (amount <= 0) { + type = null; + amount = 0; + } + } + + public void increase(InfuseStorage input) { + if (type == null) { + type = input.type; + amount = input.amount; + } else if (type == input.type) { + amount += input.amount; + } else { + Mekanism.logger.error("Tried to increase infusion storage with an incompatible type", new Exception()); + } + } + + public void increase(InfuseObject input) { + if (type == null) { + type = input.type; + amount = input.stored; + } else if (type == input.type) { + amount += input.stored; + } else { + Mekanism.logger.error("Tried to increase infusion storage with an incompatible type", new Exception()); + } } @Override @@ -52,4 +79,30 @@ public class InfuseStorage implements ISustainedData { amount = 0; } } -} + + public InfuseType getType() { + return amount == 0 ? null : type; + } + + public InfuseStorage setType(InfuseType type) { + this.type = type; + return this; + } + + public int getAmount() { + return type == null ? 0 : amount; + } + + public InfuseStorage setAmount(int amount) { + if (amount < 0) { + throw new IllegalArgumentException("Amount must be positive"); + } + this.amount = amount; + return this; + } + + public void setEmpty() { + this.amount = 0; + this.type = null; + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/common/base/IFactory.java b/src/main/java/mekanism/common/base/IFactory.java index d2b48331b..b2a2beb93 100644 --- a/src/main/java/mekanism/common/base/IFactory.java +++ b/src/main/java/mekanism/common/base/IFactory.java @@ -168,7 +168,7 @@ public interface IFactory { } else if (fuelType == MachineFuelType.CHANCE) { return getChanceRecipe(slotStack); } else if (this == INFUSING) { - if (infuse.type != null) { + if (infuse.getType() != null) { return RecipeHandler.getMetallurgicInfuserRecipe(new InfusionInput(infuse, slotStack)); } else { for (Entry entry : Recipe.METALLURGIC_INFUSER.get() diff --git a/src/main/java/mekanism/common/integration/crafttweaker/commands/MekRecipesCommand.java b/src/main/java/mekanism/common/integration/crafttweaker/commands/MekRecipesCommand.java index 02cdc0342..2357ce1f8 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/commands/MekRecipesCommand.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/commands/MekRecipesCommand.java @@ -173,8 +173,8 @@ public class MekRecipesCommand extends CraftTweakerCommand { type = Recipe.METALLURGIC_INFUSER; for (MetallurgicInfuserRecipe recipe : Recipe.METALLURGIC_INFUSER.get().values()) { CraftTweakerAPI.logCommand(String.format("mods.mekanism.infuser.addRecipe(%s, %s, %s, %s)", - recipe.getInput().infuse.type, - recipe.getInput().infuse.amount, + recipe.getInput().infuse.getType(), + recipe.getInput().infuse.getAmount(), RecipeInfoHelper.getItemName(recipe.getInput().inputStack), RecipeInfoHelper.getItemName(recipe.getOutput().output) )); diff --git a/src/main/java/mekanism/common/integration/crafttweaker/helpers/IngredientHelper.java b/src/main/java/mekanism/common/integration/crafttweaker/helpers/IngredientHelper.java index 5e0162bfe..552d9949b 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/helpers/IngredientHelper.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/helpers/IngredientHelper.java @@ -110,7 +110,7 @@ public class IngredientHelper { } else if (in instanceof InfusionInput) { InfusionInput input = (InfusionInput) in; return matches(input.inputStack, toMatch.getIngredient()) && (toMatch.getInfuseType().isEmpty() || toMatch - .getInfuseType().equalsIgnoreCase(input.infuse.type.name)); + .getInfuseType().equalsIgnoreCase(input.infuse.getType().name)); } else if (in instanceof IntegerInput) { IntegerInput input = (IntegerInput) in; return input.ingredient == toMatch.getAmount(); diff --git a/src/main/java/mekanism/common/inventory/container/ContainerFactory.java b/src/main/java/mekanism/common/inventory/container/ContainerFactory.java index 77d1bc982..5be7dab36 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerFactory.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerFactory.java @@ -109,7 +109,7 @@ public class ContainerFactory extends ContainerMekanism { return ItemStack.EMPTY; } } else if (tileEntity.getRecipeType() == RecipeType.INFUSING && InfuseRegistry.getObject(slotStack) != null - && (tileEntity.infuseStored.type == null || tileEntity.infuseStored.type == InfuseRegistry + && (tileEntity.infuseStored.getType() == null || tileEntity.infuseStored.getType() == InfuseRegistry .getObject(slotStack).type)) { if (transferExtraSlot(slotID, slotStack)) { return ItemStack.EMPTY; diff --git a/src/main/java/mekanism/common/inventory/container/ContainerMetallurgicInfuser.java b/src/main/java/mekanism/common/inventory/container/ContainerMetallurgicInfuser.java index bf76723b8..80228a1ac 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerMetallurgicInfuser.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerMetallurgicInfuser.java @@ -31,8 +31,8 @@ public class ContainerMetallurgicInfuser extends ContainerMekanism { public ItemStack inputStack = ItemStack.EMPTY; public InfusionInput(InfuseStorage storage, ItemStack itemStack) { - infuse = new InfuseStorage(storage.type, storage.amount); + infuse = new InfuseStorage(storage.getType(), storage.getAmount()); inputStack = itemStack; } @@ -47,12 +47,12 @@ public class InfusionInput extends MachineInput { @Override public InfusionInput copy() { - return new InfusionInput(infuse.type, infuse.amount, inputStack.copy()); + return new InfusionInput(infuse.getType(), infuse.getAmount(), inputStack.copy()); } @Override public boolean isValid() { - return infuse.type != null && !inputStack.isEmpty(); + return infuse.getType() != null && !inputStack.isEmpty(); } public boolean use(NonNullList inventory, int index, InfuseStorage infuseStorage, boolean deplete) { @@ -70,7 +70,7 @@ public class InfusionInput extends MachineInput { @Override public int hashIngredients() { - return infuse.type.unlocalizedName.hashCode() << 8 | StackUtils.hashItemStack(inputStack); + return infuse.getType().unlocalizedName.hashCode() << 8 | StackUtils.hashItemStack(inputStack); } @Override @@ -79,7 +79,7 @@ public class InfusionInput extends MachineInput { return !other.isValid(); } - return infuse.type == other.infuse.type && MachineInput.inputItemMatches(inputStack, other.inputStack); + return infuse.getType() == other.infuse.getType() && MachineInput.inputItemMatches(inputStack, other.inputStack); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityFactory.java b/src/main/java/mekanism/common/tile/TileEntityFactory.java index 98fec4c5c..65ebb0ea8 100644 --- a/src/main/java/mekanism/common/tile/TileEntityFactory.java +++ b/src/main/java/mekanism/common/tile/TileEntityFactory.java @@ -342,11 +342,6 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt } } - if (infuseStored.amount <= 0) { - infuseStored.amount = 0; - infuseStored.type = null; - } - lastUsage = prev - getEnergy(); prevEnergy = getEnergy(); } @@ -479,7 +474,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt }*/ else if (cached.recipeInput instanceof InfusionInput) { InfusionInput infusionInput = (InfusionInput) cached.recipeInput; recipeInput = infusionInput.inputStack; - secondaryMatch = infuseStored.amount == 0 || infuseStored.type == infusionInput.infuse.type; + secondaryMatch = infuseStored.getAmount() == 0 || infuseStored.getType() == infusionInput.infuse.getType(); } //If there is no cached item input or it doesn't match our fallback // then it is an out of date cache so we compare against the new one @@ -536,13 +531,11 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt inventory.get(4).shrink(1); } } else if (recipeType == RecipeType.INFUSING) { - if (InfuseRegistry.getObject(inventory.get(4)) != null) { - InfuseObject infuse = InfuseRegistry.getObject(inventory.get(4)); - - if (infuseStored.type == null || infuseStored.type == infuse.type) { - if (infuseStored.amount + infuse.stored <= maxInfuse) { - infuseStored.amount += infuse.stored; - infuseStored.type = infuse.type; + InfuseObject pendingInfusionInput = InfuseRegistry.getObject(inventory.get(4)); + if (pendingInfusionInput != null) { + if (infuseStored.getType() == null || infuseStored.getType() == pendingInfusionInput.type) { + if (infuseStored.getAmount() + pendingInfusionInput.stored <= maxInfuse) { + infuseStored.increase(pendingInfusionInput); inventory.get(4).shrink(1); } } @@ -620,8 +613,8 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt } else if (recipeType.getFuelType() == MachineFuelType.DOUBLE) { return recipeType.hasRecipeForExtra(itemstack); } else if (recipeType == RecipeType.INFUSING) { - return InfuseRegistry.getObject(itemstack) != null && (infuseStored.type == null - || infuseStored.type == InfuseRegistry.getObject(itemstack).type); + return InfuseRegistry.getObject(itemstack) != null && (infuseStored.getType() == null + || infuseStored.getType() == InfuseRegistry.getObject(itemstack).type); } } @@ -633,7 +626,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt } public int getScaledInfuseLevel(int i) { - return infuseStored.amount * i / maxInfuse; + return infuseStored.getAmount() * i / maxInfuse; } public int getScaledGasLevel(int i) { @@ -765,8 +758,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt sorting = !sorting; } else if (type == 1) { gasTank.setGas(null); - infuseStored.amount = 0; - infuseStored.type = null; + infuseStored.setEmpty(); } return; @@ -782,9 +774,12 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt sorting = dataStream.readBoolean(); upgraded = dataStream.readBoolean(); lastUsage = dataStream.readDouble(); - infuseStored.amount = dataStream.readInt(); - if (infuseStored.amount > 0) { - infuseStored.type = InfuseRegistry.get(PacketHandler.readString(dataStream)); + int amount = dataStream.readInt(); + if (amount > 0) { + infuseStored.setAmount(amount); + infuseStored.setType(InfuseRegistry.get(PacketHandler.readString(dataStream))); + } else { + infuseStored.setEmpty(); } if (recipeType != oldRecipe) { @@ -816,8 +811,11 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt upgradeComponent.setSupported(Upgrade.GAS, recipeType.fuelEnergyUpgrades()); recipeTicks = nbtTags.getInteger("recipeTicks"); sorting = nbtTags.getBoolean("sorting"); - infuseStored.amount = nbtTags.getInteger("infuseStored"); - infuseStored.type = InfuseRegistry.get(nbtTags.getString("type")); + int amount = nbtTags.getInteger("infuseStored"); + if (amount != 0) { + infuseStored.setAmount(amount); + infuseStored.setType(InfuseRegistry.get(nbtTags.getString("type"))); + } for (int i = 0; i < tier.processes; i++) { progress[i] = nbtTags.getInteger("progress" + i); @@ -834,10 +832,9 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt nbtTags.setInteger("recipeType", recipeType.ordinal()); nbtTags.setInteger("recipeTicks", recipeTicks); nbtTags.setBoolean("sorting", sorting); - nbtTags.setInteger("infuseStored", infuseStored.amount); - - if (infuseStored.type != null) { - nbtTags.setString("type", infuseStored.type.name); + if (infuseStored.getType() != null) { + nbtTags.setString("type", infuseStored.getType().name); + nbtTags.setInteger("infuseStored", infuseStored.getAmount()); } else { nbtTags.setString("type", "null"); } @@ -861,9 +858,9 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt data.add(upgraded); data.add(lastUsage); - data.add(infuseStored.amount); - if (infuseStored.amount > 0) { - data.add(infuseStored.type.name); + data.add(infuseStored.getAmount()); + if (infuseStored.getAmount() > 0) { + data.add(infuseStored.getType().name); } data.add(progress); diff --git a/src/main/java/mekanism/common/tile/TileEntityMetallurgicInfuser.java b/src/main/java/mekanism/common/tile/TileEntityMetallurgicInfuser.java index 28e78d05a..25eec1ccb 100644 --- a/src/main/java/mekanism/common/tile/TileEntityMetallurgicInfuser.java +++ b/src/main/java/mekanism/common/tile/TileEntityMetallurgicInfuser.java @@ -87,13 +87,11 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i ChargeUtils.discharge(4, this); if (!inventory.get(1).isEmpty()) { - if (InfuseRegistry.getObject(inventory.get(1)) != null) { - InfuseObject infuse = InfuseRegistry.getObject(inventory.get(1)); - - if (infuseStored.type == null || infuseStored.type == infuse.type) { - if (infuseStored.amount + infuse.stored <= MAX_INFUSE) { - infuseStored.amount += infuse.stored; - infuseStored.type = infuse.type; + InfuseObject pendingInfuseInput = InfuseRegistry.getObject(inventory.get(1)); + if (pendingInfuseInput != null) { + if (infuseStored.getType() == null || infuseStored.getType() == pendingInfuseInput.type) { + if (infuseStored.getAmount() + pendingInfuseInput.stored <= MAX_INFUSE) { + infuseStored.increase(pendingInfuseInput); inventory.get(1).shrink(1); } } @@ -122,11 +120,6 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i operatingTicks = 0; } - if (infuseStored.amount <= 0) { - infuseStored.amount = 0; - infuseStored.type = null; - } - prevEnergy = getEnergy(); } } @@ -207,13 +200,13 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i if (slotID == 3) { return false; } else if (slotID == 1) { - return InfuseRegistry.getObject(itemstack) != null && (infuseStored.type == null - || infuseStored.type == InfuseRegistry.getObject(itemstack).type); + return InfuseRegistry.getObject(itemstack) != null && (infuseStored.getType() == null + || infuseStored.getType() == InfuseRegistry.getObject(itemstack).type); } else if (slotID == 0) { return itemstack.getItem() == MekanismItems.SpeedUpgrade || itemstack.getItem() == MekanismItems.EnergyUpgrade; } else if (slotID == 2) { - if (infuseStored.type != null) { + if (infuseStored.getType() != null) { return RecipeHandler.getMetallurgicInfuserRecipe(new InfusionInput(infuseStored, itemstack)) != null; } else { return Recipe.METALLURGIC_INFUSER.get().keySet().stream() @@ -242,15 +235,18 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i } public int getScaledInfuseLevel(int i) { - return infuseStored.amount * i / MAX_INFUSE; + return infuseStored.getAmount() * i / MAX_INFUSE; } @Override public void readFromNBT(NBTTagCompound nbtTags) { super.readFromNBT(nbtTags); - infuseStored.amount = nbtTags.getInteger("infuseStored"); - infuseStored.type = InfuseRegistry.get(nbtTags.getString("type")); + int amount = nbtTags.getInteger("infuseStored"); + if (amount != 0) { + infuseStored.setAmount(amount); + infuseStored.setType(InfuseRegistry.get(nbtTags.getString("type"))); + } } @Nonnull @@ -258,10 +254,9 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i public NBTTagCompound writeToNBT(NBTTagCompound nbtTags) { super.writeToNBT(nbtTags); - nbtTags.setInteger("infuseStored", infuseStored.amount); - - if (infuseStored.type != null) { - nbtTags.setString("type", infuseStored.type.name); + if (infuseStored.getType() != null) { + nbtTags.setString("type", infuseStored.getType().name); + nbtTags.setInteger("infuseStored", infuseStored.getAmount()); } else { nbtTags.setString("type", "null"); } @@ -274,16 +269,19 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i @Override public void handlePacketData(ByteBuf dataStream) { if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - infuseStored.amount = dataStream.readInt(); + infuseStored.setAmount(dataStream.readInt()); return; } super.handlePacketData(dataStream); if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { - infuseStored.amount = dataStream.readInt(); - if (infuseStored.amount > 0) { - infuseStored.type = InfuseRegistry.get(PacketHandler.readString(dataStream)); + int amount = dataStream.readInt(); + if (amount > 0) { + infuseStored.setAmount(amount); + infuseStored.setType(InfuseRegistry.get(PacketHandler.readString(dataStream))); + } else { + infuseStored.setEmpty(); } } } @@ -292,9 +290,9 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i public TileNetworkList getNetworkedData(TileNetworkList data) { super.getNetworkedData(data); - data.add(infuseStored.amount); - if (infuseStored.amount > 0) { - data.add(infuseStored.type.name); + data.add(infuseStored.getAmount()); + if (infuseStored.getAmount() > 0) { + data.add(infuseStored.getType().name); } return data; @@ -323,7 +321,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityOperationalMachine i case 6: return new Object[]{infuseStored}; case 7: - return new Object[]{MAX_INFUSE - infuseStored.amount}; + return new Object[]{MAX_INFUSE - infuseStored.getAmount()}; default: throw new NoSuchMethodException(); } diff --git a/src/main/resources/assets/mekanism/gui/guimetallurgicinfuser.png b/src/main/resources/assets/mekanism/gui/guimetallurgicinfuser.png index a8d74869197a8c6afc0f8d89ba811c2e33d661b5..df1edd647c7e3debba88a085138cf142a877817c 100644 GIT binary patch delta 2155 zcmah|c~BEq7=H`lMnD*q84kCLS`k8SlB|Ry!~+#!0Oe2|mSh84Aq&YOVH`+kty2{c zU3)p6ZIv18h1zP1A}U3uv{lO=T3b0p>xBnJq;mF!08$6_&20AN_kHj8eed`EcJoH0 z7p)BNv;CKfj*eeM>PS7MMiUk((Re+rrE*9BWKGox?Y4gXd)<}-0G#p`ry2lo@v=M! z*tyFa0EhEzEhi2^SvR|IUMN>B5KB<0JVX#G63gYmsE{v^@%S>HK*SY<;$l876r!UG z3ujC0lx%~YKl{uskezKG%%<#+}Hozf>O>+qHM2)$5c(k4*7+Rl1(>V%^ z-S6OQ!d~H|ieN|u21`k}d{{@GB#`0)IWCrQ`BI$Ex2DF@8cJI%v8k_@3C7~(C-CTq4vjcaLrF2N`;DwoJ2d3m}l49&}?8QPFd!@lVpS`RD3 z_Cyo$7$~?^V+A&e@FN|^#^NzL14HQ4WQGsa;-o_hGt4-!cg@Xfr?famab;8*er*IcEj5m&j zInP{%hC$(=l#3|?G*A&dX$dEi`J=lW3NM#=|UE7*X0PCGT~WM`9|{pw?4)7GcNI6I2T=TO$q+ zep zWeTVd*t+=a1yt*1R8QTwPccurVfx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