Java Code Examples for net.minecraft.entity.player.PlayerEntity#pick()

The following examples show how to use net.minecraft.entity.player.PlayerEntity#pick() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenderMiningLaser.java    From MiningGadgets with MIT License 4 votes vote down vote up
public static void renderLaser(RenderWorldLastEvent event, PlayerEntity player, float ticks) {
    ItemStack stack = MiningGadget.getGadget(player);

    if (!MiningProperties.getCanMine(stack))
        return;

    int range = MiningProperties.getBeamRange(stack);

    Vec3d playerPos = player.getEyePosition(ticks);
    RayTraceResult trace = player.pick(range, 0.0F, false);

    // parse data from item
    float speedModifier = getSpeedModifier(stack);

    drawLasers(event, playerPos, trace, 0, 0, 0, MiningProperties.getColor(stack, MiningProperties.COLOR_RED) / 255f, MiningProperties.getColor(stack, MiningProperties.COLOR_GREEN) / 255f, MiningProperties.getColor(stack, MiningProperties.COLOR_BLUE) / 255f, 0.02f, player, ticks, speedModifier);
}
 
Example 2
Source File: RenderMiningLaser2.java    From MiningGadgets with MIT License 4 votes vote down vote up
public static void renderLaser(RenderWorldLastEvent event, PlayerEntity player, float ticks) {
    ItemStack stack = MiningGadget.getGadget(player);

    if (!MiningProperties.getCanMine(stack))
        return;

    int range = MiningProperties.getBeamRange(stack);

    Vec3d playerPos = player.getEyePosition(ticks);
    RayTraceResult trace = player.pick(range, 0.0F, false);

    // parse data from item
    float speedModifier = getSpeedModifier(stack);

    drawLasers(event, playerPos, trace, 0, 0, 0, MiningProperties.getColor(stack, MiningProperties.COLOR_RED) / 255f, MiningProperties.getColor(stack, MiningProperties.COLOR_GREEN) / 255f, MiningProperties.getColor(stack, MiningProperties.COLOR_BLUE) / 255f, 0.02f, player, ticks, speedModifier);
}