mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 02:45:08 +00:00
ec2 style output rule and oc integration
This commit is contained in:
1 parent
19f9dee682
commit
e38869f07d
20 files changed
+503
-25
No files matched your search
@@ -39,9 +39,9 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
{
|
||||
if( slot >= 0 && slot < this.getSlots() )
|
||||
{
|
||||
if( Objects.equals( this.fluids[slot], fluid ) )
|
||||
if( fluid != null && this.fluids[slot] != null && fluid.getFluidStack().isFluidEqual(this.fluids[slot].getFluidStack()) )
|
||||
{
|
||||
if( fluid != null && fluid.getStackSize() != this.fluids[slot].getStackSize() )
|
||||
if(fluid.getStackSize() != this.fluids[slot].getStackSize())
|
||||
{
|
||||
this.fluids[slot].setStackSize( Math.min( fluid.getStackSize(), this.capacity ) );
|
||||
this.onContentChanged( slot );
|
||||
@@ -82,6 +82,15 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
return null;
|
||||
}
|
||||
|
||||
public FluidStack getFluidStackInSlot( final int slot )
|
||||
{
|
||||
if( getFluidInSlot(slot) != null )
|
||||
{
|
||||
return getFluidInSlot(slot).getFluidStack();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlots()
|
||||
{
|
||||
@@ -141,7 +150,7 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
public FluidStack drain( final int slot, final FluidStack resource, final boolean doDrain )
|
||||
{
|
||||
final IAEFluidStack fluid = this.fluids[slot];
|
||||
if(fluid == null || !fluid.getFluidStack().equals(resource))
|
||||
if(fluid == null || !fluid.getFluidStack().isFluidEqual(resource))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -212,6 +221,9 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
FluidStack totalDrained = null;
|
||||
for( int slot = 0; slot < this.getSlots(); ++slot )
|
||||
{
|
||||
if (!fluid.isFluidEqual(getFluidStackInSlot(slot))) {
|
||||
continue;
|
||||
}
|
||||
FluidStack drain = this.drain( slot, resource, doDrain );
|
||||
if( drain != null )
|
||||
{
|
||||
@@ -247,6 +259,10 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
|
||||
for( int slot = 0; slot < this.getSlots(); ++slot )
|
||||
{
|
||||
if (this.getFluidInSlot(slot) == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( totalDrained == null )
|
||||
{
|
||||
totalDrained = this.drain( slot, toDrain, doDrain );
|
||||
@@ -375,7 +391,7 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill) {
|
||||
if (resource == null || (getFluid() != null && !resource.equals(getFluid()))) return 0;
|
||||
if (resource == null || (getFluid() != null && !resource.isFluidEqual(getFluid()))) return 0;
|
||||
int acc = 0;
|
||||
if (getFluid() == null) {
|
||||
acc = Math.min(resource.amount, getCapacity());
|
||||
|
||||
@@ -11,10 +11,7 @@ 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;
|
||||
import com.glodblock.github.common.tile.TileFluidPatternEncoder;
|
||||
import com.glodblock.github.common.tile.TileIngredientBuffer;
|
||||
import com.glodblock.github.common.tile.*;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -23,6 +20,18 @@ import java.util.List;
|
||||
|
||||
public enum GuiType {
|
||||
|
||||
OC_PATTERN_EDITOR(new TileGuiFactory<TileOCPatternEditor>(TileOCPatternEditor.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileOCPatternEditor inv) {
|
||||
return new ContainerOCPatternEditor(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, TileOCPatternEditor inv) {
|
||||
return new GuiOCPatternEditor(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_PART(new PartGuiFactory<PartFluidInterface>(PartFluidInterface.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartFluidInterface inv) {
|
||||
|
||||
Reference in new issue
Block a user