Some clean-up of the refinery code

This commit is contained in:
CovertJaguar 2013-07-17 11:55:54 -07:00
parent e49bddc867
commit 13534ddae6
3 changed files with 8 additions and 14 deletions

View file

@ -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);

View file

@ -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);
}

View file

@ -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;
}
}