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 TypeMethodDescriptionnet.minecraft.network.chat.Component
getError()
Gets the error message for when the requirement isn't metGets the unique identifier of the breeding requirement type for use in datapacksboolean
hasMetRequirement
(net.minecraft.server.level.ServerPlayer player, DayCareBox box) Determines if the player has met the given requirementvoid
read
(com.google.gson.Gson gson, com.google.gson.JsonElement json) Reads the breeding requirement from JSONvoid
read
(net.minecraft.nbt.CompoundTag nbt) Reads the requirement from NBTvoid
setError
(net.minecraft.network.chat.Component error) Sets the error message displayed in the GUI to the playervoid
takeFrom
(net.minecraft.server.level.ServerPlayer player, DayCareBox box) The logic for taking the items from the playervoid
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
Reads the breeding requirement from JSON- Parameters:
gson
- The GSON instancejson
- The JSON element to be parsed- Throws:
RuntimeException
-
hasMetRequirement
Determines if the player has met the given requirement- Parameters:
player
- The playerbox
- The box in relation to- Returns:
- True if met, false if not
-
takeFrom
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
-