Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Linkage Error: attempted duplicate class definition" while trying to get ItemComponents #90

Open
SilverAndro opened this issue May 27, 2021 · 1 comment
Labels

Comments

@SilverAndro
Copy link

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

@UpcraftLP UpcraftLP added the duplicate This issue or pull request already exists label May 27, 2021
@UpcraftLP UpcraftLP reopened this May 27, 2021
@UpcraftLP UpcraftLP added bug Something isn't working components-item components-base and removed duplicate This issue or pull request already exists labels May 27, 2021
@diamonddevv
Copy link

this error isn't just to do with kotlin, im using java code and im getting the same exception

crash-2023-01-02_14.40.36-server.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants