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 want to store in my ItemStacks big size data. I used capabilities, so all this data serializes into JSON and stores at capNBT. For now capNBT for one stack may be between 100 and 10 000 characters. I think near 3 000 is middle value. I have a few ideas, how make capNBT more short, but doesn't know, should I spend time to it or not. So I have few related questions:
1. Does Forge have limit to capNBT size?
2. Does ItemsStaks from closed chest (in loaded chanck) stores at RAM? Even if user doesn't open it?
3. Maybe exist some another nuances related to big capNBT?

NBT is for serialization. Capabilities are runtime.

Don't serialize to JSON then store the result in NBT, just serialize to NBT.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
4 hours ago, loordgek said:

what are you trying to do from a end user perspective

I try to stores story of item craft ingredients. In my mode recipes are not strongly determined. So it is not possible to say "if this is X it was exacly created from Y and Z". So I have case when some item was created from 4 another item, and each of them was created from few another and e.t.c

 

4 hours ago, Draco18s said:

NBT is for serialization. Capabilities are runtime.

Don't serialize to JSON then store the result in NBT, just serialize to NBT.

I don't serialize capabilities manually. But at debug I see in ItemStack the field named "capNBT" (with JSON inside), and when I checked it size I started to worry

Edited by S-Spirit

32 minutes ago, S-Spirit said:

I don't serialize capabilities manually.

Well there's your problem.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

5 hours ago, S-Spirit said:

1. Does Forge have limit to capNBT size?

no but syncing nbt to the client does have a limit

 

5 hours ago, S-Spirit said:

Does ItemsStaks from closed chest (in loaded chanck) stores at RAM? Even if user doesn't open it?

yes

  • Author
10 minutes ago, Draco18s said:

Well there's your problem.

Sorry, I am confused a little. I implements writeNBT and readNBT methods for my capability. In this methods I construct nested CompoundNBT, ListNBT and e.t.c. Don't serializes all data to JSON and stores like NBT with 1 element. Is it right way?

 

1 minute ago, loordgek said:

no but syncing nbt to the client does have a limit

 

yes

Thanks. So I should remove this feature or implement it by more compact way.

17 minutes ago, S-Spirit said:

I implements writeNBT and readNBT methods for my capability. In this methods I construct nested CompoundNBT, ListNBT and e.t.c. Don't serializes all data to JSON and stores like NBT with 1 element. Is it right way?

If you're using nested CompoundNBT and ListNBT and all that, then what are you doing with JSON?

JSON is a serialization format.

NBT is a serialization format.

They are not the same thing even if they do the same job.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
27 minutes ago, Draco18s said:

If you're using nested CompoundNBT and ListNBT and all that, then what are you doing with JSON?

JSON is a serialization format.

NBT is a serialization format.

They are not the same thing even if they do the same job.

Oh, you are right! This string inside "capNBT" looks very similar to JSON and I thinked, NBT is system for wrapp and simplify JSON serialization. Thanks for clarification and sorry about that misunderstanding.

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.