From 13534ddae6a06c055ff12dfd205860c06bd3767c Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Wed, 17 Jul 2013 11:55:54 -0700 Subject: [PATCH] Some clean-up of the refinery code --- common/buildcraft/core/gui/GuiAdvancedInterface.java | 4 ++-- common/buildcraft/factory/gui/ContainerRefinery.java | 9 ++------- common/buildcraft/factory/gui/GuiRefinery.java | 9 ++++----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/common/buildcraft/core/gui/GuiAdvancedInterface.java b/common/buildcraft/core/gui/GuiAdvancedInterface.java index 3e3432c4..69ddf3f2 100644 --- a/common/buildcraft/core/gui/GuiAdvancedInterface.java +++ b/common/buildcraft/core/gui/GuiAdvancedInterface.java @@ -82,7 +82,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { } /** - * More dynamic slot displaying an inventory stack at specified position in the passed IInventory + * More dynamic slot displaying an inventory fluid at specified position in the passed IInventory */ public class IInventorySlot extends AdvancedSlot { @@ -171,7 +171,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { //TODO Get this class working well (Now it's just here to let the refinery compil) public class FluidSlot extends AdvancedSlot { - public Fluid stack; + public Fluid fluid; public FluidSlot(int x, int y) { super(x, y); diff --git a/common/buildcraft/factory/gui/ContainerRefinery.java b/common/buildcraft/factory/gui/ContainerRefinery.java index f5fdb467..52cc1af3 100644 --- a/common/buildcraft/factory/gui/ContainerRefinery.java +++ b/common/buildcraft/factory/gui/ContainerRefinery.java @@ -19,7 +19,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class ContainerRefinery extends BuildCraftContainer { @@ -66,15 +65,11 @@ public class ContainerRefinery extends BuildCraftContainer { } public Fluid getFilter(int slot) { - Fluid filter = refinery.getFilter(slot); - if (filter != null) - return filter; - else - return null; + return refinery.getFilter(slot); } /* GUI DISPLAY UPDATES */ - // @Override Client side only + @Override public void updateProgressBar(int i, int j) { refinery.getGUINetworkData(i, j); } diff --git a/common/buildcraft/factory/gui/GuiRefinery.java b/common/buildcraft/factory/gui/GuiRefinery.java index 3bc9f4ef..bebd8c70 100644 --- a/common/buildcraft/factory/gui/GuiRefinery.java +++ b/common/buildcraft/factory/gui/GuiRefinery.java @@ -16,7 +16,6 @@ import buildcraft.core.gui.GuiAdvancedInterface; import buildcraft.core.utils.StringUtils; import buildcraft.factory.TileRefinery; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -96,8 +95,8 @@ public class GuiRefinery extends GuiAdvancedInterface { Fluid filter0 = container.getFilter(0); Fluid filter1 = container.getFilter(1); - ((FluidSlot) slots[0]).stack = filter0; - ((FluidSlot) slots[1]).stack = filter1; + ((FluidSlot) slots[0]).fluid = filter0; + ((FluidSlot) slots[1]).fluid = filter1; FluidStack liquid0 = null; FluidStack liquid1 = null; @@ -112,9 +111,9 @@ public class GuiRefinery extends GuiAdvancedInterface { Recipe recipe = RefineryRecipes.findRefineryRecipe(liquid0, liquid1); if (recipe != null) { - ((FluidSlot) slots[2]).stack = recipe.result.getFluid(); + ((FluidSlot) slots[2]).fluid = recipe.result.getFluid(); } else { - ((FluidSlot) slots[2]).stack = null; + ((FluidSlot) slots[2]).fluid = null; } }