public class MatchingBlocksPredicate extends StateTestingPredicate {
13
public static final MapCodec<MatchingBlocksPredicate> CODEC = RecordCodecBuilder.mapCodec(
14
i -> stateTestingCodec(i).and(RegistryCodecs.holderSet(Registries.BLOCK).fieldOf("blocks").forGetter(c -> c.blocks)).apply(i, MatchingBlocksPredicate::new)
15
);
16
private final HolderSet<Block> blocks;
17
18
public MatchingBlocksPredicate(final Vec3i offset, final HolderSet<Block> blocks) {
19
super(offset);
20
this.blocks = blocks;
21
}
22
23
@Override
24
protected boolean test(final BlockState state) {
25
return state.is(this.blocks);
26
}
27
28
@Override
29
public BlockPredicateType<?> type() {
30
return BlockPredicateType.MATCHING_BLOCKS;
31
}
32
}
33
Decompiled Minecraft 26.3 source of MatchingBlocksPredicate (net/minecraft/world/level/levelgen/blockpredicates/MatchingBlocksPredicate.java) with Mojang official mappings, stored verbatim on the site.