Record Class RallyData
java.lang.Object
java.lang.Record
com.minecolonies.api.items.component.RallyData
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static RallyDatareadFromItemStack(net.minecraft.world.item.ItemStack itemStack) final StringtoString()Returns a string representation of this record class.List<net.minecraft.core.BlockPos> towers()Returns the value of thetowersrecord component.static voidupdateItemStack(net.minecraft.world.item.ItemStack itemStack, UnaryOperator<RallyData> updater) withActive(boolean active) withPosAddition(net.minecraft.core.BlockPos posToAdd) withPosRemoval(net.minecraft.core.BlockPos posToRemove) voidwriteToItemStack(net.minecraft.world.item.ItemStack itemStack)
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,RallyData> STREAM_CODEC
-
-
Constructor Details
-
RallyData
Creates an instance of aRallyDatarecord class.- Parameters:
towers- the value for thetowersrecord componentactive- the value for theactiverecord component
-
-
Method Details
-
withActive
-
withPosRemoval
-
withPosAddition
-
writeToItemStack
public void writeToItemStack(net.minecraft.world.item.ItemStack itemStack) -
readFromItemStack
-
updateItemStack
public static void updateItemStack(net.minecraft.world.item.ItemStack itemStack, UnaryOperator<RallyData> updater) -
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 '=='. -
towers
Returns the value of thetowersrecord component.- Returns:
- the value of the
towersrecord component
-
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-