Skip to content

Commit 5c5fbcd

Browse files
committed
Update PylonGuiBlock.kt
1 parent ad51510 commit 5c5fbcd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • pylon-core/src/main/kotlin/io/github/pylonmc/pylon/core/block/base

pylon-core/src/main/kotlin/io/github/pylonmc/pylon/core/block/base/PylonGuiBlock.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import xyz.xenondevs.invui.gui.AbstractGui
2222
import xyz.xenondevs.invui.gui.Gui
2323
import xyz.xenondevs.invui.inventory.Inventory
2424
import xyz.xenondevs.invui.inventory.VirtualInventory
25+
import xyz.xenondevs.invui.inventory.event.UpdateReason
2526
import xyz.xenondevs.invui.window.Window
2627
import java.util.IdentityHashMap
2728

@@ -102,6 +103,8 @@ interface PylonGuiBlock : PylonBreakHandler, PylonInteractBlock, PylonNoVanillaC
102103

103104
@ApiStatus.Internal
104105
companion object : Listener {
106+
val initializeReason = object : UpdateReason {}
107+
105108
private val inventoryKey = pylonKey("inventories")
106109
private val inventoryType =
107110
PylonSerializers.LIST.listTypeFrom(PylonSerializers.LIST.listTypeFrom(PylonSerializers.ITEM_STACK))
@@ -126,7 +129,7 @@ interface PylonGuiBlock : PylonBreakHandler, PylonInteractBlock, PylonNoVanillaC
126129
val invs = inventories.getOrPut(block) { block.gui.getAllInventories() }
127130
for ((old, new) in invs.zip(items)) {
128131
repeat(old.size) { i ->
129-
old.setItemSilently(i, new[i])
132+
old.forceSetItem(initializeReason, i, new[i])
130133
}
131134
}
132135
}

0 commit comments

Comments
 (0)