mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
ESD: Inputs can only be smaller than the connected Inventory's Size. @dqmhose wanted that.
This commit is contained in:
parent
ef909847cb
commit
0c08c6c6b2
1 changed files with 9 additions and 4 deletions
|
@ -17,10 +17,15 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
@Override
|
@Override
|
||||||
public void onNumberReceived(int text, int textID, EntityPlayer player){
|
public void onNumberReceived(int text, int textID, EntityPlayer player){
|
||||||
if(text != -1){
|
if(text != -1){
|
||||||
if(textID == 0) this.slotToPutStart = text;
|
if(this.placeToPut instanceof IInventory){
|
||||||
if(textID == 1) this.slotToPutEnd = text;
|
if(textID == 0) this.slotToPutStart = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0);
|
||||||
if(textID == 2) this.slotToPullStart = text;
|
if(textID == 1) this.slotToPutEnd = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0);
|
||||||
if(textID == 3) this.slotToPullEnd = text;
|
}
|
||||||
|
|
||||||
|
if(this.placeToPull instanceof IInventory){
|
||||||
|
if(textID == 2) this.slotToPullStart = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0);
|
||||||
|
if(textID == 3) this.slotToPullEnd = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue