Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
CoderTim 2014-08-26 20:27:51 -04:00
commit 5ef2772abd
9 changed files with 33 additions and 18 deletions

View File

@ -184,7 +184,7 @@ public enum Achievement
AchievementCategory.CASTLE_SIEGE), AchievementCategory.CASTLE_SIEGE),
CASTLE_SIEGE_KINGSLAYER("Kingslayer", 800, CASTLE_SIEGE_KINGSLAYER("Kingslayer", 800,
new String[] {"Castle Siege.Kingslayer"}, new String[] {"Castle Siege.KingSlayer"},
new String[] {"Get the killing blow on the King"}, new String[] {"Get the killing blow on the King"},
new int[] {1}, new int[] {1},
AchievementCategory.CASTLE_SIEGE), AchievementCategory.CASTLE_SIEGE),
@ -372,7 +372,7 @@ public enum Achievement
//Death Tag //Death Tag
DEATH_TAG_WINS("Death Proof", 600, DEATH_TAG_WINS("Death Proof", 600,
new String[] {"Death Tag.Wins"}, new String[] {"Death Tag.Wins"},
new String[] {"Win 50 games of Turf Wars"}, new String[] {"Win 50 games of Death Tag"},
new int[] {50}, new int[] {50},
AchievementCategory.DEATH_TAG), AchievementCategory.DEATH_TAG),

View File

@ -70,7 +70,7 @@ public class AchievementPage extends ShopPageBase<AchievementManager, Achievemen
} }
{ {
Material material = hasUnlocked ? Material.EMERALD : Material.INK_SACK; Material material = hasUnlocked ? Material.EXP_BOTTLE : Material.GLASS_BOTTLE;
String itemName = (hasUnlocked ? C.cGreen : C.cRed) + achievement.getName(); String itemName = (hasUnlocked ? C.cGreen : C.cRed) + achievement.getName();
if (!singleLevel) if (!singleLevel)
@ -103,7 +103,7 @@ public class AchievementPage extends ShopPageBase<AchievementManager, Achievemen
} }
AddItem(currentIndex, new ShopItem(material, (byte) (hasUnlocked ? 0 : 8), itemName, lore.toArray(new String[0]), 1, false, false)); AddItem(currentIndex, new ShopItem(material, (byte) (hasUnlocked ? 0 : 0), itemName, lore.toArray(new String[0]), 1, false, false));
} }
masterAchievementLore.add((hasUnlocked ? C.cGreen : C.cRed) + achievement.getName()); masterAchievementLore.add((hasUnlocked ? C.cGreen : C.cRed) + achievement.getName());

View File

@ -85,6 +85,9 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
if (event.getType() != UpdateType.SLOW) if (event.getType() != UpdateType.SLOW)
return; return;
if (_polls.size() == 0)
return;
for (Player player : _plugin.getServer().getOnlinePlayers()) for (Player player : _plugin.getServer().getOnlinePlayers())
{ {
PlayerPollData pollData = Get(player); PlayerPollData pollData = Get(player);
@ -147,7 +150,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
} }
} }
player.sendMessage(""); player.sendMessage("");
player.sendMessage("Click an answer to receive " + C.cYellow + poll.getCoinReward() + " Coins"); player.sendMessage("Click an answer to receive " + C.cGreen + poll.getCoinReward() + " Gems");
player.sendMessage(C.cGold + C.Bold + "--------------------------"); player.sendMessage(C.cGold + C.Bold + "--------------------------");
player.playSound(player.getEyeLocation(), Sound.ORB_PICKUP, 2f, 0f); player.playSound(player.getEyeLocation(), Sound.ORB_PICKUP, 2f, 0f);
@ -173,7 +176,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
if (_repository.addPollAnswer(uuid, poll.getId(), answer)) if (_repository.addPollAnswer(uuid, poll.getId(), answer))
{ {
// Poll response successful, give coins // Poll response successful, give coins
_donationManager.RewardCoins(new Callback<Boolean>() _donationManager.RewardGems(new Callback<Boolean>()
{ {
@Override @Override
public void run(Boolean completed) public void run(Boolean completed)
@ -184,7 +187,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
@Override @Override
public void run() public void run()
{ {
UtilPlayer.message(player, F.main("Coin", "You received " + F.elem(poll.getCoinReward() + "") + " coins!")); UtilPlayer.message(player, F.main("Gem", "You received " + F.elem(poll.getCoinReward() + "") + " Gems!"));
} }
}); });
} }

View File

@ -207,6 +207,8 @@ public abstract class Game implements Listener
public boolean EloRanking = false; public boolean EloRanking = false;
public int EloStart = 1000; public int EloStart = 1000;
public boolean CanAddStats = true;
public ArrayList<String> GemBoosters = new ArrayList<String>(); public ArrayList<String> GemBoosters = new ArrayList<String>();
private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>(); private final Set<StatTracker<? extends Game>> _statTrackers = new HashSet<>();

View File

@ -101,7 +101,7 @@ public class Micro extends TeamGame
if (_blocks.isEmpty()) if (_blocks.isEmpty())
return; return;
TimingManager.start("Block Fall"); //TimingManager.start("Block Fall");
for (int i = 0 ; i < 3 ; i++) for (int i = 0 ; i < 3 ; i++)
{ {
@ -134,7 +134,7 @@ public class Micro extends TeamGame
} }
} }
TimingManager.stop("Block Fall"); //TimingManager.stop("Block Fall");
} }
@EventHandler @EventHandler

View File

@ -93,11 +93,11 @@ public class GameAchievementManager implements Listener
String progress = F.elem(C.cGreen + "+" + log.get(type).Amount); String progress = F.elem(C.cGreen + "+" + log.get(type).Amount);
boolean displayDesc = true; boolean displayDesc = true;
//Completed Achievement //Completed Achievement
if (data.getLevel() == type.getMaxLevel()) if (data.getLevel() >= type.getMaxLevel())
{ {
//Finishing for the first time //Finishing for the first time
if (!Manager.GetTaskManager().hasCompletedTask(player, type.getName())) if (!Manager.GetTaskManager().hasCompletedTask(player, type.getName()))
{ {
UtilPlayer.message(player, nameLevel + " " + F.elem(C.cAqua + C.Bold + "Completed!") + UtilPlayer.message(player, nameLevel + " " + F.elem(C.cAqua + C.Bold + "Completed!") +

View File

@ -271,6 +271,20 @@ public class GameManager implements Listener
event.GetGame().DeregisterKits(); event.GetGame().DeregisterKits();
} }
@EventHandler
public void StatEnableDisable(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
return;
int requirement = (int)((double)event.GetGame().Manager.GetPlayerFull() * 0.75d);
event.GetGame().CanAddStats = (double)event.GetGame().GetPlayers(true).size() >= requirement;
if (!event.GetGame().CanAddStats)
event.GetGame().Announce(C.Bold + "Stats/Achievements Disabled. Requires " + requirement + " Players.");
}
@EventHandler @EventHandler
public void StatRegister(GameStateChangeEvent event) public void StatRegister(GameStateChangeEvent event)
{ {

View File

@ -63,11 +63,7 @@ public class OneVThreeStatTracker extends StatTracker<Game>
{ {
if (event.GetState() == Game.GameState.End) if (event.GetState() == Game.GameState.End)
{ {
List<Player> players = getGame().GetPlayers(false); for (Player player : getGame().GetPlayers(false))
if (players.size() >= 4)
return;
for (Player player : players)
{ {
Integer killCount = _killCount.get(player.getUniqueId()); Integer killCount = _killCount.get(player.getUniqueId());

View File

@ -21,7 +21,7 @@ public class StatTracker<G extends Game> implements Listener
public boolean canAddStats() public boolean canAddStats()
{ {
return getGame().GetPlayers(false).size() * 4 >= 3 * getGame().Manager.GetPlayerFull(); return getGame().CanAddStats;
} }
public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global) public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global)