Fixed Shift Click Duplication Bugs.

Closes https://github.com/Ellpeck/ActuallyAdditions/issues/10
This commit is contained in:
Ellpeck 2015-08-28 15:41:12 +02:00
parent 1f9ce8cc77
commit 36d3d7f79f
4 changed files with 9 additions and 8 deletions

View file

@ -54,7 +54,7 @@ public class ContainerBreaker extends Container{
//Other Slots in Inventory excluded //Other Slots in Inventory excluded
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //Shift from Inventory
if(!this.mergeItemStack(newStack, 0, 10, false)){ if(!this.mergeItemStack(newStack, 0, 9, false)){
// //
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;

View file

@ -54,7 +54,7 @@ public class ContainerDropper extends Container{
//Other Slots in Inventory excluded //Other Slots in Inventory excluded
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //Shift from Inventory
if(!this.mergeItemStack(newStack, 0, 10, false)){ if(!this.mergeItemStack(newStack, 0, 9, false)){
// //
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;

View file

@ -59,7 +59,7 @@ public class ContainerGrinder extends Container{
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
//Slots in Inventory to shift from //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; if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, true)) return null;
theSlot.onSlotChange(newStack, currentStack); theSlot.onSlotChange(newStack, currentStack);
} }
@ -68,9 +68,10 @@ public class ContainerGrinder extends Container{
//Shift from Inventory //Shift from Inventory
if(CrusherRecipeManualRegistry.getOutput(newStack, false) != null){ if(CrusherRecipeManualRegistry.getOutput(newStack, false) != null){
if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false)){ 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; if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false)) return null;
} }
else return null;
} }
} }
// //

View file

@ -54,7 +54,7 @@ public class ContainerPhantomPlacer extends Container{
//Other Slots in Inventory excluded //Other Slots in Inventory excluded
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //Shift from Inventory
if(!this.mergeItemStack(newStack, 0, 10, false)){ if(!this.mergeItemStack(newStack, 0, 9, false)){
// //
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;