Merge pull request #421 from yueh/fix-392

Fixes condenser dupe bug
This commit is contained in:
yueh
2014-11-13 14:31:46 +01:00
2 changed files with 62 additions and 14 deletions
@@ -1,5 +1,24 @@
/*
* 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>.
*/
package appeng.me.storage; package appeng.me.storage;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource; import appeng.api.networking.security.BaseActionSource;
@@ -9,18 +28,23 @@ import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IItemList; import appeng.api.storage.data.IItemList;
import appeng.tile.misc.TileCondenser; import appeng.tile.misc.TileCondenser;
public class VoidFluidInventory implements IMEInventoryHandler<IAEFluidStack> public class VoidFluidInventory implements IMEInventoryHandler<IAEFluidStack>
{ {
final TileCondenser target; final TileCondenser target;
public VoidFluidInventory(TileCondenser te) { public VoidFluidInventory( TileCondenser te )
{
target = te; target = te;
} }
@Override @Override
public IAEFluidStack injectItems( IAEFluidStack input, Actionable mode, BaseActionSource src ) public IAEFluidStack injectItems( IAEFluidStack input, Actionable mode, BaseActionSource src )
{ {
if ( mode == Actionable.SIMULATE )
return null;
if ( input != null ) if ( input != null )
target.addPower( input.getStackSize() / 1000.0 ); target.addPower( input.getStackSize() / 1000.0 );
return null; return null;
@@ -1,5 +1,24 @@
/*
* 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>.
*/
package appeng.me.storage; package appeng.me.storage;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource; import appeng.api.networking.security.BaseActionSource;
@@ -9,18 +28,23 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList; import appeng.api.storage.data.IItemList;
import appeng.tile.misc.TileCondenser; import appeng.tile.misc.TileCondenser;
public class VoidItemInventory implements IMEInventoryHandler<IAEItemStack> public class VoidItemInventory implements IMEInventoryHandler<IAEItemStack>
{ {
final TileCondenser target; final TileCondenser target;
public VoidItemInventory(TileCondenser te) { public VoidItemInventory( TileCondenser te )
{
target = te; target = te;
} }
@Override @Override
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src ) public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
{ {
if ( mode == Actionable.SIMULATE )
return null;
if ( input != null ) if ( input != null )
target.addPower( input.getStackSize() ); target.addPower( input.getStackSize() );
return null; return null;