java.lang.Object
com.minecolonies.api.colony.requestsystem.requestable.deliveryman.AbstractDeliverymanRequestable
com.minecolonies.api.colony.requestsystem.requestable.deliveryman.Delivery
All Implemented Interfaces:
IDeliverymanRequestable, IRequestable

public class Delivery extends AbstractDeliverymanRequestable
Class used to represent deliveries inside the request system. This class can be used to request a getDelivery of a given ItemStack from a source to a target.
  • Constructor Details

    • Delivery

      public Delivery(@NotNull @NotNull ILocation start, @NotNull @NotNull ILocation target, @NotNull @NotNull net.minecraft.world.item.ItemStack stack, int priority)
      Constructor for Delivery requests
      Parameters:
      start - The location of the source inventory
      target - The location of the target inventory
      stack - The stack to be delivered
      priority - The priority of the request
  • Method Details

    • serialize

      @NotNull public static @NotNull net.minecraft.nbt.CompoundTag serialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull IFactoryController controller, Delivery delivery)
    • deserialize

      @NotNull public static @NotNull Delivery deserialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
    • serialize

      public static void serialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer, Delivery input)
      Serialize the deliverable.
      Parameters:
      controller - the controller.
      buffer - the the buffer to write to.
      input - the input to serialize.
    • deserialize

      public static Delivery deserialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer)
      Deserialize the deliverable.
      Parameters:
      controller - the controller.
      buffer - the buffer to read.
      Returns:
      the deliverable.
    • getStart

      @NotNull public @NotNull ILocation getStart()
    • getTarget

      @NotNull public @NotNull ILocation getTarget()
    • getStack

      @NotNull public @NotNull net.minecraft.world.item.ItemStack getStack()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractDeliverymanRequestable
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractDeliverymanRequestable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSuperClasses

      public Set<com.google.common.reflect.TypeToken<?>> getSuperClasses()
      Description copied from interface: IRequestable
      Get the super classes associated to this request type.
      Returns:
      the type.