Class SmeltableOre

java.lang.Object
com.minecolonies.core.colony.requestable.SmeltableOre
All Implemented Interfaces:
IDeliverable, INonExhaustiveDeliverable, IRequestable, IRetryable

public class SmeltableOre extends Object implements INonExhaustiveDeliverable
Smeltable requestable. Delivers a stack of a smeltable ore.
  • Constructor Details

    • SmeltableOre

      public SmeltableOre(int count)
    • SmeltableOre

      public SmeltableOre(int count, int leftOver)
    • SmeltableOre

      public SmeltableOre(int count, net.minecraft.world.item.ItemStack result)
  • Method Details

    • serialize

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

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

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

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

      public boolean matches(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IDeliverable
      Method called to check if a given stack matches this deliverable. The first stack that returns true from this method is returned as a Deliverable.
      Specified by:
      matches in interface IDeliverable
      Parameters:
      stack - The stack to test.
      Returns:
      true when the stack matches. False when not.
    • setResult

      public void setResult(@NotNull @NotNull net.minecraft.world.item.ItemStack result)
      Description copied from interface: IDeliverable
      Method to set the result of a delivery.
      Specified by:
      setResult in interface IDeliverable
      Parameters:
      result - The result of the delivery.
    • copyWithCount

      public IDeliverable copyWithCount(int newCount)
      Description copied from interface: IDeliverable
      Creates a new instance of this requestable with the given count.
      Specified by:
      copyWithCount in interface IDeliverable
      Parameters:
      newCount - The new requestable, with the requested count.
      Returns:
      the deliverable.
    • getCount

      public int getCount()
      Description copied from interface: IDeliverable
      Method called to get the amount of items that need to be in the stack.
      Specified by:
      getCount in interface IDeliverable
      Returns:
      The amount of items.
    • getMinimumCount

      public int getMinimumCount()
      Description copied from interface: IDeliverable
      Method called to get the minimum amount required to fulfill this request.
      Specified by:
      getMinimumCount in interface IDeliverable
      Returns:
      the minimum amount.
    • getResult

      @NotNull public @NotNull net.minecraft.world.item.ItemStack getResult()
      Description copied from interface: IDeliverable
      Method to get the result of the delivery.
      Specified by:
      getResult in interface IDeliverable
      Returns:
      The result of the delivery.
    • getSuperClasses

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

      public int getLeftOver()
      Get the amount of items left over after delivery.
      Specified by:
      getLeftOver in interface INonExhaustiveDeliverable
      Returns:
      the amount of items left over.