Skip to content

Instantly share code, notes, and snippets.

@nidefawl
Created November 27, 2015 01:03
Show Gist options
  • Save nidefawl/10ecac2b4091719732e8 to your computer and use it in GitHub Desktop.
Save nidefawl/10ecac2b4091719732e8 to your computer and use it in GitHub Desktop.
ReturnCost Craftland
public static double getReturnCosts(ModPlayer cmdUser) {
long fullhoursplayed = cmdUser.getFullHoursPlayed();
if (fullhoursplayed < 12) {
return 0;
}
long fullDays = 1 + (fullhoursplayed/24);
double price = Math.min(1500, fullDays*200);
int r = cmdUser.getPremiumRank();
if (r >= 5)
return 100;
if (r >= 4)
return Math.min(price, 500);
if (r >= 3)
return Math.min(price, 800);
if (r >= 2)
return Math.min(price, 1000);
return price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment