Package mcp.mobius.waila.api.data
Class ProgressData
java.lang.Object
mcp.mobius.waila.api.data.ProgressData
- All Implemented Interfaces:
IData
Adds a crafting progress information to an object.
-
Nested Class Summary
Nested classes/interfaces inherited from interface mcp.mobius.waila.api.IData
IData.Type<D extends IData>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceLocation
static final ResourceLocation
static final ResourceLocation
static final ResourceLocation
static final IData.Type
<ProgressData> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionensureInputSpace
(int length) Ensure the internal list has empty space for the specified amount.ensureOutputSpace
(int length) Ensure the internal list has empty space for the specified amount.input
(int slot) Adds an item stack from the specified slot to the input list.input
(int... slots) Adds an item stack from the specified slots to the input list.input
(Collection<ItemStack> stacks) Adds item stacks to the input list.Adds an item stack to the input list.Adds item stacks to the input list.itemGetter
(IntFunction<ItemStack> getter) Specify a slot to item stack getter to be used withinput(int)
andoutput(int)
.output
(int slot) Adds an item stack from the specified slot to the output list.output
(int... slots) Adds an item stack from the specified slots to the output list.output
(Collection<ItemStack> stacks) Adds item stacks to the output list.Adds an item stack to the output list.Adds item stacks to the output list.static ProgressData
ratio
(float ratio) Creates a progress data.static ProgressData
tick
(int current, int total) Creates a progress data.
-
Field Details
-
ID
-
TYPE
-
CONFIG_TIME
-
CONFIG_BAR_HEIGHT
-
CONFIG_REPLACE_ITEMS
-
-
Constructor Details
-
ProgressData
public ProgressData()
-
-
Method Details
-
ratio
Creates a progress data.Prefer
tick(int, int)
if the information present.Do NOT add a data if the current progress is zero.
- Parameters:
ratio
- the ratio of the progress ranging from0.0f
to1.0f
-
tick
Creates a progress data.Unlike
ratio(float)
, this version also adds an estimated time to finish on the tooltip.Do NOT add a data if the current progress is zero.
- Parameters:
current
- the current tick progress for the processtotal
- the estimated total tick for the process
-
input
Adds an item stack to the input list. -
input
Adds item stacks to the input list. -
input
Adds item stacks to the input list. -
input
Adds an item stack from the specified slot to the input list.A stack getter needs to be specified with
itemGetter(IntFunction)
. -
input
Adds an item stack from the specified slots to the input list.A stack getter needs to be specified with
itemGetter(IntFunction)
. -
output
Adds an item stack to the output list. -
output
Adds item stacks to the output list. -
output
Adds item stacks to the output list. -
output
Adds an item stack from the specified slot to the output list.A stack getter needs to be specified with
itemGetter(IntFunction)
. -
output
Adds an item stack from the specified slots to the output list.A stack getter needs to be specified with
itemGetter(IntFunction)
. -
itemGetter
Specify a slot to item stack getter to be used withinput(int)
andoutput(int)
. -
ensureInputSpace
Ensure the internal list has empty space for the specified amount. -
ensureOutputSpace
Ensure the internal list has empty space for the specified amount.
-