Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

grand_mind1

Members
  • Content Count

    122
  • Joined

  • Last visited

Community Reputation

3 Neutral

About grand_mind1

  • Rank
    Creeper Killer

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!
  1. Seems I should start reading things in general. Completely blind me missed that. Thanks for the advice!
  2. I'm trying to understand the NBT spec as described here: http://wiki.vg/NBT http://web.archive.org/web/20110723210920/http://www.minecraft.net/docs/NBT.txt http://minecraft.gamepedia.com/NBT_format However, I'm having some problems with it. I've decided to use the "Hello World" example in the first link. According to NBTExplorer, it looks like this: http://i.imgur.com/tGBXrbd.png I'm printing out the bytes to get a better idea of how it's actually stored. It contained the following bytes: 10 0 11 104 101 108 108 111 32 119 111 114 108 100 8 0 4 110 97 109 101 0 9 66 97 110 9
  3. I'm updating my mod from 1.7.10 to 1.8.9 and noticed that there is no longer a ForgeDirection enum. What should I use instead?
  4. You really don't understand. I am using one NBTTagCompound. Let's say I write some tank data to it while the tank has some water in it. This works fine and can be read later. Now, I remove the water and save. Because the fluid was null, the "empty" tag was added to the compound. If I add water again and write, it will still be read as empty because the tag was not removed on write.
  5. It will never be read because the "Empty" tag is present. It doesn't matter what other data is there, if the "Empty" tag is present, the fluid is set to null. The "Empty" tag is created in writeToNBT() of FluidTank if there is no fluid. Meaning that if I ever save the tank while it is empty, it will never be read from properly again. This is because the "Empty" tag is not removed if I write with fluid present.
  6. I think you're misunderstanding. That code is entirely relevant, it's the two methods this post is about in the first place. You're claiming that they function in a way they do not. Yes, the fluidstack the tank creates will be null, because the "empty" tag is present. You are correct in saying that the data saved to the compound in writeToNBT() will not be null, however that is irrelevant as it will never be read.
  7. I don't think that's true. public FluidTank readFromNBT(NBTTagCompound nbt) { if (!nbt.hasKey("Empty")) { FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt); setFluid(fluid); } else { setFluid(null); } return this; } public NBTTagCompound writeToNBT(NBTTagCompound nbt) { if (fluid != null) { fluid.writeToNBT(nbt); } else { nbt.setString("Empty", ""); } return nbt; }
  8. I ran into some trouble when using the NBT read/write methods of FluidTank. The writeToNBT() method creates a string tag with the key "Empty" if the fluid being saved is null. However, this tag is never removed if the same compound is written to with fluid present. This means that the first time the tank saves while empty, it will never be able to be read from properly again, because the readFromNBT() method simply sets the fluid to null if the "Empty" tag is present. I understand that I can solve this problem by creating a new tag every time I write and save all of my other data to it as well
  9. I want to check if a block at a given position in the world is a full (source) block of fluid or if it is flowing. I thought I could simply check if the block is Blocks.flowing_water or Blocks.flowing_lava, but I must be misunderstanding something because every water block on screen in this screenshot is reported as BlockStaticLiquid rather than BlockDynamicLiquid. As a side question, would it be any different for forge fluid blocks compared to vanilla liquids? Edit: I'm an idiot and didn't include the screenshot http://i.imgur.com/fgDIjVG.png
  10. Is there a way I can get the flowing version of any fluid block? I want to use any placeable forge fluid, so I can't hard code flowing_water.
  11. I'm trying to force a water block to update after being placed so that it flows. I've tried world#scheduleBlockUpdate() however that did not work. How can I force the water to flow?
  12. Look at the way vanilla TNT is handled.
  13. 1.7.10 really isn't that much "easier" to mod for than 1.8 is. It's just different and some people didn't like some of the changes in 1.8 and stayed on 1.7.10. Good on you for actually trying to learn rather than copying a pasting, however it is extremely helpful to be a bit more familiar with java before trying to create a mod. That said, there are plenty of tutorials online that do a great job explaining what you want. A quick google search for forge events or proxies should be enough to get the basics down. You can also get some examples and see how other people are doing things by looking
  14. You can use the onBlockActivated method in Block to do something when the block is right clicked.
  15. The problem with using two different events is I don't think there is any way you can link the two events to make sure that the block they broke is the block they pick up. I'm pretty sure you can get what block is about to be broken in the BlockBreak event.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.