Record Class BattleSceneTimeSettings
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.scene.BattleSceneTimeSettings
- Record Components:
mode- whether the scene uses a fixed time or mirrors the real client worldtime- fixed day time used whenmodeisBattleSceneSettingMode.FIXED
Time-of-day behavior for a battle scene.
Fixed time uses the authored day time from the scene definition. World matching mirrors the real client world.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BattleSceneTimeSettings> static final BattleSceneTimeSettings -
Constructor Summary
ConstructorsConstructorDescriptionBattleSceneTimeSettings(BattleSceneSettingMode mode, long time) Creates an instance of aBattleSceneTimeSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BattleSceneTimeSettingsdecode(net.minecraft.network.FriendlyByteBuf buffer) Decodes time settings from a battle scene packet.voidencode(net.minecraft.network.FriendlyByteBuf buffer) Encodes these time settings for a battle scene packet.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.longtime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
CODEC
-
-
Constructor Details
-
Method Details
-
decode
Decodes time settings from a battle scene packet.- Parameters:
buffer- the packet buffer to read from- Returns:
- the decoded time settings
-
encode
public void encode(net.minecraft.network.FriendlyByteBuf buffer) Encodes these time settings for a battle scene packet.- Parameters:
buffer- the packet buffer to write to
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
time
public long time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-