Finally fixed(?) the undecided case

This commit is contained in:
Norbi Peti 2015-08-10 21:29:09 +02:00
parent 9a4677da5b
commit 543e7c3d7e
18 changed files with 15 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View file

@ -22,4 +22,5 @@ INDEX VERSION 1.126+D:\Z - Norbi cucca\0 Projektek\TheButtonMCAutoFlairProto\Spi
3954291735.index
994834796.index
3604769962.index
1508644233.index
3656756579.index

Binary file not shown.

View file

@ -25,7 +25,12 @@ public class Commands implements CommandExecutor {
//if(!PluginMain.PlayerFlairs.containsKey(player.getName()))
if(p.Flair==null)
{
player.sendMessage("Error: You need to write your username to the reddit thread at /r/TheButtonMinecraft");
player.sendMessage("§cError: You need to write your username to the reddit thread at /r/TheButtonMinecraft§r");
return true;
}
if(!p.FlairRecognised)
{ //2015.08.10.
player.sendMessage("Sorry, but your flair isn't recorded. Please ask a mod to set it for you.");
return true;
}
switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09.

View file

@ -10,6 +10,7 @@ public class MaybeOfflinePlayer
public boolean AcceptedFlair;
public boolean IgnoredFlair;
public boolean FlairDecided; //2015.08.09.
public boolean FlairRecognised; //2015.08.10.
public static HashMap<String, MaybeOfflinePlayer> AllPlayers=new HashMap<>(); //2015.08.08.
public static MaybeOfflinePlayer AddPlayerIfNeeded(String playername)
{

View file

@ -95,8 +95,8 @@ public class PluginMain extends JavaPlugin
flair="";
if (flair != "-1")
flair = flair + "s";
else
flair = "non-presser";
/*else
flair = "non-presser";*/
String flairclass;
if(flairdata.length>2)
flairclass = flairdata[2];
@ -141,6 +141,7 @@ public class PluginMain extends JavaPlugin
MaybeOfflinePlayer p=MaybeOfflinePlayer.AddPlayerIfNeeded(playername); //2015.08.08.
String finalflair;
p.FlairDecided=true;
p.FlairRecognised=true;
switch(flairclass)
{
case "press-1":
@ -171,7 +172,10 @@ public class PluginMain extends JavaPlugin
finalflair="§r(can't press)§r";
break;
case "unknown":
p.FlairDecided=false;
if(text.equals("-1")) //If true, only non-presser/can't press; if false, any flair
p.FlairDecided=false;
else
p.FlairRecognised=false;
finalflair="";
break;
default: