Skip to content

Commit

Permalink
NPE on /dev remove when player is offline
Browse files Browse the repository at this point in the history
  • Loading branch information
rlf committed Dec 13, 2014
1 parent 7f903f4 commit 499ff09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 39 deletions.
37 changes: 0 additions & 37 deletions src/main/java/us/talabrek/ultimateskyblock/PlayerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,6 @@ public void setLeaveParty() {
}
}

private Location getLocationString(final String s) {
if (s == null || s.trim() == "") {
return null;
}
final String[] parts = s.split(":");
if (parts.length >= 4) {
final World w = Bukkit.getServer().getWorld(parts[0]);
final int x = Integer.parseInt(parts[1]);
final int y = Integer.parseInt(parts[2]);
final int z = Integer.parseInt(parts[3]);
float yaw = parts.length == 6 ? Float.parseFloat(parts[4]) : 0;
float pitch = parts.length == 6 ? Float.parseFloat(parts[5]) : 0;
return new Location(w, (double) x, (double) y, (double) z, yaw, pitch);
}
return null;
}

private String getPartyLocationString(Location l) {
if (l == null) {
return null;
Expand Down Expand Up @@ -178,17 +161,6 @@ public int checkChallenge(final String challenge) {
return 0;
}

public int checkChallengeSinceTimer(final String challenge) {
try {
String challengeKey = challenge.toLowerCase();
if (onChallengeCooldown(challengeKey) && challenges.containsKey(challengeKey)) {
return challenges.get(challengeKey).getTimesCompletedSinceTimer();
}
} catch (ClassCastException ex) {
}
return 0;
}

public ChallengeCompletion getChallenge(final String challenge) {
return challenges.get(challenge.toLowerCase());
}
Expand All @@ -209,15 +181,6 @@ public void buildChallengeList() {
uSkyBlock.getInstance().getChallengeLogic().populateChallenges(challenges);
}

private String getStringLocation(final Location l) {
if (l == null) {
return "";
}
return String.valueOf(l.getWorld().getName()) + ":"
+ l.getBlockX() + ":" + l.getBlockY() + ":" + l.getBlockZ()
+ ":" + l.getYaw() + ":" + l.getPitch();
}

public Location getPartyIslandLocation() {
return partyIslandLocation != null ? partyIslandLocation.clone() : null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/us/talabrek/ultimateskyblock/uSkyBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ public void deletePlayerIsland(final String player) {
regionManager.removeRegion(player + "Island");
}
orphaned.push(pi.getIslandLocation());
this.removeIsland(this.getActivePlayers().get(player).getIslandLocation());
this.deleteIslandConfig(this.getActivePlayers().get(player).locationForParty());
removeIsland(pi.getIslandLocation());
deleteIslandConfig(pi.locationForParty());
pi.removeFromIsland();
pi.savePlayerConfig(player);
this.saveOrphans();
Expand Down

0 comments on commit 499ff09

Please sign in to comment.