Record Class PositionedBlock
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.block.PositionedBlock
- All Implemented Interfaces:
BlockCollection, CustomRegistryOwnTypeProvider<io.netty.buffer.ByteBuf, BlockCollection>, CustomRegistryValue<io.netty.buffer.ByteBuf, BlockCollection>, RefOptimizer<BlockCollection>, WithKey, WithRef<BlockCollection>
public record PositionedBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
extends Record
implements BlockCollection
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PositionedBlock> static final DataType<PositionedBlock> static final DataType<List<PositionedBlock>> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, List<PositionedBlock>> static final com.mojang.serialization.MapCodec<PositionedBlock> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, PositionedBlock> static final DynamicType<io.netty.buffer.ByteBuf, BlockCollection> Fields inherited from interface BlockCollection
EMPTY, REGISTRYFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionPositionedBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Creates an instance of aPositionedBlockrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.core.BlockPospos()Returns the value of theposrecord component.net.minecraft.world.level.block.state.BlockStatestate()Returns the value of thestaterecord component.toString()Returns a string representation of this record class.Methods inherited from interface BlockCollection
getRegistryMethods inherited from interface CustomRegistryOwnTypeProvider
typeMethods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface RefOptimizer
optimize
-
Field Details
-
MAP_CODEC
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, PositionedBlock> STREAM_CODEC -
LIST_STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, List<PositionedBlock>> LIST_STREAM_CODEC -
DATA_TYPE
-
LIST_DATA_TYPE
-
TYPE
-
-
Constructor Details
-
PositionedBlock
public PositionedBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Creates an instance of aPositionedBlockrecord class.- Parameters:
pos- the value for theposrecord componentstate- the value for thestaterecord component
-
-
Method Details
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
pos
public net.minecraft.core.BlockPos pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
state
public net.minecraft.world.level.block.state.BlockState state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-