Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [SOLVED][1.8.8]Can't start game
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
yyk419476391

[SOLVED][1.8.8]Can't start game

By yyk419476391, March 23, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

yyk419476391    0

yyk419476391

yyk419476391    0

  • Tree Puncher
  • yyk419476391
  • Members
  • 0
  • 16 posts
Posted March 23, 2018 (edited)

java.lang.NoSuchFieldError: id
i was use GuiButton.id to get button id when InitGuiEvent.Post triggerd.

code is tested in mdk's client,this error happend in a real client.

forge version is same

 

here's code

    @SubscribeEvent
    public void guiEdit(InitGuiEvent.Post e) {
    	int allowModNum = 4;
    	if (Loader.isModLoaded("OptiFine"))
    		allowModNum++;
    	if (Loader.isModLoaded("InputFix"))
    		allowModNum++;
    	if (Loader.instance().getActiveModList().size() > allowModNum) {
    		Minecraft.getMinecraft().shutdown();
    	}
    	if (e.gui instanceof GuiMainMenu) {
    		GuiScreen screen = e.gui;
    		for (Object o : e.buttonList) {
    			GuiButton btn = (GuiButton)o;
    			if (btn.id != 4&&btn.id != 0&&btn.id != 5) {
    				btn.visible = false;
    			} else if (btn.id == 4) {
    				btn.displayString = "离开昔日黄昏";
    			} else if (btn.id == 0) {
    				btn.displayString = "客户端设置...";
    			}
    		}
    		joinServer.yPosition = (int)(screen.height * 0.5);
    		joinServer.xPosition = (int)(screen.width * 0.5) - 100;
    		joinServer.width = 200;
    		e.buttonList.add(joinServer);
    	} else if (e.gui instanceof GuiIngameMenu) {
    		GuiScreen screen = e.gui;
    		for (Object o : e.buttonList) {
    			GuiButton btn = (GuiButton)o;
    			if (btn.id != 4&&btn.id != 0&&btn.id != 5&&btn.id != 6) {
    				btn.visible = false;
    			} else if (btn.id == 4) {
    				btn.displayString = "返回昔日黄昏";
    			} else if (btn.id == 0) {
    				btn.displayString = "客户端设置...";
    				btn.width = 200;
    			} else if (btn.id == 5) {
    				btn.displayString = "成就";
    			} else if (btn.id == 6) {
    				btn.displayString = "统计数据";
    			}
    			if (btn.id == 1) {
    				disconnect.xPosition = btn.xPosition;
    				disconnect.yPosition = btn.yPosition;
    				disconnect.width = btn.width;
    			}
    		}
    		e.buttonList.add(disconnect);
    	} else if (e.gui instanceof GuiConnecting) {
    		e.buttonList.clear();
    	}
    }

 

crash-2018-03-23_13.12.01-client.txt

Edited March 23, 2018 by yyk419476391
Question solved
  • Quote

Share this post


Link to post
Share on other sites

jabelar    591

jabelar

jabelar    591

  • Reality Controller
  • jabelar
  • Members
  • 591
  • 3266 posts
Posted March 23, 2018

How did you build your mod jar?

  • Quote

Share this post


Link to post
Share on other sites

yyk419476391    0

yyk419476391

yyk419476391    0

  • Tree Puncher
  • yyk419476391
  • Members
  • 0
  • 16 posts
Posted March 23, 2018
10 minutes ago, jabelar said:

How did you build your mod jar?

Use Export in eclipse

  • Quote

Share this post


Link to post
Share on other sites

yyk419476391    0

yyk419476391

yyk419476391    0

  • Tree Puncher
  • yyk419476391
  • Members
  • 0
  • 16 posts
Posted March 23, 2018

thanks to jabalar

i am try to use gradlew to build,and it can start

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • jgfarrell
      I'm having trouble with Java on !MAC!

      By jgfarrell · Posted 18 minutes ago

      Sorry Junior.   I thought I was going to be a hero!   Good luck.
    • diesieben07
      [1.14.4] [Solved] Trouble With Packets

      By diesieben07 · Posted 1 hour ago

      If you do this, then there is no point having the capability. Just store it in the stack's NBT tag directly at that point...
    • Cerandior
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior · Posted 1 hour ago

      Yeah, I registered the entity and everything is fine now.
    • Cerandior
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior · Posted 1 hour ago

      I have no idea man. I tried setting the breakpoints at different parts of the class because intelliJ displays a tree of all the methods called at that point and I never found any of the shareTags methods where I expected them to be. And I know, what I did doesn't really make too much sense because the stack should call the readShareTag and getShareTag automatically (I did look into a lot of methods related to itemstacks), but for some reason nothing was working as expected for me. I just tried that and everything works fine now, if I get rid of that line of code nothing works again.   As for the entity, that is probably caused by the "unique" type of zombie that my staff spawns. I forgot to register that in my registry events. I am surprised the entity was spawning considering I haven't registered them actually. I will register them right now, and check if the error will persist. Thank you for your help.
    • diesieben07
      on/off button for custom furnace

      By diesieben07 · Posted 1 hour ago

      Any GUI that has a button on it. MainMenuScreen for example.
  • Topics

    • Junior240
      4
      I'm having trouble with Java on !MAC!

      By Junior240
      Started November 9

    • Cerandior
      10
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior
      Started 23 hours ago

    • plugsmustard
      18
      on/off button for custom furnace

      By plugsmustard
      Started 23 hours ago

    • AkosM
      3
      Increase target's damage via usable item

      By AkosM
      Started 18 hours ago

    • leesj
      3
      How to Give potion effect to entity

      By leesj
      Started Yesterday at 03:01 PM

  • Who's Online (See full list)

    • diesieben07
    • Draco18s
    • Choco
    • desht
    • plugsmustard
    • Maraea21
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [SOLVED][1.8.8]Can't start game
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community