&& slotIndex >= 0
&& inventorySlots.get(slotIndex) != null
&& inventorySlots.get(slotIndex) instanceof SlotClevercraft) {
// Check if the currently held itemstack is different to the clicked itemstack.
ItemStack itemstack = inventory.getStackInSlot(slotIndex);
ItemStack playerItemStack = entityplayer.inventory.getItemStack();
boolean currentItemStackIsDifferent = false;
if(playerItemStack != null && itemstack != null) {
if(playerItemStack.itemID == itemstack.itemID
&& (itemstack.getItemDamage() == -1 || itemstack.getItemDamage() == playerItemStack.getItemDamage())) {
currentItemStackIsDifferent = false;
} else {
currentItemStackIsDifferent = true;
}
}
if(currentItemStackIsDifferent)
return null;
// Ignore right click.
if(mouseButton == 1) {
return null;
} else if(shiftIsDown) {
onRequestMaximumRecipeOutput( (SlotClevercraft)inventorySlots.get(slotIndex) );
populateSlotsWithRecipes();
updateVisibleSlots(ScrollValue);
return null;
} else {
if( !onRequestSingleRecipeOutput( (SlotClevercraft)inventorySlots.get(slotIndex) ) )
populateSlotsWithRecipes();
updateVisibleSlots(ScrollValue);
return null;
}
}
if(shiftIsDown) {
transferStackInSlot(slotIndex);
populateSlotsWithRecipes();
updateVisibleSlots(ScrollValue);
return null;
} else {
ItemStack itemstack = super.slotClick(slotIndex, mouseButton, shiftIsDown, entityplayer);
populateSlotsWithRecipes();
updateVisibleSlots(ScrollValue);
return itemstack;
}
}