Skip to content

Commit

Permalink
Merge pull request #310 from yueh/fix-309
Browse files Browse the repository at this point in the history
Fixes dupe bug. #309
  • Loading branch information
yueh committed Oct 16, 2014
2 parents 2e69571 + dc30df5 commit 721226a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/main/java/appeng/util/inv/AdaptorPlayerHand.java
@@ -1,5 +1,7 @@

package appeng.util.inv;


import java.util.Iterator;

import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -9,6 +11,7 @@
import appeng.util.Platform;
import appeng.util.iterators.NullIterator;


/*
* Lets you do simply tests with the players cursor, without messing with the specifics.
*/
Expand All @@ -17,12 +20,13 @@ public class AdaptorPlayerHand extends InventoryAdaptor

private final EntityPlayer p;

public AdaptorPlayerHand(EntityPlayer _p) {
public AdaptorPlayerHand( EntityPlayer _p )
{
p = _p;
}

@Override
public ItemStack removeSimilarItems(int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination dest)
public ItemStack removeSimilarItems( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination dest )
{
ItemStack hand = p.inventory.getItemStack();
if ( hand == null )
Expand All @@ -42,7 +46,7 @@ public ItemStack removeSimilarItems(int how_many, ItemStack Filter, FuzzyMode fu
}

@Override
public ItemStack simulateSimilarRemove(int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination dest)
public ItemStack simulateSimilarRemove( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination dest )
{

ItemStack hand = p.inventory.getItemStack();
Expand All @@ -60,7 +64,7 @@ public ItemStack simulateSimilarRemove(int how_many, ItemStack Filter, FuzzyMode
}

@Override
public ItemStack removeItems(int how_many, ItemStack Filter, IInventoryDestination dest)
public ItemStack removeItems( int how_many, ItemStack Filter, IInventoryDestination dest )
{
ItemStack hand = p.inventory.getItemStack();
if ( hand == null )
Expand All @@ -80,7 +84,7 @@ public ItemStack removeItems(int how_many, ItemStack Filter, IInventoryDestinati
}

@Override
public ItemStack simulateRemove(int how_many, ItemStack Filter, IInventoryDestination dest)
public ItemStack simulateRemove( int how_many, ItemStack Filter, IInventoryDestination dest )
{

ItemStack hand = p.inventory.getItemStack();
Expand All @@ -98,7 +102,7 @@ public ItemStack simulateRemove(int how_many, ItemStack Filter, IInventoryDestin
}

@Override
public ItemStack addItems(ItemStack A)
public ItemStack addItems( ItemStack A )
{

if ( A == null )
Expand All @@ -112,7 +116,7 @@ public ItemStack addItems(ItemStack A)

ItemStack hand = p.inventory.getItemStack();

if ( hand != null && !Platform.isSameItem( A, hand ) )
if ( hand != null && !Platform.isSameItemPrecise( A, hand ) )
return A;

int original = 0;
Expand Down Expand Up @@ -140,7 +144,7 @@ public ItemStack addItems(ItemStack A)
}

@Override
public ItemStack simulateAdd(ItemStack A)
public ItemStack simulateAdd( ItemStack A )
{
ItemStack hand = p.inventory.getItemStack();
if ( A == null )
Expand Down

0 comments on commit 721226a

Please sign in to comment.