Jump to content

acbart

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by acbart

  1. Interesting! That's still quite a bit of memory for a String to hold (roughly 16k integers, ignoring the need for any separators). Thank you so much for your help!
  2. Thank you both so much! This is extremely helpful. It sounds like most of what I want needs to be managed through the DataWatcher and/or custom packets. Something that's a little strange to me - the DataWatcher can watch Byte, Short, Integer, Float, String, ItemStack and ChunkCoordinates, according to the wiki (http://www.minecraftforge.net/wiki/Datawatcher). Is there a character limit on Strings? The difference between an Integer and a String in terms of data tored is pretty massive - Integers and Floats are 4 bytes, but a String is able to have Integer.MAX_VALUE (2^31) bytes - it is a glorified array of char after all. Not to endorse a Stringly-typed data structure, but couldn't I avoid managing packets by simply packaging my data into a single String? Or perhaps some related clusters of data into a few Strings? Managing manipulation and storage of that String might be as big a hassle as actually learning how to send my own packets, and is ultimately less flexible, but it's just strange to me that any sized Strings could be sent alongside considerably smaller data formats when there's an upper bound on how many things the DataWatcher can manage.
  3. I've read through several tutorials, and I've gone through multiple forum posts, and at this point I'm a little confused. I have a new custom mob (extending EntityAnimal) that needs to have a bunch of new properties - we'll say "gender" (Enum) and "domestication"(int) for simplicity's sake. These properties are given values based on a random distribution when the entity first appears in the world, but afterwards need to be consistent across the life of the entity. What is the best way to store these properties so that they are synchronized between the client/server and are not reset when I reload the world from a save? More generally, I would really just like to understand how the following programming elements work with each other. * New instance attributes set in the Constructor - as in, just regular class attributes * DataWatcher * Entity.writeEntityToNBT/Entity.readEntityFromNBT * Entity.applyEntityAttributes * Entity.extendedProperties * Entity.entityInit * IAttribute I'm a PhD student in Computer Science, so please don't be afraid to dive into the technical side of things! Even if you can just point to an up-to-date, authoritative blog post that can really describe all the differences, that would be useful.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.