Skip to content

Commit

Permalink
[6.0.10][publish] Merge pull request #315 from xiaozhangup/master
Browse files Browse the repository at this point in the history
Fix ArrayIndexOutOfBoundsException
  • Loading branch information
Bkm016 authored May 22, 2023
2 parents b349a85 + da4689f commit f0e689d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ open class Stored(title: String) : Basic(title) {
internal var writeItem: ((inventory: Inventory, itemStack: ItemStack, slot: Int) -> Unit) = { inventory, item, slot -> inventory.setItem(slot, item) }

/** 读取物品回调 **/
internal var readItem: ((inventory: Inventory, slot: Int) -> ItemStack?) = { inventory, slot -> inventory.getItem(slot) }
internal var readItem: ((inventory: Inventory, slot: Int) -> ItemStack?) = { inventory, slot ->
if (slot in 0 until inventory.size) inventory.getItem(slot)
else null
}

/**
* 定义判定位置
Expand Down

0 comments on commit f0e689d

Please sign in to comment.