Bukkit Location and the checking if equal

Discussion in 'Plugin Development' started by Mr Burkes, Jun 21, 2014.

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

    Mr Burkes

    If I instantiate a Location:

    Code:
    new Location(world, x, y, z)
    and it is at the same location as a Location that I read and instantiate from file data, when comparing the location using the .equals() method:

    Code:
    loc1.equals(loc2)
    will it return true?
     
  2. Offline

    ReggieMOL

  3. Offline

    xTigerRebornx

  4. Code:Java
    1.  
    2. Location loc = new Location(world, x, y, z);
    3. Location loc2 = new Location(Bukkit.getWorld(getConfig().getString("world")), getConfig().getDouble("x"), getConfig().getDouble("y"), getConfig().getDouble("z"));
    4. if (loc.equals(new Location())) {
    5. //Location is equal
    6. }
    7.  
     
Thread Status:
Not open for further replies.

Share This Page