Merge pull request #28 from l4zs/master

change the way of avoiding an IndexOutOfBoundsException
This commit is contained in:
Jakob K
2021-09-28 00:07:34 +02:00
committed by GitHub

View File

@@ -61,7 +61,7 @@ abstract class AbstractGUISpaceCompound<T : ForInventory, E> internal constructo
private fun recalculateCurrentContent() {
if (scrollProgress > content.size)
throw IllegalStateException("The scrollProgress is greater than the content size.")
scrollProgress = content.size
// avoid IndexOutOfBoundsException
var sliceUntil = internalSlots.size + scrollProgress
if (sliceUntil > content.lastIndex)