Class SettingsFactories.RecipeSettingFactory

java.lang.Object
com.minecolonies.core.colony.buildings.modules.settings.SettingsFactories.RecipeSettingFactory
All Implemented Interfaces:
IRecipeSettingFactory<RecipeSetting>, IFactory<FactoryVoidInput,RecipeSetting>
Enclosing class:
SettingsFactories

public static class SettingsFactories.RecipeSettingFactory extends Object implements IRecipeSettingFactory<RecipeSetting>
Specific factory for the recipe setting.
  • Constructor Details

    • RecipeSettingFactory

      public RecipeSettingFactory()
  • Method Details

    • getFactoryOutputType

      @NotNull public @NotNull com.google.common.reflect.TypeToken<RecipeSetting> getFactoryOutputType()
      Description copied from interface: IFactory
      Method to get the type this factory can produce.
      Specified by:
      getFactoryOutputType in interface IFactory<FactoryVoidInput,RecipeSetting>
      Returns:
      The type of request this factory can produce.
    • getFactoryInputType

      @NotNull public @NotNull com.google.common.reflect.TypeToken<FactoryVoidInput> getFactoryInputType()
      Description copied from interface: IFactory
      Used to determine which type this can produce.
      Specified by:
      getFactoryInputType in interface IFactory<FactoryVoidInput,RecipeSetting>
      Returns:
      The class that represents the Type of Request this can produce.
    • getNewInstance

      @NotNull public @NotNull RecipeSetting getNewInstance(IToken<?> index, String craftingModuleId)
      Specified by:
      getNewInstance in interface IRecipeSettingFactory<RecipeSetting>
    • serialize

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag serialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull RecipeSetting storage)
      Description copied from interface: IFactory
      Method to serialize a given constructable.
      Specified by:
      serialize in interface IFactory<FactoryVoidInput,RecipeSetting>
      Parameters:
      controller - The controller that can be used to serialize complicated types.
      storage - The request to serialize.
      Returns:
      The serialized data of the given requets.
    • deserialize

      @NotNull public @NotNull RecipeSetting deserialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.nbt.CompoundTag nbt)
      Description copied from interface: IFactory
      Method to deserialize a given constructable.
      Specified by:
      deserialize in interface IFactory<FactoryVoidInput,RecipeSetting>
      Parameters:
      controller - The controller that can be used to deserialize complicated types.
      nbt - The data of the request that should be deserialized.
      Returns:
      The request that corresponds with the given data in the nbt
    • serialize

      public void serialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull RecipeSetting input, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf packetBuffer)
      Description copied from interface: IFactory
      Method to serialize a given constructable.
      Specified by:
      serialize in interface IFactory<FactoryVoidInput,RecipeSetting>
      Parameters:
      controller - The controller that can be used to serialize complicated types.
      input - The request to serialize.
      packetBuffer - The buffer to serialize into.
    • deserialize

      @NotNull public @NotNull RecipeSetting deserialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf buffer) throws Throwable
      Description copied from interface: IFactory
      Method to deserialize a given constructable.
      Specified by:
      deserialize in interface IFactory<FactoryVoidInput,RecipeSetting>
      Parameters:
      controller - The controller that can be used to deserialize complicated types.
      buffer - The data buffer of the request that should be deserialized.
      Returns:
      The request that corresponds with the given data in the nbt
      Throws:
      Exception - if somethings goes wrong during the deserialization.
      Throwable
    • getSerializationId

      public short getSerializationId()
      Description copied from interface: IFactory
      Get a serialization id for the factory.
      Specified by:
      getSerializationId in interface IFactory<FactoryVoidInput,RecipeSetting>
      Returns:
      the short id.