Fix moveItemStackTo not calling onTake

This commit is contained in:
DBotThePony 2023-07-08 00:57:16 +07:00
parent 3cacf7f11f
commit ccf2a162a3
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -577,11 +577,15 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
return false
}
val copy = source.item.copy()
if (remainder.isEmpty) {
source.set(ItemStack.EMPTY)
source.onTake(ply, copy)
} else {
copy.count = source.item.count - remainder.count
source.item.count = remainder.count
source.setChanged()
source.onTake(ply, copy)
}
return true