What exactly is serializable?

Discussion in 'Plugin Development' started by Orcem12, Jun 21, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Orcem12

    I've been so curious to know. Please list/provide a small list of what is and what isn't.
    - Thanks!

    I'm asking this because I've tried sooo many times to externally save my Hashmaps/Arrayslists with common procedures but always get the the nonserializable error. Always.
     
  2. Offline

    r0306

    Orcem12
    I know that ItemStacks are serializable.
     
  3. Offline

    Orcem12

    Yes but are blocks?
     
  4. Offline

    r0306

    Orcem12
    No they are not. If the class does not implement ConfigurationSerializable, you will have to make your own custom serialization to save the data.
     
  5. Offline

    desht

    The only Bukkit classes/interfaces which implement/extend ConfigurationSerializable are: Vector, ItemStack, OfflinePlayer.
     
  6. Offline

    Orcem12

    Interesting, Vector might be able to store a location.
     
  7. Offline

    Sagacious_Zed Bukkit Docs

    No, it can't because a Location has more components than a Vector can hold.

    A Location can have: World, X, Y, Z, Phi, Theta
     
  8. Offline

    Orcem12

    Doesn't the worldguard have some kind of API for getting a location from a vector? Maybe not in the most literal sense... But I remember glances over some of his code and saw a comment saying (//This also gets the location) I'll see if I can find it anywhere.
     
Thread Status:
Not open for further replies.

Share This Page