Interfaces now drop there items properly.

This commit is contained in:
AlgorithmX2 2014-06-22 23:51:20 -05:00
parent 12c0abbac6
commit d730fe17b1
3 changed files with 27 additions and 11 deletions

View file

@ -784,4 +784,22 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
}
}
public void addDrops(List<ItemStack> drops)
{
if ( waitingToSend != null )
{
for (ItemStack is : waitingToSend)
if ( is != null )
drops.add( is );
}
for (ItemStack is : storage)
if ( is != null )
drops.add( is );
for (ItemStack is : patterns)
if ( is != null )
drops.add( is );
}
}

View file

@ -75,17 +75,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched)
{
IInventory inv = duality.getInternalInventory();
for (int l = 0; l < inv.getSizeInventory(); l++)
{
ItemStack is = inv.getStackInSlot( l );
if ( is != null )
{
drops.add( is );
inv.setInventorySlotContents( l, (ItemStack) null );
}
}
duality.addDrops( drops );
}
@Override

View file

@ -1,5 +1,6 @@
package appeng.tile.misc;
import java.util.ArrayList;
import java.util.EnumSet;
import net.minecraft.inventory.IInventory;
@ -7,6 +8,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.tiles.ISegmentedInventory;
import appeng.api.implementations.tiles.ITileStorageMonitorable;
@ -65,6 +67,12 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IS
markDirty();
}
@Override
public void getDrops(World w, int x, int y, int z, ArrayList<ItemStack> drops)
{
duality.addDrops( drops );
}
@Override
public void gridChanged()
{