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.

Atijaf

Members
  • Joined

  • Last visited

Everything posted by Atijaf

  1. 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.
  2. 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.
  3. alright. I'll give that a go. Would I call that method in the writeToNBT method?
  4. 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
  5. 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
  6. Will do:p You tell me. haha! I haven't used Pastebin before. Is this how I share it? http://pastebin.com/u/Atijaf
  7. 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.
  8. 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!
  9. What is the purpose of having a nextQuestId and fracturerUsed?
  10. 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.
  11. I've got the read and write methods working. Where do I call them though? In a event handler when the world loads?
  12. Would it be possible to save custom classes? It would be easier in the long run and I would also learn something.
  13. 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
  14. Thanks:)
  15. What do you mean by returning proper values? I will have different x y and z values. Hundreds actually.
  16. 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.
  17. 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:)
  18. Turns out that it will force a chunk to load if it's going to place a block down:)
  19. 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
  20. ..... ugh... It's spawning the block in the nether. Anyone know the cause of this?
  21. 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.
  22. 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.
  23. I'm standing 2 blocks away from the location. Would you know if there'd be a way to force load it? Thanks:)
  24. 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
  25. 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.

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.