Package com.wdiscute.echoes.timeless
Record Class TimelessData
java.lang.Object
java.lang.Record
com.wdiscute.echoes.timeless.TimelessData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TimelessData> static final TimelessDatastatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, TimelessData> -
Constructor Summary
ConstructorsConstructorDescriptionTimelessData(long timeToExit, int currentStage, int maxStage, List<com.wdiscute.utils.MaybeStack> inventory, float souls, float maxSouls, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted) Creates an instance of aTimelessDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidawardSoul(net.minecraft.world.entity.player.Player player, float souls) static voidclearSouls(net.minecraft.world.entity.player.Player player) static booleanconsumeSouls(net.minecraft.world.entity.player.Player player, float souls) intReturns the value of thecurrentStagerecord component.final booleanIndicates whether some other object is "equal to" this one.static TimelessDataget(net.minecraft.world.entity.player.Player player) final inthashCode()Returns a hash code value for this object.static voidincreaseStageCount(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation stage) List<com.wdiscute.utils.MaybeStack> Returns the value of theinventoryrecord component.com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> Returns the value of thelevelsCompletedrecord component.floatmaxSouls()Returns the value of themaxSoulsrecord component.intmaxStage()Returns the value of themaxStagerecord component.static voidresetProgress(net.minecraft.server.level.ServerPlayer player) static voidsetCurrentStage(net.minecraft.world.entity.player.Player player, int currentStage) static voidsetInventory(net.minecraft.world.entity.player.Player player, List<com.wdiscute.utils.MaybeStack> inventory) static voidsetMaxStage(net.minecraft.world.entity.player.Player player, int currentStage) static voidsetTimeToExit(net.minecraft.world.entity.player.Player player, long timeToExit) floatsouls()Returns the value of thesoulsrecord component.longReturns the value of thetimeToExitrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,TimelessData> STREAM_CODEC
-
-
Constructor Details
-
TimelessData
public TimelessData(long timeToExit, int currentStage, int maxStage, List<com.wdiscute.utils.MaybeStack> inventory, float souls, float maxSouls, com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted) Creates an instance of aTimelessDatarecord class.- Parameters:
timeToExit- the value for thetimeToExitrecord componentcurrentStage- the value for thecurrentStagerecord componentmaxStage- the value for themaxStagerecord componentinventory- the value for theinventoryrecord componentsouls- the value for thesoulsrecord componentmaxSouls- the value for themaxSoulsrecord componentlevelsCompleted- the value for thelevelsCompletedrecord component
-
-
Method Details
-
get
-
setTimeToExit
public static void setTimeToExit(net.minecraft.world.entity.player.Player player, long timeToExit) -
setCurrentStage
public static void setCurrentStage(net.minecraft.world.entity.player.Player player, int currentStage) -
setMaxStage
public static void setMaxStage(net.minecraft.world.entity.player.Player player, int currentStage) -
setInventory
public static void setInventory(net.minecraft.world.entity.player.Player player, List<com.wdiscute.utils.MaybeStack> inventory) -
resetProgress
public static void resetProgress(net.minecraft.server.level.ServerPlayer player) -
consumeSouls
public static boolean consumeSouls(net.minecraft.world.entity.player.Player player, float souls) -
clearSouls
public static void clearSouls(net.minecraft.world.entity.player.Player player) -
awardSoul
public static void awardSoul(net.minecraft.world.entity.player.Player player, float souls) -
increaseStageCount
public static void increaseStageCount(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation stage) -
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 '=='. -
timeToExit
public long timeToExit()Returns the value of thetimeToExitrecord component.- Returns:
- the value of the
timeToExitrecord component
-
currentStage
public int currentStage()Returns the value of thecurrentStagerecord component.- Returns:
- the value of the
currentStagerecord component
-
maxStage
public int maxStage()Returns the value of themaxStagerecord component.- Returns:
- the value of the
maxStagerecord component
-
inventory
Returns the value of theinventoryrecord component.- Returns:
- the value of the
inventoryrecord component
-
souls
public float souls()Returns the value of thesoulsrecord component.- Returns:
- the value of the
soulsrecord component
-
maxSouls
public float maxSouls()Returns the value of themaxSoulsrecord component.- Returns:
- the value of the
maxSoulsrecord component
-
levelsCompleted
public com.wdiscute.utils.Counter<net.minecraft.resources.ResourceLocation> levelsCompleted()Returns the value of thelevelsCompletedrecord component.- Returns:
- the value of the
levelsCompletedrecord component
-