Jump to content

Crash when i try to make custom GUI [1.8]


Warix

Recommended Posts

Hello, i'm trying to make custom gui but i always get crash in when i start minecraft here is some more info:

crash:

 

 

[18:03:13] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue

[18:03:13] [Client thread/ERROR] [FML]:

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

UC FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.3.1450.jar)

UC Forge{11.14.3.1450} [Minecraft Forge] (forgeSrc-1.8-11.14.3.1450.jar)

UE agkm{1.0} [mymod2 Ga Kill Mod (AGK MOD)] (bin)

[18:03:13] [Client thread/ERROR] [FML]: The following problems were captured during this phase

[18:03:13] [Client thread/ERROR] [FML]: Caught exception from agkm

java.lang.IllegalArgumentException: Can not set static ga.warixmods.mymodmod.inventory.GuiWand field ga.warixmods.mymodmod.mymod.instance to ga.warixmods.mymodmod.mymod

at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[?:1.8.0_45]

at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[?:1.8.0_45]

at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) ~[?:1.8.0_45]

at java.lang.reflect.Field.set(Unknown Source) ~[?:1.8.0_45]

at net.minecraftforge.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:431) ~[forgeSrc-1.8-11.14.3.1450.jar:?]

at net.minecraftforge.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:362) ~[forgeSrc-1.8-11.14.3.1450.jar:?]

at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:518) ~[forgeSrc-1.8-11.14.3.1450.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forgeSrc-1.8-11.14.3.1450.jar:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forgeSrc-1.8-11.14.3.1450.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]

at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:507) [Loader.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:213) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

[18:03:13] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:mymod2 Ga Kill Mod (AGK MOD)

[18:03:13] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: ---- Minecraft Crash Report ----

// This doesn't make any sense!

 

Time: 7/12/15 6:03 PM

Description: Initializing game

 

java.lang.IllegalArgumentException: Can not set static ga.warixmods.mymodmod.inventory.GuiWand field ga.warixmods.mymodmod.mymod.instance to ga.warixmods.mymodmod.mymod

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 net.minecraftforge.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:431)

at net.minecraftforge.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:362)

at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:518)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:507)

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:213)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:446)

at net.minecraft.client.Minecraft.run(Minecraft.java:356)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

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 net.minecraftforge.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:431)

at net.minecraftforge.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:362)

at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:518)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:507)

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:213)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:446)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:356)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_45, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 901164680 bytes (859 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1450 4 mods loaded, 4 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

UC FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.3.1450.jar)

UC Forge{11.14.3.1450} [Minecraft Forge] (forgeSrc-1.8-11.14.3.1450.jar)

UE agkm{1.0} [mymod2 Ga Kill Mod (AGK MOD)] (bin)

Loaded coremods (and transformers):

GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.4.13283 Compatibility Profile Context 14.501.1003.0' Renderer: 'ASUS R7 250X Series'

Launched Version: 1.8

LWJGL: 2.9.1

OpenGL: ASUS R7 250X Series GL version 4.4.13283 Compatibility Profile Context 14.501.1003.0, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

 

Using VBOs: No

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

 

 

main file code:

 

package ga.warixmods.mymodmod;

import net.minecraftforge.fml.common.network.NetworkRegistry;

import java.lang.reflect.Field;

import java.lang.reflect.Modifier;

 

import ga.warixmods.mymodmod.init.mymod2Blocks;

import ga.warixmods.mymodmod.init.mymod2Items;

import ga.warixmods.mymodmod.inventory.GuiWand;

import ga.warixmods.mymodmod.potion.PotionMurasame;

import ga.warixmods.mymodmod.proxy.CommonProxy;

import net.minecraft.potion.Potion;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.Mod.EventHandler;

import net.minecraftforge.fml.common.Mod.Instance;

import net.minecraftforge.fml.common.SidedProxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version=Reference.VERSION)

 

public class mymod {

 

 

    @Instance (value = Reference.MOD_ID)

    public static GuiWand instance;

   

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)

public static CommonProxy proxy;

public static final mymod2Tab tabmymod2= new mymod2Tab("tabmymod2");

 

@EventHandler

public void preInit(FMLPreInitializationEvent event) {

 

mymod2Items.init();

mymod2Items.register();

 

mymod2Blocks.init();

mymod2Blocks.register();

 

}

 

@EventHandler

public void init(FMLInitializationEvent event) {

        NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event) {

 

}

}

 

 

gui file code:

 

package ga.warixmods.mymodmod.inventory;

 

import ga.warixmods.mymodmod.init.mymod2Items;

import net.minecraft.client.gui.GuiButton;

import net.minecraft.client.gui.GuiLabel;

import net.minecraft.client.gui.GuiScreen;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.entity.player.InventoryPlayer;

import net.minecraft.init.Blocks;

import net.minecraft.inventory.Container;

import net.minecraft.inventory.ContainerRepair;

import net.minecraft.util.BlockPos;

import net.minecraft.util.ChatComponentTranslation;

import net.minecraft.util.IChatComponent;

import net.minecraft.world.IInteractionObject;

import net.minecraft.world.World;

 

public class GuiWand extends GuiScreen{

public static final int GUI_ID = 20;

public GuiWand () {}

@Override

    public void drawScreen(int mouseX, int mouseY, float partialTicks)

    {

        this.drawDefaultBackground();

    }

 

 

 

 

 

 

 

 

}

 

 

and IGuiHandler code (Used it in common proxy) :

 

package ga.warixmods.mymodmod.proxy;

 

import ga.warixmods.mymodmod.inventory.GuiWand;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.world.World;

import net.minecraftforge.fml.common.network.IGuiHandler;

 

public class CommonProxy implements IGuiHandler {

    @Override

    public Object getClientGuiElement ( int ID, EntityPlayer player, World world, int x, int y, int z ) {

    if ( ID == GuiWand.GUI_ID )

            return new GuiWand();

    else

            return null;

    }

 

public void registerRenders()

{

 

}

 

@Override

public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

 

return null;

 

}

}

 

I'm new to modding and this is my first mod ever so its probably something very simple.

:D
Link to comment
Share on other sites

Also here is code that calls gui :

public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)

{

if(playerIn.isSneaking())

{

 

playerIn.openGui(mymod.instance, GuiWand.GUI_ID, worldIn, 0, 0, 0);

 

}

    return false;

}

 

 

:D
Link to comment
Share on other sites

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.