"Linkage Error: attempted duplicate class definition" while trying to get ItemComponents
SilverAndro opened this issue ยท 1 comments
crash-2021-05-26_22.51.54-client.txt
(Source code is in kotlin, shouldn't cause any issues though)
registration:
val MOUNT_ITEM = MountItem(false, FabricItemSettings()
.maxCount(1)
.rarity(Rarity.RARE))
val CONTAINER: ComponentKey<MountItemComponent> = ComponentRegistry.getOrCreate(
Identifier("mole_hill", "container"),
MountItemComponent::class.java
)
// [...snip...]
override fun registerItemComponentFactories(registry: ItemComponentFactoryRegistry) {
registry.registerFor(MOUNT_ITEM, CONTAINER) { stack -> MountItemComponent(stack) }
}
Line that causes the issue is a simple Main.CONTAINER.get(stack)
Don't believe the actual component code matters as its never loaded but if needed I can provide it
this error isn't just to do with kotlin, im using java code and im getting the same exception