Skip to content

Instantly share code, notes, and snippets.

@Justin42
Created May 31, 2012 18:34
Show Gist options
  • Save Justin42/2845299 to your computer and use it in GitHub Desktop.
Save Justin42/2845299 to your computer and use it in GitHub Desktop.
public List<String> infoReplace(List<String> infoList) {
List<String> newInfoList = new ArrayList<String>();
Iterator<String> infoIterator = infoList.iterator();
while(infoIterator.hasNext()) {
String info = infoIterator.next();
if(info == "%enchantinfo%" && itemStack.getEnchantments().isEmpty()) {
continue;
}
info = info.replace("%owner%", owner.getName());
info = info.replace("%quantity%", String.valueOf(itemStack.getAmount()));
info = info.replace("%item%", itemStack.getType().name());
info = info.replace("%bid%", String.format("%,.2f", currentBid));
info = info.replace("%winner%", currentWinner.getName());
info = info.replace("%winner%", "None");
newInfoList.add(info);
}
return newInfoList;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment