Solved Getting Player's Line of Sight

Discussion in 'Plugin Development' started by ShadowLAX, Dec 16, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    ShadowLAX

    Hello Bukkit. Recently, Bukkit has deprecated the getLineOfSight() method in 1.7.2, and I don't know if there was a replacement for that method or not. In other words, with 1.7.2 Bukkit, how would I get the block a player is looking at?

    Thanks!
     
  2. Offline

    RawCode

    Code:
        public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance) {
            return getLineOfSight(transparent, maxDistance, 0);
        }
    not deprecated inside CraftEntity.
     
  3. Offline

    Not2EXceL

  4. Offline

    RawCode

    Not2EXceL
     
  5. Offline

    Not2EXceL

    RawCode
    You did say CraftEntity....

    Anyways yeah I saw that afterwards. But not gonna argue over a semantics issue.
     
  6. Offline

    RawCode

    there is no reason for that method deprecation, since no alternative provided, i will recommnent to ignore that annotation.
     
  7. Offline

    ShadowLAX

    Not2EXceL Ok, thanks for the help. Using this, how would I get the block the player is looking at? :s

    EDIT: Or in other words, how would I get the location that the player is looking at
     
  8. Offline

    The_Doctor_123

    ShadowLAX
    There's a method for that already. Use getTargetBlock() in LivingEntity.
     
  9. Offline

    ShadowLAX

    The_Doctor_123 That is deprecated as well.

    EDIT: Ah, I figured it out. Thanks though.
     
  10. Offline

    The_Doctor_123

    ShadowLAX
    Just because it's deprecated doesn't mean you can't use it.
     
  11. Offline

    Ronbo

    ShadowLAX
    Fyi it's usually fine to use things that are deprecated if there is no easy alternative. You can even suppress deprecation warnings in Eclipse.
     
  12. Offline

    ShadowLAX

    The_Doctor_123 Ronbo Thanks for telling me that, I had no idea. I thought it meant if you use them your server will internally explode. :s
     
  13. Offline

    The_Doctor_123

    ShadowLAX
    Some methods are deprecated for better reasons. Although, all the ones associated to magic numbers should be fine to use.
     
Thread Status:
Not open for further replies.

Share This Page