Everything posted by Atijaf
-
saving custom classes in nbt?
I apologize! Haha. How long should I allow it to sit until it saves? I used markDirty and waited about 5 minutes to see if it had changed, but it was still markedDirty when I checked it.
-
saving custom classes in nbt?
I've messed with the code a little bit and created a method called saveData. I call this method after I add data to nbt. I run that bit of code, save and quit, reload, and data is null again. The only thing that I can think of that would be wrong is the retrieval of the information.. Or maybe even saving it. Is there anything wrong with this bit of code. I am coding in 1.8, if that makes a difference.
-
saving custom classes in nbt?
alright. I'll give that a go. Would I call that method in the writeToNBT method?
-
saving custom classes in nbt?
There was one more class that I forgot to include in pastebin. Also, every time i start minecraft and debug. It goes through the method, WorldData get(World world), and data is null so it creates a new one. Is that suppose to happen? I also never call the method, setDirty(); I went ahead and changed the static variable to a private class variable. No change... I'll leave it a private class variable though Here's my SyncWorldData class http://pastebin.com/dgNBV6G2
-
saving custom classes in nbt?
Event handler for WorldData http://pastebin.com/3GQee1TY PacketDispatcher. http://pastebin.com/mYgCMeVH WorldData Class http://pastebin.com/RU0fXDcK Tuple Class http://pastebin.com/Xw2H5iNU
-
saving custom classes in nbt?
Will do:p You tell me. haha! I haven't used Pastebin before. Is this how I share it? http://pastebin.com/u/Atijaf
-
saving custom classes in nbt?
When I use my command to add new information, it runs through the write method and adds the data I want it to inside of the nbt and It also works correctly while reading the information. But, when I restart the game, it doesn't find anything there. My only guess would be that the world Data information I am using is different every time I load the game. Here is some code. Event Handler PacketDispatcher / sendTo methods SnycWorldData Class I know that this is a lot of information. I don't expect you, nor anyone, to read all of it. I am just curious if you can spot any errors. The packetDispatcher should be just fine, as I have used it to store information with players.
-
saving custom classes in nbt?
Alright I think I'm getting somewhere. I've noticed that you didn't use the methods nbt.setTag or nbt.getTag inside readFromNBT and writeToNBT. I also see that you are using a method inside QuestologyWorldData get(World world), called world.setItemData(IDENTIFIER, data) Why not use nbt.setTag/getTag and what is "world.setItemData" Also, is markDirty() saving the information? Thank you! Sorry for the load of questions!
-
saving custom classes in nbt?
What is the purpose of having a nextQuestId and fracturerUsed?
-
saving custom classes in nbt?
I have a list of blocks and block locations that are suppose to regenerate in specific areas. I have a command that I can use to add them to a list and once I save and quit, I would like to store this information so that it may be used the next time I load into the world.
-
saving custom classes in nbt?
I've got the read and write methods working. Where do I call them though? In a event handler when the world loads?
-
saving custom classes in nbt?
Would it be possible to save custom classes? It would be easier in the long run and I would also learn something.
-
saving custom classes in nbt?
I have a class that contains BlockPos, IBlockState, and world Id. Is there a way to save this type of data in a NBTTagCompound? className is named myBlockPos
- Help with hashMaps
-
Help with hashMaps
What do you mean by returning proper values? I will have different x y and z values. Hundreds actually.
-
Help with hashMaps
This does work. However, I acquire the blockPos position in the event. In my main code, I declare the locations that I want to have as either a true or false output.
-
Help with hashMaps
I have a hashMap that uses BlockPos as a key. CODE However, I would like to use the "get(object) function to obtain the Boolean that is inside, within my event handler... The only way I know how to obtain a BlockPos is like so.. When using new, BlockPos is now consider an entirely new object and inside my hashMap, it doesn't exist. Example: Does anyone know any work arounds or even a better way to implement this? Thanks:)
-
Placing a block?
Turns out that it will force a chunk to load if it's going to place a block down:)
-
Placing a block?
Well, I changed a little bit of code, but nothing much. Improved the way information is stored, and now it works. Still am unsure as to why the blocks were respawning in the nether and I wish I knew why. Thanks for the help
-
Placing a block?
..... ugh... It's spawning the block in the nether. Anyone know the cause of this?
-
Placing a block?
Alright, after further debugging... The client side seems to not update, so what I am seeing is not what the server is seeing. The server apparently already placed the block. It returns false if the block it is going to place down is the same block that is already there... or rather, null. I suppose I'm stuck at trying to figure out why the client side is not updating.
-
Placing a block?
After further debugging, I found this bit of code. iblockstate1 is null. blockSnapshot is not null.\ it returns false. The code that defines iblockstate1 as for capitalizing blocks. Yes. Just a typo on this end. I didn't copy and paste.
-
Placing a block?
I'm standing 2 blocks away from the location. Would you know if there'd be a way to force load it? Thanks:)
-
Placing a block?
I am trying to understand why this event is not working. Event The code looks silly and without purpose, but this is a small example of what my code looks like. When it gets to event.world.setBlockState... It returns false, and doesn't place the block. I also get the message when it comes time to place the block, [18:01:19] [server thread/INFO] [FML]: Unloading dimension 1
-
Forge Event that happens every tick?
Which forge event is called every tick? I'm looking for an event that will be called and on every 100 ticks, and be able to place a block at a location.
IPS spam blocked by CleanTalk.