Class LocationSerializer

java.lang.Object
dev.crafty.core.config.serializers.LocationSerializer
All Implemented Interfaces:
de.exlll.configlib.Serializer<org.bukkit.Location,Map<String,Object>>, ConfigSerializer<org.bukkit.Location>

public class LocationSerializer extends Object implements ConfigSerializer<org.bukkit.Location>
Serializer for Location objects.
  • Constructor Details

    • LocationSerializer

      public LocationSerializer()
  • Method Details

    • getTargetClass

      public Class<org.bukkit.Location> getTargetClass()
      Description copied from interface: ConfigSerializer
      Get the class that this serializer handles.
      Specified by:
      getTargetClass in interface ConfigSerializer<org.bukkit.Location>
      Returns:
      The target class
    • serialize

      public void serialize(org.bukkit.Location toSerialize, org.bukkit.configuration.MemoryConfiguration config)
      Description copied from interface: ConfigSerializer
      Serialize an object to a MemoryConfiguration. Simply call config.set(key, value) for each field you want to serialize.
      Specified by:
      serialize in interface ConfigSerializer<org.bukkit.Location>
      Parameters:
      toSerialize - The object to serialize
      config - The blank MemoryConfiguration to write to
    • deserialize

      public Optional<org.bukkit.Location> deserialize(SectionWrapper from)
      Description copied from interface: ConfigSerializer
      Deserialize an object from a SectionWrapper.
      Specified by:
      deserialize in interface ConfigSerializer<org.bukkit.Location>
      Parameters:
      from - The SectionWrapper containing the serialized data
      Returns:
      The deserialized object