2014-11-14 12:02:52 +01:00
|
|
|
/*
|
|
|
|
* This file is part of Applied Energistics 2.
|
|
|
|
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
|
|
*/
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
package appeng.tile.misc;
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.inventory.IInventory;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2015-06-16 02:44:59 +02:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-10-26 22:58:23 +02:00
|
|
|
import net.minecraftforge.common.capabilities.Capability;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
2016-10-26 22:58:23 +02:00
|
|
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
|
|
|
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
|
|
|
import net.minecraftforge.fluids.capability.IFluidHandler;
|
|
|
|
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
|
|
|
import net.minecraftforge.items.CapabilityItemHandler;
|
|
|
|
import net.minecraftforge.items.IItemHandler;
|
2015-12-24 02:07:03 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.AEApi;
|
2014-09-20 22:21:47 +02:00
|
|
|
import appeng.api.config.CondenserOutput;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.config.Settings;
|
2015-01-03 02:53:14 +01:00
|
|
|
import appeng.api.definitions.IMaterials;
|
2014-01-23 20:02:48 +01:00
|
|
|
import appeng.api.implementations.items.IStorageComponent;
|
2016-10-26 22:58:23 +02:00
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
|
|
|
import appeng.api.storage.IMEMonitor;
|
|
|
|
import appeng.api.storage.IStorageMonitorable;
|
|
|
|
import appeng.api.storage.IStorageMonitorableAccessor;
|
|
|
|
import appeng.api.storage.data.IAEFluidStack;
|
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.util.IConfigManager;
|
2014-09-20 22:20:00 +02:00
|
|
|
import appeng.api.util.IConfigurableObject;
|
2016-10-26 22:58:23 +02:00
|
|
|
import appeng.capabilities.Capabilities;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.tile.AEBaseInvTile;
|
2014-08-28 09:39:52 +02:00
|
|
|
import appeng.tile.TileEvent;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.tile.events.TileEventType;
|
|
|
|
import appeng.tile.inventory.AppEngInternalInventory;
|
|
|
|
import appeng.tile.inventory.InvOperation;
|
|
|
|
import appeng.util.ConfigManager;
|
|
|
|
import appeng.util.IConfigManagerHost;
|
|
|
|
import appeng.util.Platform;
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost, IConfigurableObject
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
2016-10-04 01:34:29 +02:00
|
|
|
public static final int BYTE_MULTIPLIER = 8;
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
private final int[] sides = {
|
|
|
|
0,
|
|
|
|
1
|
|
|
|
};
|
2015-10-08 15:42:42 +02:00
|
|
|
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 3 );
|
|
|
|
private final ConfigManager cm = new ConfigManager( this );
|
2016-10-26 22:58:23 +02:00
|
|
|
private final IItemHandler itemHandler = new ItemHandler();
|
|
|
|
private final IFluidHandler fluidHandler = new FluidHandler();
|
|
|
|
private final MEHandler meHandler = new MEHandler();
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2015-10-08 15:42:42 +02:00
|
|
|
private double storedPower = 0;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
public TileCondenser()
|
|
|
|
{
|
|
|
|
this.cm.registerSetting( Settings.CONDENSER_OUTPUT, CondenserOutput.TRASH );
|
|
|
|
}
|
|
|
|
|
|
|
|
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
2015-09-30 14:24:40 +02:00
|
|
|
public void writeToNBT_TileCondenser( final NBTTagCompound data )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.cm.writeToNBT( data );
|
2015-10-08 15:42:42 +02:00
|
|
|
data.setDouble( "storedPower", this.getStoredPower() );
|
2014-08-28 09:39:52 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
@TileEvent( TileEventType.WORLD_NBT_READ )
|
2015-09-30 14:24:40 +02:00
|
|
|
public void readFromNBT_TileCondenser( final NBTTagCompound data )
|
2014-08-28 09:39:52 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.cm.readFromNBT( data );
|
2015-10-08 15:42:42 +02:00
|
|
|
this.setStoredPower( data.getDouble( "storedPower" ) );
|
2014-08-28 09:39:52 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
public double getStorage()
|
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack is = this.inv.getStackInSlot( 2 );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( is != null )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( is.getItem() instanceof IStorageComponent )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final IStorageComponent sc = (IStorageComponent) is.getItem();
|
2015-04-03 08:54:31 +02:00
|
|
|
if( sc.isStorageComponent( is ) )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2016-10-04 01:34:29 +02:00
|
|
|
return sc.getBytes( is ) * BYTE_MULTIPLIER;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
public void addPower( final double rawPower )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-10-08 15:42:42 +02:00
|
|
|
this.setStoredPower( this.getStoredPower() + rawPower );
|
|
|
|
this.setStoredPower( Math.max( 0.0, Math.min( this.getStorage(), this.getStoredPower() ) ) );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
final double requiredPower = this.getRequiredPower();
|
|
|
|
final ItemStack output = this.getOutput();
|
2015-10-08 15:42:42 +02:00
|
|
|
while( requiredPower <= this.getStoredPower() && output != null && requiredPower > 0 )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( this.canAddOutput( output ) )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-10-08 15:42:42 +02:00
|
|
|
this.setStoredPower( this.getStoredPower() - requiredPower );
|
2014-12-29 15:13:47 +01:00
|
|
|
this.addOutput( output );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
else
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2013-12-27 23:59:59 +01:00
|
|
|
break;
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-30 14:24:40 +02:00
|
|
|
private boolean canAddOutput( final ItemStack output )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack outputStack = this.getStackInSlot( 1 );
|
2016-11-04 09:27:52 +01:00
|
|
|
return outputStack == null || ( Platform.itemComparisons().isEqualItem( outputStack, output ) && outputStack.stackSize < outputStack.getMaxStackSize() );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* make sure you validate with canAddOutput prior to this.
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-09-27 23:17:47 +02:00
|
|
|
* @param output to be added output
|
2013-12-27 23:59:59 +01:00
|
|
|
*/
|
2015-09-30 14:24:40 +02:00
|
|
|
private void addOutput( final ItemStack output )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack outputStack = this.getStackInSlot( 1 );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( outputStack == null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.setInventorySlotContents( 1, output.copy() );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
outputStack.stackSize++;
|
2014-12-29 15:13:47 +01:00
|
|
|
this.setInventorySlotContents( 1, outputStack );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private ItemStack getOutput()
|
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
final IMaterials materials = AEApi.instance().definitions().materials();
|
|
|
|
|
2015-04-03 08:54:31 +02:00
|
|
|
switch( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-01-03 02:53:14 +01:00
|
|
|
case MATTER_BALLS:
|
2016-08-24 19:06:10 +02:00
|
|
|
return materials.matterBall().maybeStack( 1 ).orElse( null );
|
2015-01-03 02:53:14 +01:00
|
|
|
|
|
|
|
case SINGULARITY:
|
2016-08-24 19:06:10 +02:00
|
|
|
return materials.singularity().maybeStack( 1 ).orElse( null );
|
2015-01-03 02:53:14 +01:00
|
|
|
|
|
|
|
case TRASH:
|
|
|
|
default:
|
2016-08-24 19:06:10 +02:00
|
|
|
return null;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getRequiredPower()
|
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
return ( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) ).requiredPower;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-04-03 08:54:31 +02:00
|
|
|
public IInventory getInternalInventory()
|
|
|
|
{
|
|
|
|
return this.inv;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( i == 0 )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( itemstack != null )
|
2015-04-29 02:30:53 +02:00
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.addPower( itemstack.stackSize );
|
2015-04-29 02:30:53 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.inv.setInventorySlotContents( 1, itemstack );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
return i == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
if( slot == 0 )
|
|
|
|
{
|
2015-09-30 14:24:40 +02:00
|
|
|
final ItemStack is = inv.getStackInSlot( 0 );
|
2015-04-03 08:54:31 +02:00
|
|
|
if( is != null )
|
|
|
|
{
|
|
|
|
this.addPower( is.stackSize );
|
|
|
|
inv.setInventorySlotContents( 0, null );
|
|
|
|
}
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-03-22 11:07:25 +01:00
|
|
|
return slotIndex == 0;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
return slotIndex != 0;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-30 14:24:40 +02:00
|
|
|
public int[] getAccessibleSlotsBySide( final EnumFacing side )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2015-04-03 08:54:31 +02:00
|
|
|
return this.sides;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-26 22:58:23 +02:00
|
|
|
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
this.addPower( 0 );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-26 22:58:23 +02:00
|
|
|
public IConfigManager getConfigManager()
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
return this.cm;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
public double getStoredPower()
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
return this.storedPower;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
private void setStoredPower( final double storedPower )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
this.storedPower = storedPower;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-26 22:58:23 +02:00
|
|
|
public boolean hasCapability( Capability<?> capability, EnumFacing facing )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
if( capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY )
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if( capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY )
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if( capability == Capabilities.STORAGE_MONITORABLE_ACCESSOR )
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return super.hasCapability( capability, facing );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
@SuppressWarnings( "unchecked" )
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
2016-10-26 22:58:23 +02:00
|
|
|
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
if( capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY )
|
|
|
|
{
|
|
|
|
return (T) itemHandler;
|
|
|
|
}
|
|
|
|
else if( capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY )
|
|
|
|
{
|
|
|
|
return (T) fluidHandler;
|
|
|
|
}
|
|
|
|
else if( capability == Capabilities.STORAGE_MONITORABLE_ACCESSOR )
|
|
|
|
{
|
|
|
|
return (T) meHandler;
|
|
|
|
}
|
|
|
|
return super.getCapability( capability, facing );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
private class ItemHandler implements IItemHandler
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
@Override
|
|
|
|
public int getSlots()
|
|
|
|
{
|
|
|
|
// We only expose the void slot
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack getStackInSlot( int slot )
|
|
|
|
{
|
|
|
|
// The void slot never has any content
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack insertItem( int slot, ItemStack stack, boolean simulate )
|
|
|
|
{
|
|
|
|
if( slot != 0 )
|
|
|
|
{
|
|
|
|
return stack;
|
|
|
|
}
|
|
|
|
if( !simulate && stack != null )
|
|
|
|
{
|
|
|
|
addPower( stack.stackSize );
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack extractItem( int slot, int amount, boolean simulate )
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
2015-10-08 15:42:42 +02:00
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
|
|
|
|
private static final IFluidTankProperties[] EMPTY = { new FluidTankProperties( null, 10, true, false ) };
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A fluid handler that exposes a 10 bucket tank that can only be filled, and - when filled - will add power
|
|
|
|
* to this condenser.
|
|
|
|
*/
|
|
|
|
private class FluidHandler implements IFluidHandler
|
2015-10-08 15:42:42 +02:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public IFluidTankProperties[] getTankProperties()
|
|
|
|
{
|
|
|
|
return EMPTY;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int fill( FluidStack resource, boolean doFill )
|
|
|
|
{
|
|
|
|
if( doFill )
|
|
|
|
{
|
|
|
|
addPower( ( resource == null ? 0.0 : (double) resource.amount ) / 500.0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
return resource == null ? 0 : resource.amount;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public FluidStack drain( FluidStack resource, boolean doDrain )
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public FluidStack drain( int maxDrain, boolean doDrain )
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2015-10-08 15:42:42 +02:00
|
|
|
}
|
|
|
|
|
2016-10-26 22:58:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is used to expose a fake ME subnetwork that is only composed of this condenser tile. The purpose of this is to enable the condenser to
|
|
|
|
* override the {@link appeng.api.storage.IMEInventoryHandler#validForPass(int)} method to make sure a condenser is only ever used if an item
|
|
|
|
* can't go anywhere else.
|
|
|
|
*/
|
|
|
|
private class MEHandler implements IStorageMonitorableAccessor, IStorageMonitorable
|
2015-10-08 15:42:42 +02:00
|
|
|
{
|
2016-10-26 22:58:23 +02:00
|
|
|
private final CondenserFluidInventory fluidInventory = new CondenserFluidInventory( TileCondenser.this );
|
|
|
|
|
|
|
|
private final CondenserItemInventory itemInventory = new CondenserItemInventory( TileCondenser.this );
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public IStorageMonitorable getInventory( BaseActionSource src )
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IMEMonitor<IAEItemStack> getItemInventory()
|
|
|
|
{
|
|
|
|
return itemInventory;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IMEMonitor<IAEFluidStack> getFluidInventory()
|
|
|
|
{
|
|
|
|
return fluidInventory;
|
|
|
|
}
|
2015-10-08 15:42:42 +02:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|