Skip to content

Commit

Permalink
get rid of useless method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jsinco committed Jan 11, 2025
1 parent 6c1f231 commit d17062c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/dre/brewery/BPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public BPlayer(UUID uuid) {
@Nullable
public static BPlayer get(OfflinePlayer player) {
if (!players.isEmpty()) {
return players.get(BUtil.playerString(player));
return players.get(player.getUniqueId().toString());
}
return null;
}
Expand Down Expand Up @@ -156,18 +156,18 @@ public static boolean isEmpty() {
}

public static boolean hasPlayer(OfflinePlayer player) {
return players.containsKey(BUtil.playerString(player));
return players.containsKey(player.getUniqueId().toString());
}

// Create a new BPlayer and add it to the list
public static BPlayer addPlayer(OfflinePlayer player) {
BPlayer bPlayer = new BPlayer(BUtil.playerString(player));
players.put(BUtil.playerString(player), bPlayer);
BPlayer bPlayer = new BPlayer(player.getUniqueId());
players.put(player.getUniqueId().toString(), bPlayer);
return bPlayer;
}

public static void remove(OfflinePlayer player) {
players.remove(BUtil.playerString(player));
players.remove(player.getUniqueId().toString());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public boolean persist() {
@Override
public String onRequest(OfflinePlayer player, @NotNull String params) {
BPlayer bPlayer = BPlayer.get(player);
if (bPlayer == null) bPlayer = new BPlayer(BUtil.playerString(player));
if (bPlayer == null) bPlayer = new BPlayer(player.getUniqueId());

String[] args = params.split("_");

Expand Down
7 changes: 0 additions & 7 deletions src/main/java/com/dre/brewery/utility/BUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,6 @@ public static void setItemInHand(PlayerInteractEvent event, Material mat, boolea
}
}

/**
* Returns either uuid or Name of player, depending on bukkit version
*/
public static String playerString(OfflinePlayer player) {
return player.getUniqueId().toString();
}


/**
* returns the Player if online
Expand Down

0 comments on commit d17062c

Please sign in to comment.