Enum Class AmadronOfferManager

java.lang.Object
java.lang.Enum<AmadronOfferManager>
me.desht.pneumaticcraft.common.amadron.AmadronOfferManager
All Implemented Interfaces:
Serializable, Comparable<AmadronOfferManager>, Constable

public enum AmadronOfferManager extends Enum<AmadronOfferManager>
  • Enum Constant Details

  • Method Details

    • values

      public static AmadronOfferManager[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AmadronOfferManager valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getInstance

      public static AmadronOfferManager getInstance()
    • getOffer

      public AmadronRecipe getOffer(net.minecraft.resources.ResourceLocation offerId)
    • getActiveOffers

      public Collection<AmadronRecipe> getActiveOffers()
    • addPlayerOffer

      public boolean addPlayerOffer(AmadronPlayerOffer offer)
      Try to add a player->player offer.
      Parameters:
      offer - the offer to add
      Returns:
      true if the offer was added, false if an equivalent offer already exists or the offer is invalid
    • removePlayerOffer

      public boolean removePlayerOffer(AmadronPlayerOffer offer)
    • hasSimilarPlayerOffer

      public boolean hasSimilarPlayerOffer(AmadronPlayerOffer offer)
    • syncOffers

      public void syncOffers(Collection<AmadronRecipe> newOffers, boolean notifyPlayer)
      Called client-side (from PacketSyncAmadronOffers) to sync up the active offer list.
      Parameters:
      newOffers - the new offers
      notifyPlayer - true to notify players of new offers
    • updateStock

      public void updateStock(net.minecraft.resources.ResourceLocation id, int stock)
      Called client-side (from PacketAmadronUpdateStock) to update stock levels of an offer that someone just purchased.
      Parameters:
      id - offer ID, must be in the active offers list
      stock - new stock level
    • countPlayerOffers

      public int countPlayerOffers(UUID playerId)
    • tryRestockPlayerOffers

      public void tryRestockPlayerOffers()
      Called every 30 seconds: Amadron will send drones to restock custom player offers, and also to pay out any pending payments for custom offers.
    • saveAll

      public void saveAll()
      Called when the server is stopping to ensure everything is serialized
    • compileActiveOffersList

      public void compileActiveOffersList()
      Called on a resource reload (including startup) and periodically to shuffle new periodic offers in
    • addPlayerOffers

      public void addPlayerOffers()
    • rebuildRequired

      public void rebuildRequired()
    • checkForFullRebuild

      public void checkForFullRebuild(net.minecraft.world.level.Level world)
    • isActive

      public boolean isActive(net.minecraft.resources.ResourceLocation offerId)