Fix spilling crafting grid on ground if regular (not exosuit) slots are full
This commit is contained in:
parent
199b22dad5
commit
e5d41bf456
@ -10,6 +10,7 @@ import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.inventory.*
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.container.iterator
|
||||
import ru.dbotthepony.mc.otm.network.ExoSuitCarriedPacket
|
||||
import ru.dbotthepony.mc.otm.network.ExoSuitMenuInitPacket
|
||||
import ru.dbotthepony.mc.otm.network.ExoSuitSlotPacket
|
||||
@ -88,7 +89,17 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
|
||||
craftingResultContainer.clearContent()
|
||||
|
||||
if (!player.level.isClientSide) {
|
||||
clearContainer(player, craftingGrid)
|
||||
val iterator = craftingGrid.iterator()
|
||||
|
||||
for (itemStack in iterator) {
|
||||
val leftover = moveItemStackToSlots(itemStack, playerInventorySlots)
|
||||
|
||||
if (!leftover.isEmpty) {
|
||||
player.drop(leftover, true)
|
||||
}
|
||||
|
||||
iterator.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user