Weird code behavior

Discussion in 'Spigot Plugin Development' started by DrOreo002, Nov 29, 2018.

  1. code.png

    I have this line of code that basically will deserialize and 'Frame' object class from the config. And this is the deserialize code

    dese.png

    Basically it will return a new Frame object it I also have set the finished and running boolean to false. But when I debug it. It return true o_O. Got any idea why??
     
  2. Your code doesn't use the second method during the deserialization, it uses the default object to frame transformation. Possible ways of fixing:
    1. Send config and path to object to deserialization and getting all arguments like this: boolean use_s = config.getBoolean(objectPath + "use_second");
    2. Set object to config, look how it looks and always use analogic description
     
  3. Hmm yea you're right. It doesn't use the deserialize method. So I know that this can be fixed by deserializing it manually but I'll try that later if there's no more option that I can try.

    So does anyone have a good fix for this?
     
  4. Does your Frame class implemenent ConfigurationSerializable?
     
  5. Yep, it does. Still not sure why this thing happens
     
  6. BUMP. Could someone help me?
     
  7. Have you registered and annotated your class as deserializable?
     
  8. I have done everything that is required for this custom configuration serializeable class
     
  9. Yes. You need to do all of them. Implement the method that the interfaces defines, and make sure you have those two static methods and constructor. Then you can easily do config.get and config.set with Frames
     
  10. Eh didn't know that. Alright will do it now, thanks man
     
  11. Debugged it. None of those method get called (valueOf, deserialize, and the constructor)
     
  12. Does your class implement ConfigurationSerialiazble
     
  13. Ye it does. I'm 100% not sure why is this happening
     
  14. Do you want to send me your code?
     
  15. Did you register it?
     
  16. I've done everything man.
     
  17. Can I see how ur trying to set and get it?