Jump to content

Recommended Posts

Posted

The title pretty much says it all.

 

I have made a class that extends WorldSavedData but i don't know how register it.

Googled a bit about how to save and load custom data on a world and found out that i should use that class.

 

How do i register or "activate" the class i have made?

 

MyWorldSavedData class

 

  Reveal hidden contents

 

 

Regards DND

 

EDIT:

With the TickHandlar im able to load the data with WORLDLOAD... but the class that extends WorldSavedData don't run the write and read functions.... for NTB. :/

Posted

Thanks for the help!

 

For ppl that are having problems with WorldSaveData as i did: Here is the code i used:

 

To the @Init i just added ... to the end:

TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER);

 

TickHandler.java

 

  Reveal hidden contents

 

 

MyWorldSavedData.java

 

  Reveal hidden contents

 

 

 

  • 1 year later...
Posted

Should anybody look for it (to make a tutorial or something), in 1.8 there is no more :

MapStorage storage = world.perWorldStorage;

there is instead :

MapStorage storage = world.getPerWorldStorage();

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.