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.

Featured Replies

Posted

Hello. I have a problem with my gui screen. It crash game from time to time(but mostly it works correctly) without any obvoiuse reasons, when it tries to call "super.renderBackground".

java.lang.NullPointerException: Cannot read field "level" because "this.minecraft" is null
	at net.minecraft.client.gui.screens.Screen.renderBackground(Screen.java:442) ~[forge-1.19.2-43.1.47_mapped_official_1.19.2-recomp.jar%23183!/:?] 

May be some one know why it happens?

 

My screen: https://github.com/NightKosh/Sophisticated-wolves/blob/feature/1.19.2_update/src/main/java/sophisticated_wolves/gui/WolfFoodConfigScreen.java

"debug" and "latest" logs https://gist.github.com/NightKosh/e73c29bb2ea336b1d6336f64d92ec384

Edited by Kosh

Line 522: java.lang.IllegalStateException: Rendersystem called from wrong thread

Screens are client side only, so make sure you're opening the screen from the client

 

Edited by MistaOmega

  • Author
10 minutes ago, MistaOmega said:

Line 522: java.lang.IllegalStateException: Rendersystem called from wrong thread

Screens are client side only, so make sure you're opening the screen from the client

 

So

Minecraft.getInstance().setScreen(....);

opens screen for both client and server side?

 

 

It looks like it solve my problem. Thank you!

Edited by Kosh

Yeah, I'd check to see what tick that you're referencing during this block:

 

else if (FoodUtils.isBone(stack)) {
                Minecraft.getInstance().setScreen(new WolfFoodConfigScreen(this));
                stack.shrink(1);
                return InteractionResult.SUCCESS;
            }

add a level.IsClientSide() check before setting that screen so that when the server side tick passes through that function, it is ignored

  • Kosh changed the title to [1.19.2, SOLVED] Intermittent NPE at screen renderring

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.