Jump to content

Recommended Posts

Posted

Hey guys.

 

I've been trying to make a mod that allows for a player to be in creative mode within a given area. To do that, I need to set up "borders". This works perfectly fine when hardcoding in the area, but that's not very server-owner-friendly. So I wanted to make a config file they can access, and through that, set the given coordinates.

 

However, I get this error when trying to load Minecraft with my current code. (classes posted below error)

 

Error:

 

  Reveal hidden contents

 

 

Main class

 

  Reveal hidden contents

 

 

ConfigurationClass:

 

  Reveal hidden contents

 

 

GuiFactory

 

  Reveal hidden contents

 

 

GuiConfig

 

  Reveal hidden contents

 

 

I've been searching a bit around, and can't seem to find a fix. Any help would be greatly appreciated

 

Thanks!

Posted
  Quote
java.lang.IllegalArgumentException: Can not set static net.minecraftforge.common.config.Configuration field com.troelsen.buildingarea.BuildingArea.config to com.troelsen.buildingarea.BuildingArea

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:427)

at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:358)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:513)

 

  Quote
@Mod(modid = BuildingArea.MODID, version = BuildingArea.VERSION)

public class BuildingArea

{

 

  ...

   

    @Mod.Instance(MODID)

   

    public static Configuration config;

   

    public static BuildingArea instance;

 

...

 

You've annotated the

config

field with

@Mod.Instance

, so FML tries to set it to your mod's instance. This throws an exception because the field and value are of incompatible types (

Configuration

is unrelated to

BuildingArea

).

 

Move the annotation to the

instance

field.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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



×
×
  • Create New...

Important Information

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