Fix addMatterValue speculation being wrong with negative matter values

This commit is contained in:
DBotThePony 2023-03-16 23:18:30 +07:00
parent 704225cd9f
commit 6b2909fc1c
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -61,7 +61,7 @@ class MatterDustItem : Item(Properties().stacksTo(64)), IMatterItem {
val matterThis = matter(stack)
if (matterThis >= ItemsConfig.MATTER_DUST_CAPACITY)
if (matterThis >= ItemsConfig.MATTER_DUST_CAPACITY && matter.isPositive)
return Decimal.ZERO
val newMatter = (matterThis + matter).coerceAtMost(ItemsConfig.MATTER_DUST_CAPACITY)