Interface DayCareDuration

All Known Implementing Classes:
AbstractDuration, AdditiveDuration, ConstantDuration, MultiplicativeDuration, NegativeDuration

public interface DayCareDuration
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.network.chat.Component
    Get the display Component
    The unique identifier of the day care duration logic
    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
    int
    Gets the duration type's priority (higher priority = will be calculated first)
    void
    read(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 to
      box - The box this is relevant to from the player
      currentTime - 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 GSON
      json - The JSON element
    • getDisplay

      net.minecraft.network.chat.Component getDisplay()
      Get the display Component
      Returns:
      the Component