package openonyx.interaction.internal; import java.util.Comparator; import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import net.minecraft.util.Vec3i; import openonyx.core.MinecraftAccess; import openonyx.interaction.BlockUtils; import openonyx.utilities.BoxUtils; import openonyx.utilities.PlayerUtils; public class PlacementSearchPattern implements MinecraftAccess { private final List vec3is; private final Comparator comparator; public static PlacementSearchPattern L() { return new PlacementSearchPattern(PlacementOffset.NO_OFFSET.getBlockPosList(), Comparator.comparingDouble(blockPos -> { BlockPos blockPos1 = blockPos; Vec3 vec3 = PlayerUtils.D((Entity)mc.thePlayer); return -BoxUtils.L(BlockUtils.L(blockPos1).offset(blockPos1.getX(), blockPos1.getY(), blockPos1.getZ()), vec3); })); } public List getVec3is() { return this.vec3is; } public Comparator getComparator() { return this.comparator; } public PlacementSearchPattern(List list, Comparator comparator) { this.vec3is = list; this.comparator = comparatorx; } }