Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes condenser dupe bug #421

Merged
merged 1 commit into from Nov 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 31 additions & 7 deletions src/main/java/appeng/me/storage/VoidFluidInventory.java
@@ -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;


import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource;
Expand All @@ -9,18 +28,23 @@
import appeng.api.storage.data.IItemList;
import appeng.tile.misc.TileCondenser;


public class VoidFluidInventory implements IMEInventoryHandler<IAEFluidStack>
{

final TileCondenser target;

public VoidFluidInventory(TileCondenser te) {
public VoidFluidInventory( TileCondenser te )
{
target = te;
}

@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 )
target.addPower( input.getStackSize() / 1000.0 );
return null;
Expand All @@ -33,13 +57,13 @@ public StorageChannel getChannel()
}

@Override
public IAEFluidStack extractItems(IAEFluidStack request, Actionable mode, BaseActionSource src)
public IAEFluidStack extractItems( IAEFluidStack request, Actionable mode, BaseActionSource src )
{
return null;
}

@Override
public IItemList<IAEFluidStack> getAvailableItems(IItemList out)
public IItemList<IAEFluidStack> getAvailableItems( IItemList out )
{
return out;
}
Expand All @@ -51,13 +75,13 @@ public AccessRestriction getAccess()
}

@Override
public boolean isPrioritized(IAEFluidStack input)
public boolean isPrioritized( IAEFluidStack input )
{
return false;
}

@Override
public boolean canAccept(IAEFluidStack input)
public boolean canAccept( IAEFluidStack input )
{
return true;
}
Expand All @@ -75,7 +99,7 @@ public int getSlot()
}

@Override
public boolean validForPass(int i)
public boolean validForPass( int i )
{
return i == 2;
}
Expand Down
38 changes: 31 additions & 7 deletions src/main/java/appeng/me/storage/VoidItemInventory.java
@@ -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;


import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource;
Expand All @@ -9,18 +28,23 @@
import appeng.api.storage.data.IItemList;
import appeng.tile.misc.TileCondenser;


public class VoidItemInventory implements IMEInventoryHandler<IAEItemStack>
{

final TileCondenser target;

public VoidItemInventory(TileCondenser te) {
public VoidItemInventory( TileCondenser te )
{
target = te;
}

@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 )
target.addPower( input.getStackSize() );
return null;
Expand All @@ -33,13 +57,13 @@ public StorageChannel getChannel()
}

@Override
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
{
return null;
}

@Override
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
public IItemList<IAEItemStack> getAvailableItems( IItemList out )
{
return out;
}
Expand All @@ -51,13 +75,13 @@ public AccessRestriction getAccess()
}

@Override
public boolean isPrioritized(IAEItemStack input)
public boolean isPrioritized( IAEItemStack input )
{
return false;
}

@Override
public boolean canAccept(IAEItemStack input)
public boolean canAccept( IAEItemStack input )
{
return true;
}
Expand All @@ -75,7 +99,7 @@ public int getSlot()
}

@Override
public boolean validForPass(int i)
public boolean validForPass( int i )
{
return i == 2;
}
Expand Down