Interface DayCareDuration
- All Known Implementing Classes:
AbstractDuration,AdditiveDuration,ConstantDuration,MultiplicativeDuration,NegativeDuration
public interface DayCareDuration
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentGet the display ComponentgetId()The unique identifier of the day care duration logiclonggetMillisecondValue(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 JSON
-
Method Details
-
getId
String getId()The unique identifier of the day care duration logic- Returns:
- The ID
-
getPriority
int getPriority()Gets the duration type's priority (higher priority = will be calculated first)- Returns:
- The priority
-
getMillisecondValue
long getMillisecondValue(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 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
void read(com.google.gson.Gson gson, com.google.gson.JsonElement json) Reads the duration from JSON- Parameters:
gson- The GSONjson- The JSON element
-
getDisplay
net.minecraft.network.chat.Component getDisplay()Get the display Component- Returns:
- the Component
-