This commit is contained in:
DBotThePony 2023-03-23 08:13:54 +07:00
parent 5b1d52489e
commit 2b4a8ec2c4
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 1 additions and 16 deletions

View File

@ -21,7 +21,6 @@ class ContainerHandler @JvmOverloads internal constructor(
if (localStack.isEmpty) {
if (!simulate) {
val copy = stack.copy()
container.setChanged(slot, copy, ItemStack.EMPTY)
container.setItem(slot, copy)
}

View File

@ -32,7 +32,6 @@ open class MatteryContainer(protected val watcher: Runnable, private val size: I
require(size >= 0) { "Invalid container size $size" }
}
private var ignoreChangeNotifications = 0
protected val slots: Array<ItemStack> = Array(size) { ItemStack.EMPTY }
private val trackedSlots: Array<ItemStack> = Array(size) { ItemStack.EMPTY }
private val filters: Array<Item?> = arrayOfNulls(size)
@ -103,19 +102,6 @@ open class MatteryContainer(protected val watcher: Runnable, private val size: I
}
final override fun getContainerSize() = size
fun startIgnoreUpdates() {
if (++ignoreChangeNotifications == 1) {
startedIgnoringUpdates()
}
}
fun stopIgnoreUpdates() {
if (--ignoreChangeNotifications == 0) {
stoppedIgnoringUpdates()
}
}
protected open fun startedIgnoringUpdates() {}
protected open fun stoppedIgnoringUpdates() {}
@ -187,7 +173,7 @@ open class MatteryContainer(protected val watcher: Runnable, private val size: I
}
open fun setChanged(slot: Int, new: ItemStack, old: ItemStack) {
if (ignoreChangeNotifications == 0) watcher.run()
watcher.run()
}
override fun serializeNBT(): CompoundTag {