Jump to content

[Solved] Working with two mods at the same time. @Instance


Recommended Posts

Posted

I have completed the initial goal of my Tagger Rails mod and while waiting for a friend to test it and give feedback I started working on my 2nd mod.

I have just created the basic setup for creating a forge mod and try to run the client to confirm that the mod is working when it crashes with the following two errors:

 

cpw.mods.fml.common.LoaderException: java.lang.IllegalArgumentException: Can not set static com.mazetar.aimod.common.Aimod field com.mazetar.aimod.common.Aimod.aimodInstance to com.mazetar.taggerrails.common.TaggerRails
at cpw.mods.fml.common.LoadController.transition(LoadController.java:102)

And error two:

java.lang.IllegalArgumentException: Can not set static com.mazetar.taggerrails.common.TaggerRails field com.mazetar.taggerrails.common.TaggerRails.instance to com.mazetar.aimod.common.Aimod
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:331)

 

So it seems to me that the @Instance annotation does for each mod is conflicting with each other?

 

TaggerRails.Java - summary of content:

package com.mazetar.taggerrails.common;
// Some imports
@Mod(modid = "MazTaggerRails", name = "TaggerRails", version = "0.0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = true,
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"TaggerRailsChan"}, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec = @SidedPacketHandler(channels = {"TaggerRailsChan"}, packetHandler = ServerPacketHandler.class))
public class TaggerRails 
{
        @SidedProxy(clientSide = "com.mazetar.taggerrails.client.ClientProxy", serverSide = "com.mazetar.taggerrails.common.CommonProxy")
public static CommonProxy proxy;

@Instance
public static TaggerRails instance;

//Later inn the code
@Init
public void load(FMLInitializationEvent evt)
{
       NetworkRegistry.instance().registerGuiHandler(instance, proxy);

 

This mod was working fine on its own.

Then I added my new project into its own package, named "com.mazetar.aimod".

With its own package handlers, Proxy files and its own mod file.

 

Aimod.java - summary of contents.

package com.mazetar.aimod.common;
// lots of imports
@Mod(modid = "MazAiMod", name = "MazetarianAiMod", version = "0.0.2")
@NetworkMod(clientSideRequired = true, serverSideRequired = true,
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"MazAiChan"}, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec = @SidedPacketHandler(channels = {"MazAiChan"}, packetHandler = ServerPacketHandler.class))
public class Aimod 
{
     @SidedProxy(clientSide = "com.mazetar.aimod.client.ClientProxy", serverSide = "com.mazetar.aimod.common.CommonProxy")
     public static CommonProxy proxy;

    @Instance
    public static Aimod aimodInstance;

    @PreInit
    public void preInit(FMLPreInitializationEvent event)
    {	
    }
    
    @Init
    public void load(FMLInitializationEvent evt)
    {
	NetworkRegistry.instance().registerGuiHandler(aimodInstance, proxy);
    }

 

I tried renaming the Aimod instance to aimodInstance incase the name of the variable itself would have something to say, it didn't change anything.

Been trying to find places where I reffere to Aimod instead of TaggerRails and vica verca without finding any.

Does anyone have a clue for how to solve this?

 

 

If you guys dont get it.. then well ya.. try harder...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • la verdad nose que hago
    • Ok i check and this is real axioM, BUT i have seen strange thing when mods less then 100 is working great but when its more then 100, i got crash   i realy need this mod can i some how fix it? or only delete axiom
    • It is an issue with the mod Axiom
    • I am in 1.20.1, and I have about 50 mods, I'd say. But for some reason, the search bar broke at some point. It's a real pain to search for a certain object.. Mods that I have(I had to write ALL OF THESE OUT arhg): Epic Knights. AI-Improvements, Alexscaves, alexsmobs, AmbientSounds, Aquamirae, Architectury, Betterfpsdist, BiomesOPlenty, Bookshelf, Born In Chaos, Bountiful Critters, CarbonConfig, Citadel, Cloth config, Clumps, Corgilib, Creative Core, Creeperoverhaul, crittersandcompanions, CullLessLeaves, Cupboard, Duckling, Embeddium, Enchantment Descriptions, Enderman Overhaul, Entity Model Features, Entity Texture Features, Entity Culling, Exotic Birds, Extra Sounds, Falling Leaves, Farmers Delight, Fast Leaf Decay, Fastload, Ferritecore, FpsReducer2, Framework Forge, Gamma Creatures Mod, Geckolib, Geophilic, Ghosts, Goblin Traders, Gpumemleakfix, Guardvillagers, Ichunutil, ImmediatelyFast Forge, Immersive Paintings, Incendium, Konkrete Forge, Let Sleeping Dogs Lie, Make Bubbles Pop, MCW Bridges, MCW doors, MCW Fences, MCW lights, MCW paths, MCW trapdoors, Medieval Paintings, More Creative Tabs Combo, Nether's Overhaul, Nyfss Spiders Forge, Obscure Api, oculus MC, Oh The Biomes We've Gone, Oh The Trees You'll Grow, Physics Mod, Prehistoric Park, Quark Delight, Quark, Rainbow Reef, Refurbished Furniture Forge, Regrowth, Repurposed Structures, Resourcefulconfig, Ribbits, Rubidium, Saturn mc, Skin Layers 3d Forge, Smoothchunk, Starlight, Structory, TerraBlender, Terralith, Visuality, Water Erosion, Xaeros Minimap, Xaeros World Map, YungsApi, YungsBetter Desert Temples, Yungs Better Dungeons, Yungs Jungle Templates, Yungs Better Mineshafts, Yungs Better Nether Fortresses, Yungs Better Strongholds, Yungs Better Witch Huts, Yungs Bridges, Yungs Extras, Zeta.   Why isn't my search bar working!!!!😭
    • Ок so now i got this: The game crashed whilst initializing game Error: java.util.MissingResourceException: Missing font: inter-medium.ttf i have lates drivers on my geforce 2080 super so this is not drivers 100% maybe this is because i have old videocard? here crash report https://paste.ee/p/bqh1P
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.