Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(solved)[1.11.2] Server crash: Attempted to load class net/minecraft/client/gui/GuiScreen for invalid side SERV

Featured Replies

Posted

I've been sent a crash report for my mod where it fails to load on  server. the title is part of the crash file. it's also reporting failing to find class definitions etc.

 

The chain of classes ends with my JungleItems class when it calls bookScale, which is for my prewritten books. It offers no details about where in the class the failure occurs, however, it must be the below method:

 

    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
    {
        ItemStack itemstack = playerIn.getHeldItem(handIn);

        if (!worldIn.isRemote)
        {
            this.resolveContents(itemstack, playerIn);
        }
        
        Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(playerIn, itemstack, false));
        	
        //playerIn.openBook(itemstack, handIn);
        playerIn.addStat(StatList.getObjectUseStats(this));
        return new ActionResult(EnumActionResult.SUCCESS, itemstack);
    }

 

specifically, the line starting Minecraft.getMinecraft(). Blank it and the server will start. I've already tried a few alternatives, including mimicking the code in the blanked out openBook method. I haven't tried using @SideOnly yet.

 

Edit: using @Side seems to work, but i've read that i shouldn't resort to it, and have concerns something will be lurking in the wings :P

Edited by salvestrom

  • Author
30 minutes ago, diesieben07 said:

You need to encapsulate the call through your @SidedProxy.

Okay. little bit of a guess here, but are you saying i need to make a call in this method to my client proxy where the call to open the gui will actually be made?

  • Author
1 hour ago, diesieben07 said:

No, you need to make a call to a method that is defined in your proxy interface. That method is than implemented in your server and client proxy, where the client proxy actually does the client-only code.

Okay. what ive done so far is:

        w2theJungle.instance.openJungleBook(playerIn, itemstack, false);

is now in the OP method.

the method being called is blank, as is the one in ProxyCommon. The ProxyClient version contains the original Minecraft.getMin... etc, line.

server doesn't crash, but the book can't be opened. what am i doing wrong? aside from everything...
 

  • Author

hey, thanks for the help. i realised after posting that i probably needed to actualy call the common proxy from the main mod class. its working now.

 

/hug

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.