#Having issues setting data to hashmap

10 messages · Page 1 of 1 (latest)

coarse pebble
#

I was able to set the some arbitrary data directy into the HashMap but im trying to set some data to it form another class but cant seem to get it to work and im not sure why it isnt working correctly here is what i have so far ill include everything just incase it might also be contributing to it not working.

#

The class that sets the data to the HashMap to be saved to persistent state

#

Where im saving the data to NbtCompounds and to the server with persistent states, as shown the hashmap put() i used does work and retuns properly. But the other data form the ChunkLoadListener class doesnt.

#

not really relevent i think but the command im using ingame to retrieve the data from the persistent state

loud moat
#

probably not the best channel for this. #mod-dev-1 and #mod-dev-2 are probably better places

it isnt working correctly

too vague to even start to troubleshoot without reimplementing your code in my own example project, which i dont really feel like doing

#

I would also suggest avoiding naming your variables the name shared by javascript types

coarse pebble
#

are oyu refering to the String and Integer in the Hashmap?

loud moat
#

in the lambda you feed into a foreach in writeNbt

#

I also wouldnt suggest setting the state to dirty every time you read it