Package vazkii.botania.common.component
Record Class LaputaState
java.lang.Object
java.lang.Record
vazkii.botania.common.component.LaputaState
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<LaputaState> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, LaputaState> Only encodes the block state, as no other data is required by the client. -
Constructor Summary
ConstructorsConstructorDescriptionLaputaState(net.minecraft.world.level.block.state.BlockState blockState, Optional<net.minecraft.world.item.component.CustomData> blockEntityData, @Nullable net.minecraft.core.BlockPos nextPos, int yStart, int i, int j, int k) Creates an instance of aLaputaStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<net.minecraft.world.item.component.CustomData> Returns the value of theblockEntityDatarecord component.net.minecraft.world.level.block.state.BlockStateReturns the value of theblockStaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inti()Returns the value of theirecord component.intj()Returns the value of thejrecord component.intk()Returns the value of thekrecord component.@Nullable net.minecraft.core.BlockPosnextPos()Returns the value of thenextPosrecord component.final StringtoString()Returns a string representation of this record class.intyStart()Returns the value of theyStartrecord component.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,LaputaState> STREAM_CODECOnly encodes the block state, as no other data is required by the client. TODO: is that a good idea to save bandwidth?
-
-
Constructor Details
-
LaputaState
public LaputaState(net.minecraft.world.level.block.state.BlockState blockState, Optional<net.minecraft.world.item.component.CustomData> blockEntityData, @Nullable @Nullable net.minecraft.core.BlockPos nextPos, int yStart, int i, int j, int k) Creates an instance of aLaputaStaterecord class.- Parameters:
blockState- the value for theblockStaterecord componentblockEntityData- the value for theblockEntityDatarecord componentnextPos- the value for thenextPosrecord componentyStart- the value for theyStartrecord componenti- the value for theirecord componentj- the value for thejrecord componentk- the value for thekrecord component
-
-
Method Details
-
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 '=='. -
blockState
public net.minecraft.world.level.block.state.BlockState blockState()Returns the value of theblockStaterecord component.- Returns:
- the value of the
blockStaterecord component
-
blockEntityData
Returns the value of theblockEntityDatarecord component.- Returns:
- the value of the
blockEntityDatarecord component
-
nextPos
@Nullable public @Nullable net.minecraft.core.BlockPos nextPos()Returns the value of thenextPosrecord component.- Returns:
- the value of the
nextPosrecord component
-
yStart
public int yStart()Returns the value of theyStartrecord component.- Returns:
- the value of the
yStartrecord component
-
i
public int i()Returns the value of theirecord component.- Returns:
- the value of the
irecord component
-
j
public int j()Returns the value of thejrecord component.- Returns:
- the value of the
jrecord component
-
k
public int k()Returns the value of thekrecord component.- Returns:
- the value of the
krecord component
-