Package ml.pluto7073.chemicals.handlers
Class StaticChemicalHandler
java.lang.Object
ml.pluto7073.chemicals.handlers.ConsumableChemicalHandler
ml.pluto7073.chemicals.handlers.StaticChemicalHandler
An implementation of
ConsumableChemicalHandler for a chemical that stays in the player
and resets once a maximum amount is reached, performing an action on the player-
Field Summary
FieldsFields inherited from class ml.pluto7073.chemicals.handlers.ConsumableChemicalHandler
accessor, EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionStaticChemicalHandler(float maxAmount) Creates a new StaticChemicalHandler instance -
Method Summary
Modifier and TypeMethodDescriptionabstract voidonMaxAmountReached(net.minecraft.world.entity.player.Player player) voidtickPlayer(net.minecraft.world.entity.player.Player player) Updates the current amount of the chemical in the specified playerMethods inherited from class ml.pluto7073.chemicals.handlers.ConsumableChemicalHandler
add, appendTooltip, createCustomChemicalCommandExtension, defineDataForPlayer, formatAmount, get, getEffectsForAmount, getId, getLanguageKey, set
-
Field Details
-
maxAmount
protected final float maxAmount
-
-
Constructor Details
-
StaticChemicalHandler
public StaticChemicalHandler(float maxAmount) Creates a new StaticChemicalHandler instance- Parameters:
maxAmount- The maximum amount of this chemical, or0if no limit is desired
-
-
Method Details
-
onMaxAmountReached
public abstract void onMaxAmountReached(net.minecraft.world.entity.player.Player player) -
tickPlayer
public void tickPlayer(net.minecraft.world.entity.player.Player player) Description copied from class:ConsumableChemicalHandlerUpdates the current amount of the chemical in the specified player- Specified by:
tickPlayerin classConsumableChemicalHandler- Parameters:
player- The player to update
-