AkashiiKun / MoreAxolotlVariantsAPI-Common

Axolotl Variants Extender API!
Other
3 stars 4 forks source link

Crash when trying to add Variants #5

Closed A5ho9999 closed 1 year ago

A5ho9999 commented 1 year ago

Game crashes when trying to add a Variant (Fabric 1.20.1), not too sure what do here.


[16:15:22] [main/ERROR] (FabricLoader) Minecraft has crashed!
net.fabricmc.loader.impl.FormattedException: java.lang.IllegalAccessError: Update to non-static final field net.minecraft.item.EntityBucketItem.entityType attempted from a different method (handler$zen000$mavapi$onInit) than the initializer method <init> 
    at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) ~[fabric-loader-0.14.21.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.14.21.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.21.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.21.jar:?]
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) ~[dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.IllegalAccessError: Update to non-static final field net.minecraft.item.EntityBucketItem.entityType attempted from a different method (handler$zen000$mavapi$onInit) than the initializer method <init> 
    at net.minecraft.item.EntityBucketItem.handler$zen000$mavapi$onInit(EntityBucketItem.java:566) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.item.EntityBucketItem.<init>(EntityBucketItem.java:45) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.item.Items.<clinit>(Items.java:1381) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.LightBlock.getOutlineShape(LightBlock.java:63) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.AbstractBlock$AbstractBlockState.getOutlineShape(AbstractBlock.java:1106) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.AbstractBlock$AbstractBlockState.getOutlineShape(AbstractBlock.java:1106) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.AbstractBlock.getCollisionShape(AbstractBlock.java:850) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.AbstractBlock$AbstractBlockState$ShapeCache.<init>(AbstractBlock.java:1106) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.AbstractBlock$AbstractBlockState.initShapeCache(AbstractBlock.java:1106) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.Blocks.<clinit>(Blocks.java:1410) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.block.FireBlock.registerDefaultFlammables(FireBlock.java:286) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.Bootstrap.initialize(Bootstrap.java:53) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:159) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.3-v2.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.21.jar:?]
    ... 3 more
AkashiiKun commented 1 year ago

Do you have a github repository with the source code of your mod? The error you're mentioning doesn't say anything to debug.

A5ho9999 commented 1 year ago

the mod is currently unreleased. Here is the current code related to the Axolotl's

https://gist.github.com/A5ho9999/28acf3c4202117882096c2d589f09dca

AkashiiKun commented 1 year ago

Where is LoadVariants() called? It should be called in the mod's onInitialize (fabric) or the main mod class if forge.

A5ho9999 commented 1 year ago

It is called within the onInitialize. The original call is ModEntities.registerModEntities(); which leads to CottageAxolotls.LoadVariants();

AkashiiKun commented 1 year ago

Well, i'm sending you a working template mod so you can see how to do it correctly. Axolotl Example Mod Template.zip Hope you can figure out why is not working, as we cannot access to the source code we can't tell if you're using the right api version or if the project is broken somehow.

A5ho9999 commented 1 year ago

I've looked over the template and there is only really one difference I was able to find

ModdedAxolotlVariant.Builder builder = ModdedAxolotlVariant.register(new ResourceLocation(AxolotlExampleMod.MOD_ID, variant.getName()));

ResourceLocation doesn't seem to exist, here are the versioning

minecraft_version=1.20.1
yarn_mappings=1.20.1+build.9
loader_version=0.14.21
# https://modrinth.com/mod/mavapi/versions
mavapi_version=1.1.1-mc1.20
plugins {
    id 'fabric-loom' version '1.3-SNAPSHOT'
    id 'maven-publish'
}
AkashiiKun commented 1 year ago

it doesn't "exists" because you're using yarn mappings instead of mojmaps (mojang mappings)

AkashiiKun commented 1 year ago

https://linkie.shedaniel.dev/mappings?namespace=yarn&version=1.20.1&search=Identifier&translateAs=mojang

AkashiiKun commented 1 year ago

I can't reproduce the crash you're having, therefore i'd suggest you using the template as a base for your mod, and switch to mojang mappings as it's the official Minecraft mappings. If there are further issues, you could upload the project's source code but make the repository private (it's free!) and give access to us (KxmischesDomi and I) so we can provide a better resolution of the issue.

A5ho9999 commented 1 year ago

Yes I realised that the mappings didn't match so am currently in the process of switching everything over, but will take awhile before I am able to check again. Hopefully changing that will be enough. Thank you

AkashiiKun commented 1 year ago

there's a gradle command for migrate mappings https://fabricmc.net/wiki/tutorial:migratemappings to switch to mojang mappings you only have to run this command gradlew migrateMappings --mappings net.minecraft:mappings:1.20.1

it will put the remapped files into a folder called "remappedSrc"

AkashiiKun commented 1 year ago

Closing issue.