Added Mine-Strike to Quick Game menu.

Fixed up CoreClientManager's rank update.
This commit is contained in:
Jonathan Williams 2014-10-11 02:32:02 -07:00
parent 19afebe53d
commit a54b78fefa
5 changed files with 60 additions and 12 deletions

View File

@ -236,7 +236,7 @@ public class CoreClientManager extends MiniPlugin
client.SetAccountId(token.AccountId);
client.SetRank(Rank.valueOf(token.Rank));
_repository.updateMysqlRank(token.Name, token.Rank, token.RankPerm, new Timestamp(Date.parse(token.RankExpire)).toString());
_repository.updateMysqlRank(uuid.toString(), token.Rank, token.RankPerm, new Timestamp(Date.parse(token.RankExpire)).toString());
// JSON sql response
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response));

View File

@ -763,4 +763,9 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Team Deathmatch");
}
public ShopBase<ServerManager> getMinestrikeShop()
{
return _serverNpcShopMap.get("Mine-Strike");
}
}

View File

@ -20,6 +20,7 @@ import mineplex.hub.server.ui.button.SelectCSButton;
import mineplex.hub.server.ui.button.SelectDMTButton;
import mineplex.hub.server.ui.button.SelectDOMButton;
import mineplex.hub.server.ui.button.SelectMINButton;
import mineplex.hub.server.ui.button.SelectMSButton;
import mineplex.hub.server.ui.button.SelectSGButton;
import mineplex.hub.server.ui.button.SelectSSMButton;
import mineplex.hub.server.ui.button.SelectTDMButton;
@ -46,7 +47,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
@Override
protected void BuildPage()
{
this.setItem(1, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[]
this.setItem(0, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "4 Teams get 10 minutes to prepare.",
@ -55,17 +56,25 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "death with the other teams.",
}));
this.setItem(3, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Last Man Standing", new String[]
this.setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Last Man Standing", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Search for chests to find loot and ",
ChatColor.RESET + "fight others to be the last man standing. ",
ChatColor.RESET + "Beware of the deep freeze!",
}));
this.setItem(4, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike " + C.cGray + "Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "One team must defend two bomb sites from",
ChatColor.RESET + "the other team, who are trying to plant a bomb",
ChatColor.RESET + "and blow them up!",
}));
this.setItem(5, _superSmashCycle.get(_ssmIndex));
this.setItem(6, _superSmashCycle.get(_ssmIndex));
this.setItem(7, ItemStackFactory.Instance.CreateStack(Material.ANVIL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
this.setItem(8, ItemStackFactory.Instance.CreateStack(Material.GRASS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Hide as blocks/animals, upgrade your ",
@ -81,7 +90,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "limit gets some points!",
}));
this.setItem(20, ItemStackFactory.Instance.CreateStack(98, (byte)2, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Castle Siege " + C.cGray + "Team Game", new String[]
this.setItem(20, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Castle Siege " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Defenders must protect King Sparklez",
@ -107,10 +116,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
this.setItem(26, _minigameCycle.get(_minigameIndex));
ButtonMap.put(1, new SelectBRButton(this));
ButtonMap.put(3, new SelectSGButton(this));
ButtonMap.put(5, new SelectSSMButton(this));
ButtonMap.put(7, new SelectBHButton(this));
ButtonMap.put(0, new SelectBRButton(this));
ButtonMap.put(2, new SelectSGButton(this));
ButtonMap.put(4, new SelectMSButton(this));
ButtonMap.put(6, new SelectSSMButton(this));
ButtonMap.put(8, new SelectBHButton(this));
ButtonMap.put(18, new SelectDMTButton(this));
ButtonMap.put(20, new SelectCSButton(this));
@ -303,7 +313,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "death with your monsters skills!",
};
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)1, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs", desc));
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs", desc));
}
public void Update()
@ -364,4 +374,9 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
Plugin.getTeamDeathmatchShop().attemptShopOpen(player);
}
public void openMS(Player player)
{
Plugin.getMinestrikeShop().attemptShopOpen(player);
}
}

View File

@ -166,7 +166,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{
lore.add(MESSAGE_FULL_GET_ULTRA);
}
else
else if (!serverInfo.MOTD.contains("Open in"))
{
lore.add(MESSAGE_JOIN);
}

View File

@ -0,0 +1,28 @@
package mineplex.hub.server.ui.button;
import org.bukkit.entity.Player;
import mineplex.core.shop.item.IButton;
import mineplex.hub.server.ui.ServerGameMenu;
public class SelectMSButton implements IButton
{
private ServerGameMenu _menu;
public SelectMSButton(ServerGameMenu menu)
{
_menu = menu;
}
@Override
public void ClickedLeft(Player player)
{
_menu.openMS(player);
}
@Override
public void ClickedRight(Player player)
{
ClickedLeft(player);
}
}