mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
Fixed Shift Click Duplication Bugs.
Closes https://github.com/Ellpeck/ActuallyAdditions/issues/10
This commit is contained in:
parent
1f9ce8cc77
commit
36d3d7f79f
4 changed files with 9 additions and 8 deletions
|
@ -54,7 +54,7 @@ public class ContainerBreaker extends Container{
|
|||
//Other Slots in Inventory excluded
|
||||
if(slot >= inventoryStart){
|
||||
//Shift from Inventory
|
||||
if(!this.mergeItemStack(newStack, 0, 10, false)){
|
||||
if(!this.mergeItemStack(newStack, 0, 9, false)){
|
||||
//
|
||||
if(slot >= inventoryStart && slot <= inventoryEnd){
|
||||
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ContainerDropper extends Container{
|
|||
//Other Slots in Inventory excluded
|
||||
if(slot >= inventoryStart){
|
||||
//Shift from Inventory
|
||||
if(!this.mergeItemStack(newStack, 0, 10, false)){
|
||||
if(!this.mergeItemStack(newStack, 0, 9, false)){
|
||||
//
|
||||
if(slot >= inventoryStart && slot <= inventoryEnd){
|
||||
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ContainerGrinder extends Container{
|
|||
ItemStack currentStack = newStack.copy();
|
||||
|
||||
//Slots in Inventory to shift from
|
||||
if(slot == TileEntityGrinder.SLOT_OUTPUT_1_1 || slot == TileEntityGrinder.SLOT_OUTPUT_1_2 || slot == TileEntityGrinder.SLOT_OUTPUT_2_1 || slot == TileEntityGrinder.SLOT_OUTPUT_2_2){
|
||||
if(slot == TileEntityGrinder.SLOT_OUTPUT_1_1 || slot == TileEntityGrinder.SLOT_OUTPUT_1_2 || (this.isDouble && (slot == TileEntityGrinder.SLOT_OUTPUT_2_1 || slot == TileEntityGrinder.SLOT_OUTPUT_2_2))){
|
||||
if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, true)) return null;
|
||||
theSlot.onSlotChange(newStack, currentStack);
|
||||
}
|
||||
|
@ -68,9 +68,10 @@ public class ContainerGrinder extends Container{
|
|||
//Shift from Inventory
|
||||
if(CrusherRecipeManualRegistry.getOutput(newStack, false) != null){
|
||||
if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false)){
|
||||
if(this.tileGrinder.isDouble){
|
||||
if(this.isDouble){
|
||||
if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false)) return null;
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
|
|
@ -47,14 +47,14 @@ public class ContainerPhantomPlacer extends Container{
|
|||
|
||||
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||
|
||||
if (theSlot != null && theSlot.getHasStack()){
|
||||
if(theSlot != null && theSlot.getHasStack()){
|
||||
ItemStack newStack = theSlot.getStack();
|
||||
ItemStack currentStack = newStack.copy();
|
||||
|
||||
//Other Slots in Inventory excluded
|
||||
if(slot >= inventoryStart){
|
||||
//Shift from Inventory
|
||||
if(!this.mergeItemStack(newStack, 0, 10, false)){
|
||||
if(!this.mergeItemStack(newStack, 0, 9, false)){
|
||||
//
|
||||
if(slot >= inventoryStart && slot <= inventoryEnd){
|
||||
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
|
||||
|
@ -65,10 +65,10 @@ public class ContainerPhantomPlacer extends Container{
|
|||
}
|
||||
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
|
||||
|
||||
if (newStack.stackSize == 0) theSlot.putStack(null);
|
||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||
else theSlot.onSlotChanged();
|
||||
|
||||
if (newStack.stackSize == currentStack.stackSize) return null;
|
||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||
theSlot.onPickupFromSlot(player, newStack);
|
||||
|
||||
return currentStack;
|
||||
|
|
Loading…
Reference in a new issue