Class Delivery
java.lang.Object
com.minecolonies.api.colony.requestsystem.requestable.deliveryman.AbstractDeliverymanRequestable
com.minecolonies.api.colony.requestsystem.requestable.deliveryman.Delivery
- All Implemented Interfaces:
IDeliverymanRequestable,IRequestable
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.
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.requestsystem.requestable.deliveryman.AbstractDeliverymanRequestable
DEFAULT_DELIVERY_PRIORITY, MAX_BUILDING_PRIORITY, NBT_DAY, NBT_PRIORITY, NBT_QTY, priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Deliverydeserialize(@NotNull IFactoryController controller, @NotNull net.minecraft.nbt.CompoundTag compound) static Deliverydeserialize(IFactoryController controller, net.minecraft.network.FriendlyByteBuf buffer) Deserialize the deliverable.boolean@NotNull net.minecraft.world.item.ItemStackgetStack()@NotNull ILocationgetStart()Set<com.google.common.reflect.TypeToken<?>>Get the super classes associated to this request type.@NotNull ILocationinthashCode()static @NotNull net.minecraft.nbt.CompoundTagserialize(@NotNull IFactoryController controller, Delivery delivery) static voidserialize(IFactoryController controller, net.minecraft.network.FriendlyByteBuf buffer, Delivery input) Serialize the deliverable.toString()Methods inherited from class com.minecolonies.api.colony.requestsystem.requestable.deliveryman.AbstractDeliverymanRequestable
getDefaultDeliveryPriority, getMaxAgingPriority, getMaxBuildingPriority, getPlayerActionPriority, getPriority, incrementPriorityDueToAging, scaledPriority
-
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 inventorytarget- The location of the target inventorystack- The stack to be deliveredpriority- The priority of the request
-
-
Method Details
-
serialize
@NotNull public static @NotNull net.minecraft.nbt.CompoundTag serialize(@NotNull @NotNull IFactoryController controller, Delivery delivery) -
deserialize
@NotNull public static @NotNull Delivery deserialize(@NotNull @NotNull IFactoryController controller, @NotNull @NotNull net.minecraft.nbt.CompoundTag compound) -
serialize
public static void serialize(IFactoryController controller, net.minecraft.network.FriendlyByteBuf 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.FriendlyByteBuf buffer) Deserialize the deliverable.- Parameters:
controller- the controller.buffer- the buffer to read.- Returns:
- the deliverable.
-
getStart
-
getTarget
-
getStack
@NotNull public @NotNull net.minecraft.world.item.ItemStack getStack() -
equals
- Overrides:
equalsin classAbstractDeliverymanRequestable
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractDeliverymanRequestable
-
toString
-
getSuperClasses
Description copied from interface:IRequestableGet the super classes associated to this request type.- Returns:
- the type.
-