Interface ADMediaHolder
- All Known Implementing Classes:
DebugUnlockerHolder
public interface ADMediaHolder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the media inside this media holder may be used to construct a battery.booleanWhether this media holder can be extracted from.booleanWhether this media holder can have media inserted into it.intThe priority for this media holder to be selected when casting a hex.longUsewithdrawMedia(-1, true) + insertMedia(-1, true)where possiblelonggetMedia()UsewithdrawMedia(-1, true)default longinsertMedia(long amount, boolean simulate) Inserts media into the holder.voidsetMedia(long media) UseinsertMedia(media - withdrawMedia(-1, true), false)where possibledefault longwithdrawMedia(long cost, boolean simulate) Withdraws media from the holder.
-
Field Details
-
QUENCHED_ALLAY_PRIORITY
static final int QUENCHED_ALLAY_PRIORITY- See Also:
-
QUENCHED_SHARD_PRIORITY
static final int QUENCHED_SHARD_PRIORITY- See Also:
-
CHARGED_AMETHYST_PRIORITY
static final int CHARGED_AMETHYST_PRIORITY- See Also:
-
AMETHYST_SHARD_PRIORITY
static final int AMETHYST_SHARD_PRIORITY- See Also:
-
AMETHYST_DUST_PRIORITY
static final int AMETHYST_DUST_PRIORITY- See Also:
-
BATTERY_PRIORITY
static final int BATTERY_PRIORITY- See Also:
-
-
Method Details
-
getMedia
@OverrideOnly long getMedia()UsewithdrawMedia(-1, true)- See Also:
-
getMaxMedia
@OverrideOnly long getMaxMedia()UsewithdrawMedia(-1, true) + insertMedia(-1, true)where possible -
setMedia
@OverrideOnly void setMedia(long media) UseinsertMedia(media - withdrawMedia(-1, true), false)where possible -
canRecharge
boolean canRecharge()Whether this media holder can have media inserted into it. -
canProvide
boolean canProvide()Whether this media holder can be extracted from. -
getConsumptionPriority
int getConsumptionPriority()The priority for this media holder to be selected when casting a hex. Higher priorities are taken first.By default, * Charged Amethyst has priority 1000 * Amethyst Shards have priority 2000 * Amethyst Dust has priority 3000 * Items which hold media have priority 4000
-
canConstructBattery
boolean canConstructBattery()Whether the media inside this media holder may be used to construct a battery. -
withdrawMedia
default long withdrawMedia(long cost, boolean simulate) Withdraws media from the holder. Returns the amount of media extracted, which may be less or more than the cost.Even if
canProvide()is false, you can still withdraw media this way.Withdrawing a negative amount will act as though you attempted to withdraw as much media as the holder contains.
-
insertMedia
default long insertMedia(long amount, boolean simulate) Inserts media into the holder. Returns the amount of media inserted, which may be less than the requested amount.Even if
canRecharge()is false, you can still insert media this way.Inserting a negative amount will act as though you attempted to insert exactly as much media as the holder was missing.
-