Fix matter capacitor bank breaking when using creative capacitors
This commit is contained in:
parent
bfd3c89bbf
commit
c988c4b869
@ -82,7 +82,7 @@ class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState)
|
||||
}
|
||||
|
||||
if (summ.isPositive && !simulate) {
|
||||
gaugeLevel = (storedMatter / maxStoredMatter).toFloat()
|
||||
gaugeLevel = storedMatter.percentage(maxStoredMatter)
|
||||
}
|
||||
|
||||
return summ
|
||||
@ -111,7 +111,7 @@ class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState)
|
||||
}
|
||||
|
||||
if (summ.isPositive && !simulate) {
|
||||
gaugeLevel = (storedMatter / maxStoredMatter).toFloat()
|
||||
gaugeLevel = storedMatter.percentage(maxStoredMatter)
|
||||
}
|
||||
|
||||
return summ
|
||||
@ -124,7 +124,7 @@ class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState)
|
||||
override fun setChanged(slot: Int, new: ItemStack, old: ItemStack) {
|
||||
super.setChanged(slot, new, old)
|
||||
capacitorStatus[slot].boolean = new.getCapability(MatteryCapability.MATTER).isPresent
|
||||
gaugeLevel = (storedMatter / maxStoredMatter).toFloat()
|
||||
gaugeLevel = storedMatter.percentage(maxStoredMatter)
|
||||
}
|
||||
|
||||
override fun getMaxStackSize(): Int = 1
|
||||
|
Loading…
Reference in New Issue
Block a user