Class ConstantDuration
java.lang.Object
com.pixelmonmod.pixelmon.api.daycare.impl.duration.AbstractDuration
com.pixelmonmod.pixelmon.api.daycare.impl.duration.ConstantDuration
- All Implemented Interfaces:
DayCareDuration
Duration type that adds the given amount in the specified units
- Since:
- 13/07/2022
-
Field Summary
Fields inherited from class com.pixelmonmod.pixelmon.api.daycare.impl.duration.AbstractDuration
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentGet the display ComponentlonglonggetMillisecondValue(net.minecraft.server.level.ServerPlayer player, DayCareBox box, long currentTime) Calculates the value in milliseconds that will get ADDED to the timestamp when the end timestamp is calculatedintGets the duration type's priority (higher priority = will be calculated first)voidread(com.google.gson.Gson gson, com.google.gson.JsonElement json) Reads the duration from JSONMethods inherited from class com.pixelmonmod.pixelmon.api.daycare.impl.duration.AbstractDuration
getId
-
Constructor Details
-
ConstantDuration
public ConstantDuration()
-
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:DayCareDurationGets the duration type's priority (higher priority = will be calculated first)- Specified by:
getPriorityin interfaceDayCareDuration- Overrides:
getPriorityin classAbstractDuration- Returns:
- The priority
-
getMillisecondValue
public long getMillisecondValue(net.minecraft.server.level.ServerPlayer player, DayCareBox box, long currentTime) Description copied from interface:DayCareDurationCalculates the value in milliseconds that will get ADDED to the timestamp when the end timestamp is calculated- Parameters:
player- The player this is relevant tobox- The box this is relevant to from the playercurrentTime- The already calculated time- Returns:
- The milliseconds value
-
read
public void read(com.google.gson.Gson gson, com.google.gson.JsonElement json) Description copied from interface:DayCareDurationReads the duration from JSON- Parameters:
gson- The GSONjson- The JSON element
-
getDisplay
public net.minecraft.network.chat.Component getDisplay()Description copied from interface:DayCareDurationGet the display Component- Specified by:
getDisplayin interfaceDayCareDuration- Specified by:
getDisplayin classAbstractDuration- Returns:
- the Component
-
getMilliseconds
public long getMilliseconds()
-