public class ProgressBarComponent<T extends IComponentHarness> extends java.lang.Object implements net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>, IScreenAddonProvider, IContainerAddonProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
ProgressBarComponent.BarDirection |
| Constructor and Description |
|---|
ProgressBarComponent(int posX,
int posY,
int maxProgress) |
ProgressBarComponent(int posX,
int posY,
int progress,
int maxProgress) |
| Modifier and Type | Method and Description |
|---|---|
void |
deserializeNBT(net.minecraft.nbt.CompoundNBT nbt) |
ProgressBarComponent.BarDirection |
getBarDirection()
Gets the bar direction
|
java.util.function.Predicate<T> |
getCanIncrease()
Gets if the progress can be increased
|
java.util.function.Predicate<T> |
getCanReset()
Gets if the bar can reset
|
net.minecraft.item.DyeColor |
getColor()
Gets the color of the bar
|
T |
getComponentHarness()
Gets the tile where this bar is running
|
java.util.List<IFactory<? extends IContainerAddon>> |
getContainerAddons() |
boolean |
getIncreaseType() |
int |
getMaxProgress()
Gets the max progress of the bar
|
int |
getPosX()
Gets where the bar is located in the X
|
int |
getPosY()
Gets where the bar is located in the X
|
int |
getProgress()
Gets the current progress
|
int |
getProgressIncrease()
Gets how much the bar increases when it can increase progress
|
java.util.List<IFactory<? extends IScreenAddon>> |
getScreenAddons()
Gets the Gui Addons that it will be added to the machine GUI
|
int |
getTickingTime()
Gets how often the bar ticks
|
void |
onStart() |
net.minecraft.nbt.CompoundNBT |
serializeNBT() |
ProgressBarComponent<T> |
setBarDirection(ProgressBarComponent.BarDirection direction)
Sets the direction render for the bar in the gui
|
ProgressBarComponent<T> |
setCanIncrease(java.util.function.Predicate<T> canIncrease)
Sets a predicate to check if the bar can be increased
|
ProgressBarComponent<T> |
setCanReset(java.util.function.Predicate<T> canReset)
Sets if the the bar can be reseted when the progress is completed
|
ProgressBarComponent<T> |
setColor(net.minecraft.item.DyeColor color)
Set the color of the progress bar
|
ProgressBarComponent<T> |
setComponentHarness(T componentHarness)
Sets the tile where this bar is running
|
ProgressBarComponent<T> |
setIncreaseType(boolean increaseType)
Changes how the progress bar behaves when working
|
ProgressBarComponent<T> |
setMaxProgress(int maxProgress)
Sets the max progress of the bar
|
ProgressBarComponent<T> |
setOnFinishWork(java.lang.Runnable runnable)
Sets a runnable to be executed when the bar is completed
|
ProgressBarComponent<T> |
setOnStart(java.lang.Runnable runnable)
Sets a runnable to be executed every time the bar starts from 0
|
ProgressBarComponent<T> |
setOnTickWork(java.lang.Runnable runnable)
Sets a runnable to be executed every time the bar ticks
|
void |
setProgress(int progress)
Sets the progress bar progress
|
ProgressBarComponent<T> |
setProgressIncrease(int progressIncrease)
Sets how much the bar will increase when it can increase
|
ProgressBarComponent<T> |
setTickingTime(int tickingTime)
Sets how often the bar ticks
|
void |
tickBar()
Ticks the bar so it can increase if possible, managed by
MultiProgressBarHandler.update() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanInteractpublic ProgressBarComponent(int posX,
int posY,
int maxProgress)
public ProgressBarComponent(int posX,
int posY,
int progress,
int maxProgress)
public ProgressBarComponent<T> setOnFinishWork(java.lang.Runnable runnable)
runnable - The runnablepublic ProgressBarComponent<T> setOnTickWork(java.lang.Runnable runnable)
runnable - The runnablepublic ProgressBarComponent<T> setOnStart(java.lang.Runnable runnable)
runnable - The runnablepublic ProgressBarComponent<T> setComponentHarness(T componentHarness)
componentHarness - The tilepublic T getComponentHarness()
public java.util.function.Predicate<T> getCanReset()
public ProgressBarComponent<T> setCanReset(java.util.function.Predicate<T> canReset)
canReset - A Predicatepublic boolean getIncreaseType()
public ProgressBarComponent<T> setIncreaseType(boolean increaseType)
increaseType - True if the progress bar increases when working, false if the progress bar decreases when workingpublic void tickBar()
MultiProgressBarHandler.update()public int getPosX()
public int getPosY()
public java.util.function.Predicate<T> getCanIncrease()
public ProgressBarComponent<T> setCanIncrease(java.util.function.Predicate<T> canIncrease)
canIncrease - A predicatepublic int getProgress()
public void setProgress(int progress)
progress - The progress to setpublic int getMaxProgress()
public ProgressBarComponent<T> setMaxProgress(int maxProgress)
maxProgress - The max progresspublic int getTickingTime()
public ProgressBarComponent<T> setTickingTime(int tickingTime)
tickingTime - The ticking timepublic int getProgressIncrease()
public ProgressBarComponent<T> setProgressIncrease(int progressIncrease)
progressIncrease - The increase amountpublic ProgressBarComponent.BarDirection getBarDirection()
public ProgressBarComponent<T> setBarDirection(ProgressBarComponent.BarDirection direction)
direction - The bar directionpublic net.minecraft.item.DyeColor getColor()
public ProgressBarComponent<T> setColor(net.minecraft.item.DyeColor color)
color - the colorpublic java.util.List<IFactory<? extends IScreenAddon>> getScreenAddons()
getScreenAddons in interface IScreenAddonProviderpublic net.minecraft.nbt.CompoundNBT serializeNBT()
serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>public void deserializeNBT(net.minecraft.nbt.CompoundNBT nbt)
deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>public void onStart()
public java.util.List<IFactory<? extends IContainerAddon>> getContainerAddons()
getContainerAddons in interface IContainerAddonProvider