Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.9] Save Hashmap to NBT
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
LogicTechCorp

[1.9] Save Hashmap to NBT

By LogicTechCorp, April 20, 2016 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

LogicTechCorp    2

LogicTechCorp

LogicTechCorp    2

  • Diamond Finder
  • LogicTechCorp
  • Forge Modder
  • 2
  • 260 posts
Posted April 20, 2016

Is it possible to save a hashmap to NBT if so, what would be the best way to save a it to NBT?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55067 posts
Posted April 20, 2016

Depends. If the key in your Map is a String, just save it as an NBTTagCompound. If the keys are not Strings, save it as an NBTTagList where each element is an NBTTagCompound with two elements in it ("key" and "value") both encoding key and value respectively.

  • Quote

Share this post


Link to post
Share on other sites

Notunknown    7

Notunknown

Notunknown    7

  • Creeper Killer
  • Notunknown
  • Members
  • 7
  • 156 posts
Posted April 20, 2016

Depends. If the key in your Map is a String, just save it as an NBTTagCompound. If the keys are not Strings, save it as an NBTTagList where each element is an NBTTagCompound with two elements in it ("key" and "value") both encoding key and value respectively.

 

What is wrong with using an NBTTagCompound either way, and just converting the keys to strings in a way which can be reverted?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7594

diesieben07

diesieben07    7594

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7594
  • 55067 posts
Posted April 20, 2016

That would work, if that is possible within reason.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Do stuff right after login

      By diesieben07 · Posted 9 minutes ago

      PlayerLoggedInEvent
    • dotifo7120
      Do stuff right after login

      By dotifo7120 · Posted 25 minutes ago

      Is there an event called when a player enters into the world (fully logged)?
    • diesieben07
      Windows installer

      By diesieben07 · Posted 54 minutes ago

      Just use the installer, it is cross-platform.
    • T_Jam1
      Windows installer

      By T_Jam1 · Posted 57 minutes ago

      I need help!! I can't find the forge windows installer and every time I look something up it never helps, I'm mad, I'm confused, and I need help.
    • diesieben07
      Meine Inkompetenz kennt mal wieder keine Grenzen.(Forge 1.16.1)

      By diesieben07 · Posted 2 hours ago

      Threads merged. Please keep this forum in English.   Make sure your anti virus does not block the jar file. Also ensure you only download it from https://files.minecraftforge.net/.
  • Topics

    • dotifo7120
      1
      Do stuff right after login

      By dotifo7120
      Started 25 minutes ago

    • T_Jam1
      1
      Windows installer

      By T_Jam1
      Started 57 minutes ago

    • Mounty
      3
      Meine Inkompetenz kennt mal wieder keine Grenzen.(Forge 1.16.1)

      By Mounty
      Started 2 hours ago

    • Amperka_pro
      5
      Как применить нбт к предмету.

      By Amperka_pro
      Started 4 hours ago

    • MistyMarshes
      9
      [1.16.4] Get IChunk World / get current World for the overworld.

      By MistyMarshes
      Started 15 hours ago

  • Who's Online (See full list)

    • Lucie
    • Ugdhar
    • Maewolf04
    • MedHelm
    • Cyrus_Blaze
    • diesieben07
    • dotifo7120
    • ChampionAsh5357
    • Somonestolemyusername
    • Heliarco
    • Reflector_10
    • KillsBoostMyEgo
    • tf2_mandeokyi
    • Cutewarriorlover
    • DaiGamer117
    • glimmermaxcool
    • LexManos
    • Orbital_Gaming
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.9] Save Hashmap to NBT
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community