Record Class BlockedDirections
java.lang.Object
java.lang.Record
net.modgarden.barricade.data.BlockedDirections
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlockedDirections> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, BlockedDirections> -
Constructor Summary
ConstructorsConstructorDescriptionBlockedDirections(EnumSet<net.minecraft.core.Direction> directions) Creates an instance of aBlockedDirectionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockedDirectionsall()booleanblocks(net.minecraft.core.Direction direction) booleanEnumSet<net.minecraft.core.Direction> Returns the value of thedirectionsrecord component.booleanbooleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static BlockedDirectionsof(net.minecraft.core.Direction... directions) booleanshouldBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext context) final StringtoString()Returns a string representation of this record class.Set<net.minecraft.core.Direction> union(BlockedDirections other)
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, BlockedDirections> STREAM_CODEC
-
-
Constructor Details
-
BlockedDirections
Creates an instance of aBlockedDirectionsrecord class.- Parameters:
directions- the value for thedirectionsrecord component
-
-
Method Details
-
of
-
all
-
shouldBlock
public boolean shouldBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext context) -
doesNotBlock
public boolean doesNotBlock() -
blocksAll
public boolean blocksAll() -
blocks
public boolean blocks(net.minecraft.core.Direction direction) -
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). -
union
-
toString
-
hashCode
-
directions
Returns the value of thedirectionsrecord component.- Returns:
- the value of the
directionsrecord component
-