Interface DayCareRequirement

All Known Implementing Classes:
AbstractRequirement, ItemStackRequirement, OneTimeFemaleItemStackRequirement, PokeDollarsRequirement

public interface DayCareRequirement
Represents a requirement for the breeding to begin between two Pokemon
Since:
25/06/2022
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.network.chat.Component
    Gets the error message for when the requirement isn't met
    Gets the unique identifier of the breeding requirement type for use in datapacks
    boolean
    hasMetRequirement(net.minecraft.server.level.ServerPlayer player, DayCareBox box)
    Determines if the player has met the given requirement
    void
    read(com.google.gson.Gson gson, com.google.gson.JsonElement json)
    Reads the breeding requirement from JSON
    void
    read(net.minecraft.nbt.CompoundTag nbt)
    Reads the requirement from NBT
    void
    setError(net.minecraft.network.chat.Component error)
    Sets the error message displayed in the GUI to the player
    void
    takeFrom(net.minecraft.server.level.ServerPlayer player, DayCareBox box)
    The logic for taking the items from the player
    void
    write(net.minecraft.nbt.CompoundTag nbt)
    Writes the requirement to NBT
  • Method Details

    • getTypeId

      String getTypeId()
      Gets the unique identifier of the breeding requirement type for use in datapacks
      Returns:
      The unique id
    • getError

      net.minecraft.network.chat.Component getError()
      Gets the error message for when the requirement isn't met
      Returns:
      The error message
    • setError

      void setError(net.minecraft.network.chat.Component error)
      Sets the error message displayed in the GUI to the player
      Parameters:
      error - The error
    • read

      void read(com.google.gson.Gson gson, com.google.gson.JsonElement json) throws RuntimeException
      Reads the breeding requirement from JSON
      Parameters:
      gson - The GSON instance
      json - The JSON element to be parsed
      Throws:
      RuntimeException
    • hasMetRequirement

      boolean hasMetRequirement(net.minecraft.server.level.ServerPlayer player, DayCareBox box)
      Determines if the player has met the given requirement
      Parameters:
      player - The player
      box - The box in relation to
      Returns:
      True if met, false if not
    • takeFrom

      void takeFrom(net.minecraft.server.level.ServerPlayer player, DayCareBox box)
      The logic for taking the items from the player
      Parameters:
      player - The player
    • write

      void write(net.minecraft.nbt.CompoundTag nbt)
      Writes the requirement to NBT
      Parameters:
      nbt - The NBT being written to
    • read

      void read(net.minecraft.nbt.CompoundTag nbt)
      Reads the requirement from NBT
      Parameters:
      nbt - The NBT being read from