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

I have a strange problem where a capability that otherwise works perfectly well doesn't work after changing dimensions, such as going to the nether or back to overworld. I did some debugging and found where the error is but I don't understand why it exists.

 

  • When an entity is removed (such as when changing dimensions), it's invalidateCaps() method is called, so its valid field becomes false. This means when player.getCapability is called for whichever capability, it returns LazyOptional.empty():
  • public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable EnumFacing side)
    {
        final CapabilityDispatcher disp = getCapabilities();
        return !valid || disp == null ? LazyOptional.empty() : disp.getCapability(cap, side);
    }
  • Entity is also removed when it dies, but upon respawning the AttachCapabilitiesEvent is called again both on the client and the server threads, and the capability works fine.
  • However, when the entity changes dimensions, the AttachCapabilitiesEvent is only called on the client thread. I don't know if this has anything to do with the problem.

 

If anyone knows how to deal with this problem, I would appreciate the help.

There's an issue on this matter already. We're just waiting for someone to make a PR for it. It will probably take some time since it needs quite a bit of patches.

Edited by Terrails

  • Author

Damn, I spent a lot of time for no reason then. I should learn to check the github issues and not just count on google searches.

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.