public enum AmadronOfferManager extends java.lang.Enum<AmadronOfferManager>
| Modifier and Type | Class and Description |
|---|---|
static class |
AmadronOfferManager.EventListener |
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPlayerOffer(AmadronPlayerOffer offer)
Try to add a player->player offer.
|
void |
addPlayerOffers() |
void |
compileActiveOffersList()
Called on a resource reload (including startup) and periodically to shuffle new periodic offers in
|
int |
countPlayerOffers(java.util.UUID playerId) |
java.util.Collection<AmadronRecipe> |
getActiveOffers() |
static AmadronOfferManager |
getInstance() |
AmadronRecipe |
getOffer(net.minecraft.util.ResourceLocation offerId) |
boolean |
hasSimilarPlayerOffer(AmadronPlayerOffer offer) |
void |
maybeRebuildActiveOffers(net.minecraft.world.World world) |
void |
rebuildRequired() |
boolean |
removePlayerOffer(AmadronPlayerOffer offer) |
void |
saveAll()
Called when the server is stopping to ensure everything is serialized
|
void |
syncOffers(java.util.Collection<AmadronRecipe> newOffers,
boolean notifyPlayer)
Called client-side (from PacketSyncAmadronOffers) to sync up the active offer list.
|
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.
|
void |
updateStock(net.minecraft.util.ResourceLocation id,
int stock)
Called client-side (from PacketAmadronUpdateStock) to update stock levels of an offer that someone just purchased.
|
static AmadronOfferManager |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AmadronOfferManager[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AmadronOfferManager INSTANCE
public static AmadronOfferManager[] values()
for (AmadronOfferManager c : AmadronOfferManager.values()) System.out.println(c);
public static AmadronOfferManager valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static AmadronOfferManager getInstance()
public AmadronRecipe getOffer(net.minecraft.util.ResourceLocation offerId)
public java.util.Collection<AmadronRecipe> getActiveOffers()
public boolean addPlayerOffer(AmadronPlayerOffer offer)
offer - the offer to addpublic boolean removePlayerOffer(AmadronPlayerOffer offer)
public boolean hasSimilarPlayerOffer(AmadronPlayerOffer offer)
public void syncOffers(java.util.Collection<AmadronRecipe> newOffers, boolean notifyPlayer)
newOffers - the new offersnotifyPlayer - public void updateStock(net.minecraft.util.ResourceLocation id,
int stock)
id - offer ID, must be in the active offers liststock - new stock levelpublic int countPlayerOffers(java.util.UUID playerId)
public void tryRestockPlayerOffers()
public void saveAll()
public void compileActiveOffersList()
public void addPlayerOffers()
public void rebuildRequired()
public void maybeRebuildActiveOffers(net.minecraft.world.World world)