Class PixelmonDayCareCondition
java.lang.Object
com.pixelmonmod.pixelmon.api.daycare.impl.PixelmonDayCareCondition
- All Implemented Interfaces:
DayCareCondition
,Cloneable
Default Pixelmon implementation of the
DayCareCondition
- Since:
- 13/07/2022
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<DayCareDuration>
protected List<DayCareRequirement>
protected List<DayCareRequirement>
protected PokemonSpecification
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a copy of the objectboolean
completeRequirement
(net.minecraft.server.level.ServerPlayer player, DayCareBox box, DayCareRequirement requirement) Attempts to complete the requirementGets the durations to apply from this conditionGets the next requirement, if one existsGets the remaining requirementsGets all the requirementsboolean
Checks if all requirements have been completedboolean
isConditionFor
(Pokemon parentOne, Pokemon parentTwo, Pokemon child) Determines if the condition is applicable to the two parents attempting to breedvoid
read
(com.google.gson.Gson gson, com.google.gson.JsonElement json) Reads the condition from JSONvoid
read
(net.minecraft.nbt.CompoundTag nbt) Reads the condition from NBTvoid
skipRequirement
(DayCareRequirement requirement) Skips the requirement without any completion steps (i.e.void
write
(net.minecraft.nbt.CompoundTag nbt) Writes the condition to NBT
-
Field Details
-
spec
-
requirements
-
remainingRequirements
-
durations
-
-
Constructor Details
-
PixelmonDayCareCondition
public PixelmonDayCareCondition()
-
-
Method Details
-
isConditionFor
Description copied from interface:DayCareCondition
Determines if the condition is applicable to the two parents attempting to breed- Specified by:
isConditionFor
in interfaceDayCareCondition
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- True if it is a condition
-
getDurations
Description copied from interface:DayCareCondition
Gets the durations to apply from this condition- Specified by:
getDurations
in interfaceDayCareCondition
- Returns:
- The durations
-
getRequirements
Description copied from interface:DayCareCondition
Gets all the requirements- Specified by:
getRequirements
in interfaceDayCareCondition
- Returns:
- The requirements
-
getNextRequirement
Description copied from interface:DayCareCondition
Gets the next requirement, if one exists- Specified by:
getNextRequirement
in interfaceDayCareCondition
- Returns:
- The next requirement
-
isComplete
public boolean isComplete()Description copied from interface:DayCareCondition
Checks if all requirements have been completed- Specified by:
isComplete
in interfaceDayCareCondition
- Returns:
- Checks if there's any requirements left
-
getRemainingRequirements
Description copied from interface:DayCareCondition
Gets the remaining requirements- Specified by:
getRemainingRequirements
in interfaceDayCareCondition
- Returns:
- The remaining requirements
-
completeRequirement
public boolean completeRequirement(net.minecraft.server.level.ServerPlayer player, DayCareBox box, DayCareRequirement requirement) Description copied from interface:DayCareCondition
Attempts to complete the requirement- Specified by:
completeRequirement
in interfaceDayCareCondition
- Parameters:
player
- The playerbox
- The boxrequirement
- The requirement
-
skipRequirement
Description copied from interface:DayCareCondition
Skips the requirement without any completion steps (i.e. taking costs)- Specified by:
skipRequirement
in interfaceDayCareCondition
- Parameters:
requirement
- The requirement
-
read
public void read(com.google.gson.Gson gson, com.google.gson.JsonElement json) Description copied from interface:DayCareCondition
Reads the condition from JSON- Specified by:
read
in interfaceDayCareCondition
json
- The JSON object
-
clone
Description copied from interface:DayCareCondition
Creates a copy of the object- Specified by:
clone
in interfaceDayCareCondition
- Overrides:
clone
in classObject
- Returns:
- new instance
-
write
public void write(net.minecraft.nbt.CompoundTag nbt) Description copied from interface:DayCareCondition
Writes the condition to NBT- Specified by:
write
in interfaceDayCareCondition
- Parameters:
nbt
- The NBT to write to
-
read
public void read(net.minecraft.nbt.CompoundTag nbt) Description copied from interface:DayCareCondition
Reads the condition from NBT- Specified by:
read
in interfaceDayCareCondition
- Parameters:
nbt
- The NBT to read from
-