Skip to content

Commit

Permalink
Added deprecated methods from API that were removed.
Browse files Browse the repository at this point in the history
Fix update module for 2.0.0.
Change to Version validation.
Move to 2.1.0 snapshots.
  • Loading branch information
Mitsugaru committed May 15, 2014
1 parent df85219 commit 383310d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Project properties. -->
<groupId>org.black_ixx</groupId>
<artifactId>PlayerPoints</artifactId>
<version>2.0.0</version>
<version>2.1.0-SNAPSHOT</version>
<name>PlayerPoints</name>
<description>Player points system for Bukkit</description>
<!-- Source code management URL. -->
Expand Down
50 changes: 50 additions & 0 deletions src/org/black_ixx/playerpoints/PlayerPointsAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ public boolean give(UUID playerId, int amount) {
return false;
}

@Deprecated
public boolean give(String playerName, int amount) {
boolean success = false;
if(playerName != null) {
success = give(plugin.translateNameToUUID(playerName), amount);
}
return success;
}

/**
* Take points from specified player. If the amount given is not already
* negative, we make it negative.
Expand All @@ -66,6 +75,15 @@ public boolean take(UUID playerId, int amount) {
}
return give(playerId, take);
}

@Deprecated
public boolean take(String playerName, int amount) {
boolean success = false;
if(playerName != null) {
success = take(plugin.translateNameToUUID(playerName), amount);
}
return success;
}

/**
* Look up the current points of a player, if available. If player does not
Expand All @@ -78,6 +96,11 @@ public boolean take(UUID playerId, int amount) {
public int look(UUID playerId) {
return plugin.getModuleForClass(StorageHandler.class).getPoints(playerId.toString());
}

@Deprecated
public int look(String playerName) {
return look(plugin.translateNameToUUID(playerName));
}

/**
* Transfer points from one player to another. Attempts to take the points,
Expand All @@ -97,6 +120,15 @@ public boolean pay(UUID source, UUID target, int amount) {
}
return false;
}

@Deprecated
public boolean pay(String sourceName, String targetName, int amount) {
boolean success = false;
if(sourceName != null && targetName != null) {
success = pay(plugin.translateNameToUUID(sourceName), plugin.translateNameToUUID(targetName), amount);
}
return success;
}

/**
* Sets a player's points to a given value.
Expand All @@ -118,6 +150,15 @@ public boolean set(UUID playerId, int amount) {
}
return false;
}

@Deprecated
public boolean set(String playerName, int amount) {
boolean success = false;
if(playerName != null) {
success = set(plugin.translateNameToUUID(playerName), amount);
}
return success;
}

/**
* Reset a player's points by removing their entry from the config.
Expand All @@ -135,4 +176,13 @@ public boolean reset(UUID playerId) {
}
return false;
}

@Deprecated
public boolean reset(String playerName, int amount) {
boolean success = false;
if(playerName != null) {
success = reset(plugin.translateNameToUUID(playerName));
}
return success;
}
}
4 changes: 2 additions & 2 deletions src/org/black_ixx/playerpoints/services/version/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public boolean validate() {
valid = valid && StringUtils.countMatches(version, "-") <= 1;
valid = valid && StringUtils.countMatches(version, "+") <= 1;
} catch(IndexOutOfBoundsException e) {

valid = false;
} catch(NumberFormatException e) {

valid = false;
}
return valid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class TwoZeroZeroUpdate extends UpdateModule {
public TwoZeroZeroUpdate(PlayerPoints plugin) {
super(plugin);
targetVersion = new Version("2.0.0");
targetVersion.setIgnorePatch(true);
}

@Override
Expand Down

0 comments on commit 383310d

Please sign in to comment.