Added "smart" refinery gui

Shift-left clicking clears the filter
Right clicking sets the filter to the current fluid in the corresponding tank
This commit is contained in:
tommy1019 2013-07-28 20:21:47 -05:00
parent 6150ff56b1
commit de39b79ea0

View file

@ -75,12 +75,27 @@ public class GuiRefinery extends GuiAdvancedInterface {
int position = getSlotAtLocation(i - cornerX, j - cornerY); int position = getSlotAtLocation(i - cornerX, j - cornerY);
if (position >= 0 && position < 2) { if (position >= 0 && position < 2) {
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(mc.thePlayer.inventory.getItemStack()); if (k == 0) {
if (!this.isShiftKeyDown()) {
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(mc.thePlayer.inventory.getItemStack());
if (liquid == null) if (liquid == null) {
return; return;
}
container.setFilter(position, liquid.getFluid()); container.setFilter(position, liquid.getFluid());
return;
} else {
container.setFilter(position, null);
}
} else {
TileRefinery ref = (TileRefinery) this.tile;
if (position == 0)
container.setFilter(position, ref.tank1.getFluidType());
else if (position == 1)
container.setFilter(position, ref.tank2.getFluidType());
}
} }
} }