Search in sources :

Example 1 with StatePredicate

use of net.minecraft.predicate.StatePredicate in project frame-fabric by moddingplayground.

the class AbstractBlockLootTableGenerator method checkDoublePlantHalf.

public static LocationCheckLootCondition.Builder checkDoublePlantHalf(Block plant, DoubleBlockHalf half) {
    int d = half == DoubleBlockHalf.UPPER ? 1 : -1;
    StatePredicate expectState = stateProp(TallPlantBlock.HALF, half).build();
    return LocationCheckLootCondition.builder(LocationPredicate.Builder.create().block(BlockPredicate.Builder.create().blocks(plant).state(expectState).build()), new BlockPos(0, d, 0));
}
Also used : BlockPos(net.minecraft.util.math.BlockPos) StatePredicate(net.minecraft.predicate.StatePredicate)

Aggregations

StatePredicate (net.minecraft.predicate.StatePredicate)1 BlockPos (net.minecraft.util.math.BlockPos)1