Record Class BarricadeData
java.lang.Object
java.lang.Record
net.modgarden.barricade.data.BarricadeData
public record BarricadeData(Optional<net.minecraft.network.chat.Component> name, BlockedDirections directions, Optional<net.minecraft.resources.Identifier> icon, Optional<net.minecraft.resources.Identifier> itemIcon, Optional<net.minecraft.resources.Identifier> itemBackground, Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.core.Holder<BarricadeData>> static BarricadeDatastatic final com.mojang.serialization.Codec<BarricadeData> static final net.minecraft.core.IdMapper<net.minecraft.core.Holder<BarricadeData>> static final net.minecraft.world.level.chunk.Strategy<net.minecraft.core.Holder<BarricadeData>> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, net.minecraft.core.Holder<BarricadeData>> static final BarricadeDatastatic final net.minecraft.core.Holder<BarricadeData> static final net.minecraft.resources.Identifier -
Constructor Summary
ConstructorsConstructorDescriptionBarricadeData(Optional<net.minecraft.network.chat.Component> name, BlockedDirections directions, Optional<net.minecraft.resources.Identifier> icon, Optional<net.minecraft.resources.Identifier> itemIcon, Optional<net.minecraft.resources.Identifier> itemBackground, Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition) Creates an instance of aBarricadeDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> Returns the value of theconditionrecord component.Returns the value of thedirectionsrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.Optional<net.minecraft.resources.Identifier> icon()Returns the value of theiconrecord component.Optional<net.minecraft.resources.Identifier> Returns the value of theitemBackgroundrecord component.Optional<net.minecraft.resources.Identifier> itemIcon()Returns the value of theitemIconrecord component.Optional<net.minecraft.network.chat.Component> name()Returns the value of thenamerecord component.booleantest(@NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.entity.Entity entity, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
UNKNOWN_HOLDER
-
UNKNOWN_ICON
public static final net.minecraft.resources.Identifier UNKNOWN_ICON -
UNKNOWN
-
DIRECT_CODEC
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, net.minecraft.core.Holder<BarricadeData>> STREAM_CODEC -
ID_MAPPER
-
STRATEGY
public static final net.minecraft.world.level.chunk.Strategy<net.minecraft.core.Holder<BarricadeData>> STRATEGY
-
-
Constructor Details
-
BarricadeData
public BarricadeData(Optional<net.minecraft.network.chat.Component> name, BlockedDirections directions, Optional<net.minecraft.resources.Identifier> icon, Optional<net.minecraft.resources.Identifier> itemIcon, Optional<net.minecraft.resources.Identifier> itemBackground, Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition) Creates an instance of aBarricadeDatarecord class.- Parameters:
name- the value for thenamerecord componentdirections- the value for thedirectionsrecord componenticon- the value for theiconrecord componentitemIcon- the value for theitemIconrecord componentitemBackground- the value for theitemBackgroundrecord componentcondition- the value for theconditionrecord component
-
-
Method Details
-
test
public boolean test(@NotNull @NotNull net.minecraft.world.level.Level level, @NotNull @NotNull net.minecraft.world.entity.Entity entity, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos) -
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). -
hashCode
-
toString
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
directions
Returns the value of thedirectionsrecord component.- Returns:
- the value of the
directionsrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
itemIcon
Returns the value of theitemIconrecord component.- Returns:
- the value of the
itemIconrecord component
-
itemBackground
Returns the value of theitemBackgroundrecord component.- Returns:
- the value of the
itemBackgroundrecord component
-
condition
public Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition()Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-