public class DayCareBox
extends java.lang.Object
PlayerPartyStorage
Constructor and Description |
---|
DayCareBox(PlayerDayCare dayCare,
int boxId)
Constructor taking the daycare (parent) and the box's id
|
Modifier and Type | Method and Description |
---|---|
void |
addDayCare(Pokemon parentOne,
Pokemon parentTwo,
Pokemon egg)
Adds the Pokemon to the daycare box and sets up the breeding conditions
|
void |
beginBreeding()
Begins the breeding process
|
java.util.List<net.minecraft.util.text.ITextComponent> |
calculateAllErrors()
Gets all the remaining requirement error messages
|
boolean |
canBreedingBegin()
Checks if the breeding can begin or if more conditions need to be met
|
boolean |
canConsume() |
void |
complete()
Skips all existing requirements, and timers.
|
void |
completeCondition(DayCareCondition condition)
Completes the condition and attempts to mark if the box is ready to breed
|
static DayCareBox |
decode(PlayerDayCare dayCare,
net.minecraft.network.PacketBuffer buffer)
Decodes the data from a packet buffer
|
void |
empty()
Sets the day care box as empty
|
void |
encode(net.minecraft.network.PacketBuffer buffer)
Encodes the data to the packet buffer
|
java.util.List<net.minecraft.util.text.ITextComponent> |
getAllErrorMessages() |
int |
getBoxId()
Gets the ID of the daycare box
|
java.util.List<DayCareCondition> |
getConditions()
Gets all the current conditions for a Day Care box
|
Pokemon |
getEgg()
Gets the egg in the box
Null if not created yet
|
net.minecraft.util.text.ITextComponent |
getErrorMessage() |
int |
getHourglassesUsed()
Gets the number of silver hourglasses used on this box
|
DayCareCondition |
getNextCondition()
Gets the next condition in the list for breeding to be able to begin
Will return null if there's none left
|
boolean |
getOvalCharmActive()
Gets whether the Oval Charm was set to ACTIVE before starting this box.
|
Pokemon |
getParent(int id)
Gets the parent in the slot Id
Will return null if it's an invalid index
|
Pokemon |
getParentOne()
Gets the first parent
|
Pokemon |
getParentTwo()
Gets the second parent
|
double |
getPercentComplete()
Gets the completion percentage of the daycare box
|
long |
getTotalDuration()
Gets the duration of the breed
|
boolean |
hasBreedingBegun()
Checks if the breeding timer has begun
|
boolean |
isEmpty()
Checks if the
PlayerDayCare box has any Pokemon in it |
static DayCareBox |
readFromNBT(PlayerDayCare dayCare,
net.minecraft.nbt.CompoundNBT nbt)
Crates a daycare instance from NBT
|
void |
returnToStorage()
Returns the egg and parents to the player's party/pc
|
void |
setAllErrorMessages(java.util.List<net.minecraft.util.text.ITextComponent> allErrorMessages) |
void |
setDayCare(PlayerDayCare dayCare)
Sets the daycare
|
void |
setEgg(Pokemon egg)
Sets the egg in the box
|
void |
setHourglassesUsed(int hourglassesUsed)
Sets the number of silver hourglasses used on this box
|
void |
setReadyToBreed(boolean readyToBreed) |
void |
setStatus(net.minecraft.util.text.ITextComponent errorMessage,
boolean canConsume) |
void |
tick()
Runs the tick task to check the completion
|
void |
writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
Writes the data to the NBT
|
public DayCareBox(PlayerDayCare dayCare, int boxId)
dayCare
- The daycareboxId
- The boxpublic int getBoxId()
public void setDayCare(PlayerDayCare dayCare)
dayCare
- The new daycarepublic void completeCondition(DayCareCondition condition)
condition
- The conditionpublic java.util.List<net.minecraft.util.text.ITextComponent> calculateAllErrors()
public void beginBreeding()
public boolean hasBreedingBegun()
public void tick()
@Nullable public Pokemon getParent(int id)
id
- The parent ID@Nullable public Pokemon getParentOne()
@Nullable public Pokemon getParentTwo()
@Nullable public Pokemon getEgg()
public void setEgg(Pokemon egg)
egg
- The eggpublic void addDayCare(Pokemon parentOne, Pokemon parentTwo, Pokemon egg)
parentOne
- The first parentparentTwo
- The second parentegg
- The eggpublic boolean canBreedingBegin()
public double getPercentComplete()
public long getTotalDuration()
@Nullable public DayCareCondition getNextCondition()
public java.util.List<DayCareCondition> getConditions()
public boolean isEmpty()
PlayerDayCare
box has any Pokemon in itpublic net.minecraft.util.text.ITextComponent getErrorMessage()
public java.util.List<net.minecraft.util.text.ITextComponent> getAllErrorMessages()
public void setAllErrorMessages(java.util.List<net.minecraft.util.text.ITextComponent> allErrorMessages)
public boolean canConsume()
public void setStatus(net.minecraft.util.text.ITextComponent errorMessage, boolean canConsume)
public void setReadyToBreed(boolean readyToBreed)
public void setHourglassesUsed(int hourglassesUsed)
hourglassesUsed
- The number usedpublic int getHourglassesUsed()
public boolean getOvalCharmActive()
public void complete()
public void returnToStorage()
public void empty()
public void writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
nbt
- The NBT being written topublic static DayCareBox readFromNBT(PlayerDayCare dayCare, net.minecraft.nbt.CompoundNBT nbt)
dayCare
- The daycarenbt
- The NBTpublic void encode(net.minecraft.network.PacketBuffer buffer)
buffer
- The bufferpublic static DayCareBox decode(PlayerDayCare dayCare, net.minecraft.network.PacketBuffer buffer)
dayCare
- The parent daycarebuffer
- The buffer