Solved UUID registering as double?

Discussion in 'Plugin Development' started by moo3oo3oo3, Nov 25, 2014.

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

    moo3oo3oo3

    I'm trying to test if a player is equal to a UUID but eclipse is giving me errors saying it's a double. How do I fix this?
    Code:java
    1. UUID jason = 069a79f4-44e9-4726-a5be-fca90e38aaf5;
    2. //Giving me errors telling me it's a double^
     
  2. Offline

    Skionz

    moo3oo3oo3
    Code:java
    1. UUID jason = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5");
     
    Dragonphase and mine-care like this.
  3. Offline

    moo3oo3oo3

    How would I check to see if a player matches a certain UUID

    I tried
    Code:java
    1. if (player.getUniqueId() == UUID.fromString("1c8419f1-03c3-46db-8a6e-41adbb8ddb8e")) {
    but it doesn't seem to be triggering.
     
  4. Offline

    Skionz

    moo3oo3oo3
    Code:
    if(player.getUniqueId().equals(yourUUID);
     
  5. Offline

    teej107

    moo3oo3oo3 Use .equals() to compare Objects. == for null checks and primitives.
     
  6. Offline

    moo3oo3oo3

    Eclipse is giving me errors saying to delete part of my UUID
    Code:java
    1. if (player.getUniqueId().equals(ed0d11a5-7e7a-47e2-8baa-656273f35dac)) {
     
  7. Offline

    Skionz

    moo3oo3oo3 You have to compare the players UUID to another instance of the UUID class.
     
Thread Status:
Not open for further replies.

Share This Page