Contents
Class BarterShopAsset
java.lang.Object
com.hypixel.hytale.builtin.adventure.shop.barter.BarterShopAsset
- All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, DefaultAssetMap<String, BarterShopAsset>>
public class BarterShopAsset
extends Object
implements JsonAssetWithMap<String, DefaultAssetMap<String, BarterShopAsset>>
Asset definition for a barter shop, containing trades and refresh settings.
Loaded from Server/BarterShops/*.json files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AssetBuilderCodec<String, BarterShopAsset> static final intDefault restock hour when not specified in shop configstatic final ValidatorCache<String> -
Constructor Summary
ConstructorsConstructorDescriptionBarterShopAsset(String id, String displayNameKey, RefreshInterval refreshInterval, BarterTrade[] trades, TradeSlot[] tradeSlots, Integer restockHour) -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultAssetMap<String, BarterShopAsset> static AssetStore<String, BarterShopAsset, DefaultAssetMap<String, BarterShopAsset>> getId()intGet the hour (in 24h format) when this shop restocks.booleanCheck if this shop uses the new TradeSlots system.toString()
-
Field Details
-
CODEC
-
VALIDATOR_CACHE
-
DEFAULT_RESTOCK_HOUR
public static final int DEFAULT_RESTOCK_HOURDefault restock hour when not specified in shop config- See Also:
-
-
Constructor Details
-
BarterShopAsset
public BarterShopAsset(String id, String displayNameKey, RefreshInterval refreshInterval, BarterTrade[] trades, TradeSlot[] tradeSlots, @Nullable Integer restockHour)
-
-
Method Details
-
getAssetStore
@Nonnull public static AssetStore<String, BarterShopAsset, DefaultAssetMap<String, BarterShopAsset>> getAssetStore() -
getAssetMap
-
getId
-
getDisplayNameKey
-
getRefreshInterval
-
getTrades
-
getTradeSlots
- Returns:
- the trade slot definitions for this shop, or null if using legacy Trades array
-
hasTradeSlots
public boolean hasTradeSlots()Check if this shop uses the new TradeSlots system.- Returns:
- true if using TradeSlots, false if using legacy Trades array
-
getRestockHour
public int getRestockHour()Get the hour (in 24h format) when this shop restocks.- Returns:
- the configured restocking hour, or DEFAULT_RESTOCK_HOUR (7 AM) if not specified
-
toString
-