Record Class BlockAndFilter
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.block.filter.BlockAndFilter
- All Implemented Interfaces:
BlockFilter, BlockPredicate, SimpleBlockPredicate, CustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, BlockFilter>, CustomRegistryValue<net.minecraft.network.RegistryFriendlyByteBuf, BlockFilter>, RefOptimizer<BlockFilter>, WithKey, WithRef<BlockFilter>, Predicate<net.minecraft.world.level.block.state.pattern.BlockInWorld>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, BlockFilter> Fields inherited from interface BlockFilter
ANY, CODEC, DATA_TYPE, EXPOSED, FLUID, NONE, PARTIAL, REGISTRY, STREAM_CODEC, VISIBLEFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionBlockAndFilter(List<Ref<BlockFilter>> filters) Creates an instance of aBlockAndFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionand(BlockFilter filter) final booleanIndicates whether some other object is "equal to" this one.filters()Returns the value of thefiltersrecord component.final inthashCode()Returns a hash code value for this object.booleantest(net.minecraft.world.level.block.state.pattern.BlockInWorld block) booleantest(net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) final StringtoString()Returns a string representation of this record class.DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, BlockFilter> type()Methods inherited from interface BlockFilter
getRegistry, not, orMethods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface RefOptimizer
optimize
-
Field Details
-
TYPE
-
-
Constructor Details
-
BlockAndFilter
Creates an instance of aBlockAndFilterrecord class.- Parameters:
filters- the value for thefiltersrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, BlockFilter>
-
test
-
test
public boolean test(net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) - Specified by:
testin interfaceBlockPredicate- Specified by:
testin interfaceSimpleBlockPredicate
-
and
- Specified by:
andin interfaceBlockFilter
-
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). -
filters
Returns the value of thefiltersrecord component.- Returns:
- the value of the
filtersrecord component
-