Fixes dupe bug. #309
This commit is contained in:
parent
2e69571c8a
commit
dc30df522c
1 changed files with 12 additions and 8 deletions
|
@ -1,5 +1,7 @@
|
||||||
|
|
||||||
package appeng.util.inv;
|
package appeng.util.inv;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -9,6 +11,7 @@ import appeng.util.InventoryAdaptor;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import appeng.util.iterators.NullIterator;
|
import appeng.util.iterators.NullIterator;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lets you do simply tests with the players cursor, without messing with the specifics.
|
* Lets you do simply tests with the players cursor, without messing with the specifics.
|
||||||
*/
|
*/
|
||||||
|
@ -17,12 +20,13 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
|
|
||||||
private final EntityPlayer p;
|
private final EntityPlayer p;
|
||||||
|
|
||||||
public AdaptorPlayerHand(EntityPlayer _p) {
|
public AdaptorPlayerHand( EntityPlayer _p )
|
||||||
|
{
|
||||||
p = _p;
|
p = _p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
ItemStack hand = p.inventory.getItemStack();
|
||||||
if ( hand == null )
|
if ( hand == null )
|
||||||
|
@ -42,7 +46,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
ItemStack hand = p.inventory.getItemStack();
|
||||||
|
@ -60,7 +64,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
ItemStack hand = p.inventory.getItemStack();
|
||||||
if ( hand == null )
|
if ( hand == null )
|
||||||
|
@ -80,7 +84,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
ItemStack hand = p.inventory.getItemStack();
|
||||||
|
@ -98,7 +102,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack addItems(ItemStack A)
|
public ItemStack addItems( ItemStack A )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( A == null )
|
if ( A == null )
|
||||||
|
@ -112,7 +116,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
|
|
||||||
ItemStack hand = p.inventory.getItemStack();
|
ItemStack hand = p.inventory.getItemStack();
|
||||||
|
|
||||||
if ( hand != null && !Platform.isSameItem( A, hand ) )
|
if ( hand != null && !Platform.isSameItemPrecise( A, hand ) )
|
||||||
return A;
|
return A;
|
||||||
|
|
||||||
int original = 0;
|
int original = 0;
|
||||||
|
@ -140,7 +144,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack simulateAdd(ItemStack A)
|
public ItemStack simulateAdd( ItemStack A )
|
||||||
{
|
{
|
||||||
ItemStack hand = p.inventory.getItemStack();
|
ItemStack hand = p.inventory.getItemStack();
|
||||||
if ( A == null )
|
if ( A == null )
|
||||||
|
|
Loading…
Reference in a new issue