mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 19:05:29 +00:00
finish the fluid interface
This commit is contained in:
1 parent
475842d115
commit
19f9dee682
11 files changed
+347
-33
No files matched your search
@@ -21,7 +21,6 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
private final IAEFluidStack[] fluids;
|
||||
private final IAEFluidInventory handler;
|
||||
private final int capacity;
|
||||
private FluidTankInfo[] props = null;
|
||||
|
||||
public AEFluidInventory( final IAEFluidInventory handler, final int slots, final int capcity )
|
||||
{
|
||||
@@ -92,16 +91,12 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
||||
{
|
||||
if( this.props == null )
|
||||
FluidTankInfo[] props = new FluidTankInfo[this.getSlots()];
|
||||
for( int i = 0; i < this.getSlots(); ++i )
|
||||
{
|
||||
this.props = new FluidTankInfo[this.getSlots()];
|
||||
for( int i = 0; i < this.getSlots(); ++i )
|
||||
{
|
||||
this.props[i] = new FluidTankInfo(new FluidTankPropertiesWrapper( i ));
|
||||
}
|
||||
|
||||
props[i] = new FluidTankInfo(new FluidTankPropertiesWrapper( i ));
|
||||
}
|
||||
return this.props;
|
||||
return props;
|
||||
}
|
||||
|
||||
public int fill( final int slot, final FluidStack resource, final boolean doFill )
|
||||
|
||||
@@ -9,6 +9,7 @@ import appeng.helpers.IPriorityHost;
|
||||
import com.glodblock.github.client.gui.*;
|
||||
import com.glodblock.github.client.gui.container.*;
|
||||
import com.glodblock.github.common.parts.FCBasePart;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.parts.PartSharedFluidBus;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidPacketDecoder;
|
||||
@@ -22,6 +23,30 @@ import java.util.List;
|
||||
|
||||
public enum GuiType {
|
||||
|
||||
DUAL_INTERFACE_PART(new PartGuiFactory<PartFluidInterface>(PartFluidInterface.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartFluidInterface inv) {
|
||||
return new ContainerInterface(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, PartFluidInterface inv) {
|
||||
return new GuiDualInterface(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_FLUID_PART(new PartGuiFactory<PartFluidInterface>(PartFluidInterface.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartFluidInterface inv) {
|
||||
return new ContainerFluidInterface(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, PartFluidInterface inv) {
|
||||
return new GuiFluidInterface(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE(new TileGuiFactory<TileFluidInterface>(TileFluidInterface.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileFluidInterface inv) {
|
||||
@@ -46,6 +71,18 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_PRIORITY_PART(new PartGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IPriorityHost inv) {
|
||||
return new ContainerPriority(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, IPriorityHost inv) {
|
||||
return new GuiFCPriority(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_PRIORITY(new TileGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IPriorityHost inv) {
|
||||
|
||||
Reference in new issue
Block a user