Make exopack smelters drop their slots and lose current progress on death
This commit is contained in:
parent
ccf2a162a3
commit
c9ef3e635b
@ -1582,11 +1582,13 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
||||
|
||||
@JvmStatic
|
||||
fun inventoryDropAll(inventory: Inventory) {
|
||||
if (inventory.player.matteryPlayer?.hasExoPack == false) {
|
||||
val mattery = inventory.player.matteryPlayer ?: return
|
||||
|
||||
if (!mattery.hasExoPack) {
|
||||
return
|
||||
}
|
||||
|
||||
val iterator = inventory.player.matteryPlayer?.exoPackContainer?.iterator() ?: return
|
||||
val iterator = mattery.exoPackContainer.iterator()
|
||||
|
||||
for (item in iterator) {
|
||||
if (!item.isEmpty) {
|
||||
@ -1594,6 +1596,20 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
||||
iterator.remove()
|
||||
}
|
||||
}
|
||||
|
||||
for (smelter in mattery.smelters) {
|
||||
if (!smelter.input[0].isEmpty) {
|
||||
inventory.player.drop(smelter.input[0], true, false)
|
||||
smelter.input[0] = ItemStack.EMPTY
|
||||
}
|
||||
|
||||
if (!smelter.output[0].isEmpty) {
|
||||
inventory.player.drop(smelter.output[0], true, false)
|
||||
smelter.output[0] = ItemStack.EMPTY
|
||||
}
|
||||
|
||||
smelter.currentJob = null
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
Loading…
Reference in New Issue
Block a user