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 3954291735.index
994834796.index 994834796.index
3604769962.index 3604769962.index
1508644233.index
3656756579.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(!PluginMain.PlayerFlairs.containsKey(player.getName()))
if(p.Flair==null) 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; return true;
} }
switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09. switch(args[0].toLowerCase()) //toLowerCase: 2015.08.09.

View file

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

View file

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