mirror of
https://github.com/GTNewHorizons/gendustry.git
synced 2026-11-19 03:49:18 +00:00
Fixed upgrades sometimes being destroyed by the apiary on shift+click
This commit is contained in:
1 parent
945c4e1306
commit
c1a7ff3105
2 files changed
+4
-4
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ buildscript {
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'scala'
|
||||
|
||||
version = "0.9.0"
|
||||
version = "0.9.1"
|
||||
ext.bdlibver = "0.9.0.2"
|
||||
ext.versuffix = "mc164"
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ class ContainerApiary(val te: TileApiary, player: EntityPlayer) extends BaseCont
|
||||
|
||||
bindPlayerInventory(player.inventory, 8, 84, 142)
|
||||
|
||||
|
||||
|
||||
override def transferStackInSlot(player: EntityPlayer, slot: Int): ItemStack = {
|
||||
val stack = getSlot(slot).getStack
|
||||
if (getSlot(slot).inventory == player.inventory && te.isUpgrade(stack)) {
|
||||
val canAdd = Misc.min(te.getMaxAdditionalUpgrades(stack), stack.stackSize)
|
||||
if (canAdd > 0) {
|
||||
ItemUtils.addStackToSlots(stack.splitStack(canAdd), te, te.slotsUpgrades, true)
|
||||
val remains = ItemUtils.addStackToSlots(stack.splitStack(canAdd), te, te.slotsUpgrades, true)
|
||||
if (remains != null)
|
||||
stack.stackSize += remains.stackSize
|
||||
}
|
||||
getSlot(slot).putStack(if (stack.stackSize > 0) stack else null)
|
||||
return null
|
||||
|
||||
Reference in new issue
Block a user