Hello all
I’m currently writing a “multiplatform” Minecraft Inventory GUI library with two JVM targets - Minestom and Paper. I’m currently trying to reduce my generics by using Kotlin multiplatform.
I need to fill in type parameters based on the platform being used. In Minestom, there is net.minestom.server.item.ItemStack, which is an interface. Paper’s ItemStack is a class. This arises an issue when I do
expect class Display
actual typealias Display = net.minestom.server.item.ItemStack
actual typealias Display = org.bukkit.inventory.ItemStack
All I need is to use it in my Widgets as a factory, like so
class Widget {
val display: Display
}
Is there a way to do this or another method I can use to get the same functionality? Thank you