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.ComponentgetError()Gets the error message for when the requirement isn't metList<net.minecraft.world.item.ItemStack> getIcon()Gets an icon representing the requirementGets the unique identifier of the breeding requirement type for use in datapacksbooleanhasMetRequirement(net.minecraft.server.level.ServerPlayer player, DayCareBox box) Determines if the player has met the given requirementvoidread(com.google.gson.Gson gson, com.google.gson.JsonElement json, net.minecraft.core.HolderLookup.Provider registryAccess) Reads the breeding requirement from JSONvoidread(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registryAccess) Reads the requirement from NBTvoidsetError(net.minecraft.network.chat.Component error) Sets the error message displayed in the GUI to the playervoidtakeFrom(net.minecraft.server.level.ServerPlayer player, DayCareBox box) The logic for taking the items from the playervoidwrite(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registryAccess) 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
-
getIcon
List<net.minecraft.world.item.ItemStack> getIcon()Gets an icon representing the requirement- Returns:
- The icon
-
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, net.minecraft.core.HolderLookup.Provider registryAccess) throws RuntimeException 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, net.minecraft.core.HolderLookup.Provider registryAccess) Writes the requirement to NBT- Parameters:
nbt- The NBT being written to
-
read
void read(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registryAccess) Reads the requirement from NBT- Parameters:
nbt- The NBT being read from
-