Fixes #572 Enable inventory validation for any kind of Player

This commit is contained in:
thatsIch 2014-12-21 23:42:28 +01:00
parent 1fc2ddedec
commit 72b3be0062

View file

@ -33,76 +33,76 @@ public class AdaptorPlayerInventory implements IInventory
{ {
if ( swap ) if ( swap )
src = new WrapperChainedInventory( new WrapperInventoryRange( playerInv, 9, size-9, false ), new WrapperInventoryRange( playerInv, 0, 9, false ) ); this.src = new WrapperChainedInventory( new WrapperInventoryRange( playerInv, 9, this.size -9, false ), new WrapperInventoryRange( playerInv, 0, 9, false ) );
else else
src = playerInv; this.src = playerInv;
} }
@Override @Override
public int getSizeInventory() public int getSizeInventory()
{ {
return size; return this.size;
} }
@Override @Override
public ItemStack getStackInSlot(int var1) public ItemStack getStackInSlot(int var1)
{ {
return src.getStackInSlot( var1 + min ); return this.src.getStackInSlot( var1 + this.min );
} }
@Override @Override
public ItemStack decrStackSize(int var1, int var2) public ItemStack decrStackSize(int var1, int var2)
{ {
return src.decrStackSize( min + var1, var2 ); return this.src.decrStackSize( this.min + var1, var2 );
} }
@Override @Override
public ItemStack getStackInSlotOnClosing(int var1) public ItemStack getStackInSlotOnClosing(int var1)
{ {
return src.getStackInSlotOnClosing( min + var1 ); return this.src.getStackInSlotOnClosing( this.min + var1 );
} }
@Override @Override
public void setInventorySlotContents(int var1, ItemStack var2) public void setInventorySlotContents(int var1, ItemStack var2)
{ {
src.setInventorySlotContents( var1 + min, var2 ); this.src.setInventorySlotContents( var1 + this.min, var2 );
} }
@Override @Override
public String getInventoryName() public String getInventoryName()
{ {
return src.getInventoryName(); return this.src.getInventoryName();
} }
@Override @Override
public int getInventoryStackLimit() public int getInventoryStackLimit()
{ {
return src.getInventoryStackLimit(); return this.src.getInventoryStackLimit();
} }
@Override @Override
public void markDirty() public void markDirty()
{ {
src.markDirty(); this.src.markDirty();
} }
@Override @Override
public boolean isUseableByPlayer(EntityPlayer var1) public boolean isUseableByPlayer(EntityPlayer var1)
{ {
return src.isUseableByPlayer( var1 ); return this.src.isUseableByPlayer( var1 );
} }
@Override @Override
public void openInventory() public void openInventory()
{ {
src.openInventory(); this.src.openInventory();
} }
@Override @Override
public void closeInventory() public void closeInventory()
{ {
src.closeInventory(); this.src.closeInventory();
} }
@Override @Override
@ -114,7 +114,7 @@ public class AdaptorPlayerInventory implements IInventory
@Override @Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) public boolean isItemValidForSlot(int i, ItemStack itemstack)
{ {
return true; return this.src.isItemValidForSlot( i, itemstack );
} }
} }