Class ItemSerializer

java.lang.Object
me.deecaad.core.file.serializers.ItemSerializer
All Implemented Interfaces:
Serializer<org.bukkit.inventory.ItemStack>

public class ItemSerializer extends Object implements Serializer<org.bukkit.inventory.ItemStack>
  • Field Details

    • ITEM_REGISTRY

      public static final Map<String,Supplier<org.bukkit.inventory.ItemStack>> ITEM_REGISTRY
  • Constructor Details

    • ItemSerializer

      public ItemSerializer()
      Empty constructor to be used as serializer
  • Method Details

    • serialize

      @NotNull public @NotNull org.bukkit.inventory.ItemStack serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Description copied from interface: Serializer
      Instantiates a new Object to be added into the finalized configuration. The object should be built off of SerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw a SerializerException. This method may not return null.
      Specified by:
      serialize in interface Serializer<org.bukkit.inventory.ItemStack>
      Parameters:
      data - The non-null data containing config
      Returns:
      The non-null serialized data.
      Throws:
      me.deecaad.core.file.SerializerException - If there is an error in config.
    • serializeWithTags

      public org.bukkit.inventory.ItemStack serializeWithTags(@NotNull @NotNull me.deecaad.core.file.SerializeData data, @NotNull @NotNull Map<String,Object> tags) throws me.deecaad.core.file.SerializerException
      Throws:
      me.deecaad.core.file.SerializerException
    • applyTags

      public void applyTags(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull Map<String,Object> tags)
    • attemptInline

      @Nullable public @Nullable org.bukkit.inventory.ItemStack attemptInline(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Throws:
      me.deecaad.core.file.SerializerException
    • serializeWithoutRecipe

      public org.bukkit.inventory.ItemStack serializeWithoutRecipe(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Throws:
      me.deecaad.core.file.SerializerException
    • serializeRecipe

      public org.bukkit.inventory.ItemStack serializeRecipe(me.deecaad.core.file.SerializeData data, org.bukkit.inventory.ItemStack itemStack) throws me.deecaad.core.file.SerializerException
      Throws:
      me.deecaad.core.file.SerializerException