Posted May 26, 20178 yr 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 Edited May 27, 20178 yr by salvestrom
May 26, 20178 yr 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?
May 26, 20178 yr 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...
May 27, 20178 yr 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.