updated player level

added /givestat command for owners (must use full string; Global.ExpEarned)
This commit is contained in:
Chiss 2014-11-07 22:10:41 +11:00
parent 5c6f12db20
commit c93862f299
7 changed files with 51 additions and 11 deletions

View File

@ -590,10 +590,10 @@ public enum Achievement
private static int[] getExperienceLevels()
{
int[] levels = new int[200];
int[] levels = new int[100];
for (int i=0 ; i<levels.length ; i++)
levels[i] = 2000 * i;
levels[i] = 2000 + 2000 * i;
return levels;
}

View File

@ -19,8 +19,8 @@ import mineplex.core.stats.StatsManager;
public enum AchievementCategory
{
GLOBAL("Global", null,
new String[] { "ExpEarned", "GemsEarned", null, "GamesPlayed", "TimeInGame" },
new String[] { "Mineplex Level", "Gems Earned", null, "Games Played", "Time In Game" },
new String[] { "GemsEarned", null, "GamesPlayed", "TimeInGame" },
new String[] { "Gems Earned", null, "Games Played", "Time In Game" },
Material.EMERALD, 0, GameCategory.GLOBAL, null),
//Survival

View File

@ -11,6 +11,7 @@ import mineplex.core.MiniClientPlugin;
import mineplex.core.account.event.RetrieveClientInformationEvent;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilServer;
import mineplex.core.stats.command.GiveStatCommand;
import mineplex.core.stats.command.TimeCommand;
import mineplex.core.stats.event.StatChangeEvent;
@ -182,5 +183,6 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
public void AddCommands()
{
AddCommand(new TimeCommand(this));
AddCommand(new GiveStatCommand(this));
}
}

View File

@ -0,0 +1,42 @@
package mineplex.core.stats.command;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.stats.StatsManager;
public class GiveStatCommand extends CommandBase<StatsManager>
{
public GiveStatCommand(StatsManager plugin)
{
super(plugin, Rank.OWNER, "givestat");
}
@Override
public void Execute(final Player caller, final String[] args)
{
if (args.length < 3)
{
UtilPlayer.message(caller, F.main("Stats", "/givestat <Target> <Name> <Amount>"));
return;
}
try
{
Player player = UtilPlayer.searchOnline(caller, args[0], true);
if (player == null)
return;
Plugin.incrementStat(player, args[1], Integer.parseInt(args[2]));
UtilPlayer.message(caller, F.main("Stats", "Applied " + F.elem(Integer.parseInt(args[2]) + " " + args[1]) + " to " + F.elem(player.getName()) + "."));
}
catch (Exception e)
{
UtilPlayer.message(caller, F.main("Stats", "/givestat <Name> <Amount>"));
}
}
}

View File

@ -615,7 +615,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
boolean ownsUltra = _donationManager.Get(player.getName()).OwnsUltraPackage();
//Level Prefix
String levelStr = ChatColor.WHITE + "" + _achievementManager.get(player, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel() + " ";
String levelStr = ChatColor.GRAY + "" + _achievementManager.get(player, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel() + " " + ChatColor.RESET;
//Rank Prefix
String rankStr = "";

View File

@ -61,11 +61,7 @@ public class GameChatManager implements Listener
ownsUltra= Manager.GetDonation().Get(sender.getName()).OwnsUnknownPackage(Manager.GetServerConfig().ServerType + " ULTRA");
//Level Prefix
String levelStr = "";
if (!Manager.GetGame().IsLive())
{
levelStr = ChatColor.WHITE + "" + Manager.GetAchievement().get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel() + " ";
}
String levelStr = ChatColor.GRAY + "" + Manager.GetAchievement().get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel() + " " + ChatColor.RESET;
//Rank Prefix
String rankStr = "";

View File

@ -46,7 +46,7 @@ public class ExperienceStatTracker extends StatTracker<Game>
gems += (int)gem.Gems;
//Game Time
double time = (int) ((System.currentTimeMillis() - _startTime)/60000d);
double time = (System.currentTimeMillis() - _startTime)/60000d;
//Mult
double mult = 1;