Fixed Bug: #1030 - Stack Overflow Error while using Portable Cell.

This commit is contained in:
AlgorithmX2
2014-09-07 11:59:58 -05:00
parent cc4210d95a
commit 5ef5c00df4
+10 -2
View File
@@ -173,6 +173,7 @@ public abstract class AEBaseGui extends GuiContainer
super.mouseClicked( xCoord, yCoord, btn ); super.mouseClicked( xCoord, yCoord, btn );
} }
boolean disableShiftClick = false;
Stopwatch dbl_clickTimer = Stopwatch.createStarted(); Stopwatch dbl_clickTimer = Stopwatch.createStarted();
ItemStack dbl_whichItem; ItemStack dbl_whichItem;
Slot bl_clicked; Slot bl_clicked;
@@ -372,6 +373,10 @@ public abstract class AEBaseGui extends GuiContainer
return; return;
} }
if ( disableShiftClick == false )
{
disableShiftClick = true;
if ( dbl_whichItem == null || bl_clicked != slot || dbl_clickTimer.elapsed( TimeUnit.MILLISECONDS ) > 150 ) if ( dbl_whichItem == null || bl_clicked != slot || dbl_clickTimer.elapsed( TimeUnit.MILLISECONDS ) > 150 )
{ {
// some simple double click logic. // some simple double click logic.
@@ -391,14 +396,17 @@ public abstract class AEBaseGui extends GuiContainer
{ {
Slot targetSlot = (Slot) iterator.next(); Slot targetSlot = (Slot) iterator.next();
if ( targetSlot != null && targetSlot.canTakeStack( this.mc.thePlayer ) && targetSlot.getHasStack() && targetSlot.inventory == slot.inventory if ( targetSlot != null && targetSlot.canTakeStack( this.mc.thePlayer ) && targetSlot.getHasStack()
&& Container.func_94527_a( targetSlot, dbl_whichItem, true ) ) && targetSlot.inventory == slot.inventory && Container.func_94527_a( targetSlot, dbl_whichItem, true ) )
{ {
this.handleMouseClick( targetSlot, targetSlot.slotNumber, ctrlDown, 1 ); this.handleMouseClick( targetSlot, targetSlot.slotNumber, ctrlDown, 1 );
} }
} }
} }
disableShiftClick = false;
}
super.handleMouseClick( slot, slotIdx, ctrlDown, key ); super.handleMouseClick( slot, slotIdx, ctrlDown, key );
} }