Jump to content

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


salvestrom

Recommended Posts

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

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.