-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce NULL-VALUE for MemoryPlayerDB (see #934)
- Loading branch information
Showing
2 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/uuid/NullPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package us.talabrek.ultimateskyblock.uuid; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.OfflinePlayer; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
public class NullPlayer implements OfflinePlayer { | ||
public static final NullPlayer INSTANCE = new NullPlayer(); | ||
private NullPlayer() { | ||
} | ||
|
||
@Override | ||
public boolean isOnline() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return PlayerDB.UNKNOWN_PLAYER_NAME; | ||
} | ||
|
||
@Override | ||
public UUID getUniqueId() { | ||
return PlayerDB.UNKNOWN_PLAYER_UUID; | ||
} | ||
|
||
@Override | ||
public boolean isBanned() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void setBanned(boolean b) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isWhitelisted() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void setWhitelisted(boolean b) { | ||
|
||
} | ||
|
||
@Override | ||
public Player getPlayer() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getFirstPlayed() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getLastPlayed() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public boolean hasPlayedBefore() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public Location getBedSpawnLocation() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Map<String, Object> serialize() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isOp() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void setOp(boolean b) { | ||
|
||
} | ||
} |