Class DayCareEvent.PreConditionStatusUpdate
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.daycare.event.DayCareEvent
com.pixelmonmod.pixelmon.api.daycare.event.DayCareEvent.PreConditionStatusUpdate
- Enclosing class:
- DayCareEvent
The event fired just before the condition status response packet is sent
Cancelling will prevent the response from happening (will look weird on the client's UI)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.daycare.event.DayCareEvent
DayCareEvent.HourGlassUsed, DayCareEvent.PostCollect, DayCareEvent.PostConditionStatusUpdate, DayCareEvent.PostDurationCalculate, DayCareEvent.PostEggCalculate, DayCareEvent.PostPokemonAdd, DayCareEvent.PostTimerBegin, DayCareEvent.PreCollect, DayCareEvent.PreConditionStatusUpdate, DayCareEvent.PreDurationCalculate, DayCareEvent.PreEggCalculate, DayCareEvent.PrePokemonAdd, DayCareEvent.PreTimerBegin, DayCareEvent.TimerComplete
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DayCareBox
protected boolean
protected DayCareCondition
protected net.minecraft.network.chat.Component
protected DayCareRequirement
-
Constructor Summary
ConstructorDescriptionPreConditionStatusUpdate
(net.minecraft.server.level.ServerPlayer player, PlayerPartyStorage party, DayCareBox box, DayCareCondition condition, DayCareRequirement requirement, boolean canConsume, net.minecraft.network.chat.Component errorMessage) -
Method Summary
Modifier and TypeMethodDescriptiongetBox()
Gets the box this is in relation toGets the condition being usednet.minecraft.network.chat.Component
Gets the error message to display to the client Only displayed ifisCanConsume()
is falseGets the requirement being usedboolean
If the inventory can consume the requirement (i.e.void
setCanConsume
(boolean canConsume) Sets if they can meet the requirementvoid
setCondition
(DayCareCondition condition) Sets the condition being usedvoid
setErrorMessage
(net.minecraft.network.chat.Component errorMessage) Sets the error message to display to the client Only displayed ifisCanConsume()
is falsevoid
setRequirement
(DayCareRequirement requirement) Sets the requirement being usedMethods inherited from class com.pixelmonmod.pixelmon.api.daycare.event.DayCareEvent
getDayCare, getParty, getPlayer
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
box
-
condition
-
requirement
-
canConsume
protected boolean canConsume -
errorMessage
protected net.minecraft.network.chat.Component errorMessage
-
-
Constructor Details
-
PreConditionStatusUpdate
public PreConditionStatusUpdate(net.minecraft.server.level.ServerPlayer player, PlayerPartyStorage party, DayCareBox box, DayCareCondition condition, DayCareRequirement requirement, boolean canConsume, net.minecraft.network.chat.Component errorMessage)
-
-
Method Details
-
getBox
Gets the box this is in relation to- Returns:
- The box
-
getCondition
Gets the condition being used- Returns:
- The condition
-
setCondition
Sets the condition being used- Parameters:
condition
- The condition
-
getRequirement
Gets the requirement being used- Returns:
- The daycare requirement being used
-
setRequirement
Sets the requirement being used- Parameters:
requirement
- The new requirement being used
-
isCanConsume
public boolean isCanConsume()If the inventory can consume the requirement (i.e. they have met the requirement condition)- Returns:
- if they can consume the requirement
-
setCanConsume
public void setCanConsume(boolean canConsume) Sets if they can meet the requirement- Parameters:
canConsume
- True if they can meet the requirement
-
getErrorMessage
public net.minecraft.network.chat.Component getErrorMessage()Gets the error message to display to the client Only displayed ifisCanConsume()
is false- Returns:
- The error message
-
setErrorMessage
public void setErrorMessage(net.minecraft.network.chat.Component errorMessage) Sets the error message to display to the client Only displayed ifisCanConsume()
is false- Parameters:
errorMessage
- The error message
-