1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-21 19:22:59 +01:00

My OCD made me do it.

This commit is contained in:
gmcferrin
2013-01-09 23:03:17 -05:00
parent c60cbe824c
commit e193da2cd7
57 changed files with 276 additions and 276 deletions

View File

@@ -13,7 +13,7 @@ public class Page {
public static int getTotalPageNumber(String address)
{
String[] addressSplit = LocaleLoader.getString(address).split("\n");
if(addressSplit.length <= 8)
if (addressSplit.length <= 8)
return 1;
return (addressSplit.length/8)+1;
@@ -24,7 +24,7 @@ public class Page {
int pageIndexStart = 0;
//Determine what string to start at
if(pagenum > 1)
if (pagenum > 1)
{
pageIndexStart = 8*(pagenum-1);
}
@@ -36,9 +36,9 @@ public class Page {
//Add targeted strings
while(allStrings.size() < 9)
while (allStrings.size() < 9)
{
if(pageIndexStart+allStrings.size() > split.length)
if (pageIndexStart+allStrings.size() > split.length)
allStrings.add("");
else
allStrings.add(split[pageIndexStart+allStrings.size()-1]);
@@ -62,19 +62,19 @@ public class Page {
player.sendMessage(ChatColor.DARK_AQUA+"Guide for "+capitalized+" available type /"+skilltype.toString().toLowerCase()+" ? [Page#]"); //TODO: Needs more locale.
if (args.length >= 1)
{
if(args[0].equals("?"))
if (args[0].equals("?"))
{
String address = "Guides."+capitalized;
if(args.length > 1 && Misc.isInt(args[1]) && Misc.getInt(args[1]) <= Page.getTotalPageNumber(address))
if (args.length > 1 && Misc.isInt(args[1]) && Misc.getInt(args[1]) <= Page.getTotalPageNumber(address))
{
Page.clearChat(player);
for(String target : Page.grabPageContents(capitalized+" Guide", address, Misc.getInt(args[1])))
{
player.sendMessage(target);
}
} else if(args.length == 1)
} else if (args.length == 1)
{
Page.clearChat(player);
for(String target : Page.grabPageContents(capitalized+" Guide", address, 1))
@@ -82,11 +82,11 @@ public class Page {
player.sendMessage(target);
}
}
else if(args.length > 1 && Misc.getInt(args[1]) > Page.getTotalPageNumber(address))
else if (args.length > 1 && Misc.getInt(args[1]) > Page.getTotalPageNumber(address))
{
player.sendMessage("That page doesn't exist, there are only "+Page.getTotalPageNumber(address)+" total pages"); //TODO: Needs more locale.
}
else if(args.length > 1 && !Misc.isInt(args[1]))
else if (args.length > 1 && !Misc.isInt(args[1]))
{
player.sendMessage("Not a valid page number!"); //TODO: Needs more locale.
}