Package ml.pluto7073.chemicals.handlers
Class StaticChemicalHandler
java.lang.Object
ml.pluto7073.chemicals.handlers.ChemicalHandler
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.ChemicalHandler
accessor, EMPTY, maxRecommendedAmount, ticksAccessor -
Constructor Summary
ConstructorsConstructorDescriptionStaticChemicalHandler(float maxAmount) Creates a new StaticChemicalHandler instance -
Method Summary
Modifier and TypeMethodDescriptionvoiddoTick(net.minecraft.world.entity.player.Player player) Updates the current amount of the chemical in the specified playerabstract voidonMaxAmountReached(net.minecraft.world.entity.player.Player player) Methods inherited from class ml.pluto7073.chemicals.handlers.ChemicalHandler
add, appendTooltip, bloom, contrast, createCustomChemicalCommandExtension, createInstance, createInstance, defineDataForPlayer, formatAmount, get, getEffectsForAmount, getId, getLanguageKey, getMaxRecommendedAmount, getStrength, init, loadExtraPlayerData, saveExtraPlayerData, set, tickPlayer
-
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) -
doTick
public void doTick(net.minecraft.world.entity.player.Player player) Description copied from class:ChemicalHandlerUpdates the current amount of the chemical in the specified player- Specified by:
doTickin classChemicalHandler- Parameters:
player- The player to update
-