Class StaticLocation.Factory

java.lang.Object
com.minecolonies.core.colony.requestsystem.locations.StaticLocation.Factory
All Implemented Interfaces:
IFactory<net.minecraft.core.BlockPos,StaticLocation>, ILocationFactory<net.minecraft.core.BlockPos,StaticLocation>
Enclosing class:
StaticLocation

public static class StaticLocation.Factory extends Object implements ILocationFactory<net.minecraft.core.BlockPos,StaticLocation>
Internal factory class.
  • Constructor Details

    • Factory

      public Factory()
  • Method Details

    • getFactoryOutputType

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

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

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag serialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull IFactoryController controller, @NotNull @NotNull StaticLocation request)
      Method to serialize a given constructable.
      Specified by:
      serialize in interface IFactory<net.minecraft.core.BlockPos,StaticLocation>
      Parameters:
      controller - The controller that can be used to serialize complicated types.
      request - The request to serialize.
      Returns:
      The serialized data of the given requets.
    • deserialize

      @NotNull public @NotNull StaticLocation deserialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.nbt.CompoundTag nbt)
      Method to deserialize a given constructable.
      Specified by:
      deserialize in interface IFactory<net.minecraft.core.BlockPos,StaticLocation>
      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
    • getNewInstance

      @NotNull public @NotNull StaticLocation getNewInstance(@NotNull @NotNull IFactoryController factoryController, @NotNull @NotNull net.minecraft.core.BlockPos blockPos, @NotNull @NotNull Object... context)
      Description copied from interface: ILocationFactory
      Method to get a new instance of the output given the input and additional context data.
      Specified by:
      getNewInstance in interface IFactory<net.minecraft.core.BlockPos,StaticLocation>
      Specified by:
      getNewInstance in interface ILocationFactory<net.minecraft.core.BlockPos,StaticLocation>
      Parameters:
      factoryController - The IFactoryController that called this factory method.
      blockPos - The input to build a new output for.
      context - The context of the location.
      Returns:
      The new output instance for a given input.
    • getNewInstance

      @NotNull public @NotNull StaticLocation getNewInstance(@NotNull @NotNull IFactoryController factoryController, @NotNull @NotNull net.minecraft.core.BlockPos input)
      Method to get a new instance of a location given the input. Method not used in this factory.
      Specified by:
      getNewInstance in interface ILocationFactory<net.minecraft.core.BlockPos,StaticLocation>
      Parameters:
      factoryController - The IFactoryController that called this factory method.
      input - The input to build a new location for.
      Returns:
      The new output instance for a given input.
    • serialize

      public void serialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull StaticLocation input, net.minecraft.network.RegistryFriendlyByteBuf packetBuffer)
      Description copied from interface: IFactory
      Method to serialize a given constructable.
      Specified by:
      serialize in interface IFactory<net.minecraft.core.BlockPos,StaticLocation>
      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 StaticLocation deserialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buffer) throws Throwable
      Description copied from interface: IFactory
      Method to deserialize a given constructable.
      Specified by:
      deserialize in interface IFactory<net.minecraft.core.BlockPos,StaticLocation>
      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:
      Throwable
    • getSerializationId

      public short getSerializationId()
      Description copied from interface: IFactory
      Get a serialization id for the factory.
      Specified by:
      getSerializationId in interface IFactory<net.minecraft.core.BlockPos,StaticLocation>
      Returns:
      the short id.