diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java index 22128a1f1..8ea303624 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java @@ -9,7 +9,10 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import net.minecraft.server.v1_6_R2.Block; import net.minecraft.server.v1_6_R2.ChunkCoordIntPair; +import net.minecraft.server.v1_6_R2.ChunkSection; +import net.minecraft.server.v1_6_R2.IContainer; import net.minecraft.server.v1_6_R2.MinecraftServer; import net.minecraft.server.v1_6_R2.RegionFile; @@ -144,10 +147,36 @@ public class MapUtil public static net.minecraft.server.v1_6_R2.Chunk ChunkBlockChange(Location location, int id, byte data) { - net.minecraft.server.v1_6_R2.Chunk c = ((CraftChunk)location.getChunk()).getHandle(); + return ChunkBlockChange(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), id, data); + } + + public static net.minecraft.server.v1_6_R2.Chunk ChunkBlockChange(World world, int x, int y, int z, int id, byte data) + { + net.minecraft.server.v1_6_R2.Chunk c = ((CraftChunk)world.getChunkAt(x >> 4, z >> 4)).getHandle(); - c.a(location.getBlockX() & 0xF, location.getBlockY(), location.getBlockZ() & 0xF, id, data); + x = x & 0xF; + z = z & 0xF; + + int l1 = c.getTypeId(x, y, z); + int i2 = c.getData(x, y, z); + + ChunkSection chunksection = c.i()[(y >> 4)]; + int j2 = c.x * 16 + x; + int k2 = c.z * 16 + z; + + if ((l1 != 0) && (!c.world.isStatic)) + Block.byId[l1].l(c.world, j2, y, k2, i2); + + chunksection.setTypeId(x, y & 0xF, z, id); + + if (chunksection.getTypeId(x, y & 0xF, z) != id) + { + return null; + } + + chunksection.setData(x, y & 0xF, z, data); + return c; } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java index 44ee7f81b..8c71a89b1 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java @@ -6,6 +6,7 @@ import java.util.HashSet; import net.minecraft.server.v1_6_R2.Chunk; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -52,27 +53,41 @@ public class UtilText HashSet chunks = new HashSet(); //Clean - Block other = loc.getBlock(); + World world = loc.getWorld(); + int bX = loc.getBlockX(); + int bY = loc.getBlockY(); + int bZ = loc.getBlockZ(); for (int y=0 ; y<5 ; y++) { if (align == TextAlign.CENTER) for (int i=-48 ; i<=48 ; i++) - if (other.getRelative(face, i).getTypeId() != 0) - chunks.add(MapUtil.ChunkBlockChange(other.getRelative(face, i).getLocation(), 0, (byte)0)); + { + chunks.add(MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0)); + } + if (align == TextAlign.LEFT) for (int i=0 ; i<=96 ; i++) - if (other.getRelative(face, i).getTypeId() != 0) - chunks.add(MapUtil.ChunkBlockChange(other.getRelative(face, i).getLocation(), 0, (byte)0)); + { + chunks.add(MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0)); + } + if (align == TextAlign.RIGHT) for (int i=-96 ; i<=0 ; i++) - if (other.getRelative(face, i).getTypeId() != 0) - chunks.add(MapUtil.ChunkBlockChange(other.getRelative(face, i).getLocation(), 0, (byte)0)); + { + chunks.add(MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0)); + } + - other = other.getRelative(BlockFace.DOWN); + bY -=1; } + world = block.getWorld(); + bX = block.getX(); + bY = block.getY(); + bZ = block.getZ(); + //Make Blocks for (char c : string.toLowerCase().toCharArray()) { @@ -86,21 +101,34 @@ public class UtilText for (int y=0 ; y _serverInfoMap = new NautHashMap(); private NautHashMap _serverUpdate = new NautHashMap(); - private boolean _update = true; + private ServerNpcShop _quickShop; + private boolean _loading = false; public ServerManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, Portal portal, PartyManager partyManager) @@ -71,6 +78,7 @@ public class ServerManager extends MiniPlugin implements PluginMessageListener LoadServers(); new ServerManagerUpdater(this); + //_quickShop = new ServerNpcShop(this, clientManager, donationManager, "Quick Menu"); } public void AddCommands() @@ -78,6 +86,21 @@ public class ServerManager extends MiniPlugin implements PluginMessageListener AddCommand(new ServerNpcCommand(this)); } + @EventHandler(priority = EventPriority.LOW) + public void playerJoin(PlayerJoinEvent event) + { + //event.getPlayer().getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS.getId(), (byte)0, 1, ChatColor.GREEN + "Game Menu")); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void playerInteract(PlayerInteractEvent event) + { + if (event.getItem() != null && event.getItem().getType() == Material.COMPASS) + { + //_quickShop.OpenPageForPlayer(event.getPlayer(), new ServerGameMenu(this, _quickShop, _clientManager, _donationManager, " " + ChatColor.UNDERLINE + "Quick Game Menu", event.getPlayer())); + } + } + public void AddServer(String serverNpcName, String serverName) { ServerInfo serverInfo = new ServerInfo(); @@ -223,23 +246,25 @@ public class ServerManager extends MiniPlugin implements PluginMessageListener } @EventHandler - public void UpdateServers(UpdateEvent event) + public void updatePages(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + _quickShop.UpdatePages(); + + for (ServerNpcShop shop : _serverNpcShopMap.values()) + { + shop.UpdatePages(); + } + } + + @EventHandler + public void updateServers(UpdateEvent event) { if (event.getType() != UpdateType.SEC) return; - _update = !_update; - - if (!_update) - { - for (ServerNpcShop shop : _serverNpcShopMap.values()) - { - shop.UpdatePages(); - } - - return; - } - if (Bukkit.getServer().getOnlinePlayers().length > 0) { for (String serverName : _serverInfoMap.keySet()) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectBRButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectBRButton.java new file mode 100644 index 000000000..928f58717 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectBRButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectBRButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectBRButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenBR(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectDOMButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectDOMButton.java new file mode 100644 index 000000000..db6b1cee5 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectDOMButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectDOMButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectDOMButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenDOM(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectMINButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectMINButton.java new file mode 100644 index 000000000..00eba17da --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectMINButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectMINButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectMINButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenMIN(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectMKButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectMKButton.java new file mode 100644 index 000000000..6bc92651b --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectMKButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectMKButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectMKButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenMK(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectOITQButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectOITQButton.java new file mode 100644 index 000000000..6fb9afe82 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectOITQButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectOITQButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectOITQButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenOITQ(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectSSMButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectSSMButton.java new file mode 100644 index 000000000..5303a25bd --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectSSMButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectSSMButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectSSMButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenSSM(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectTFButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectTFButton.java new file mode 100644 index 000000000..82e0fc4ac --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/SelectTFButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.server.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectTFButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectTFButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void Clicked(Player player) + { + _menu.OpenTF(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java new file mode 100644 index 000000000..f2971d52c --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -0,0 +1,318 @@ +package mineplex.hub.server.ui; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.donation.DonationManager; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.shop.page.ShopPageBase; +import mineplex.hub.server.ServerManager; + +public class ServerGameMenu extends ShopPageBase +{ + private List _superSmashCycle = new ArrayList(); + private List _minigameCycle = new ArrayList(); + private List _turfFortsCycle = new ArrayList(); + + private int _ssmIndex; + private int _minigameIndex; + private int _turfFortsIndex; + + public ServerGameMenu(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) + { + super(plugin, shop, clientManager, donationManager, name, player, 9); + + createSuperSmashCycle(); + createMinigameCycle(); + createTurfFortsCycle(); + + BuildPage(); + } + + @Override + protected void BuildPage() + { + this.setItem(0, _superSmashCycle.get(_ssmIndex)); + this.setItem(1, _minigameCycle.get(_minigameIndex)); + this.setItem(2, _turfFortsCycle.get(_turfFortsIndex)); + this.setItem(3, ItemStackFactory.Instance.CreateStack(Material.BOW.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "One in the Quiver " + C.cGray + "Arcade Minigame", new String[] { "", ChatColor.RESET + "Fast paced, 1 shot combat!" })); + this.setItem(4, 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.", + ChatColor.RESET + "Then the bridges drop, and all hell", + ChatColor.RESET + "breaks loose as you battle to the", + ChatColor.RESET + "death with the other teams.", + })); + this.setItem(5, ItemStackFactory.Instance.CreateStack(Material.SADDLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "MineKart " + C.cGray + "Racing", new String[] + { + ChatColor.RESET + "", + ChatColor.RESET + "Pick your Kart and race against other", + ChatColor.RESET + "players on exciting tracks, complete", + ChatColor.RESET + "with weapons, drifting and more!", + })); + + this.setItem(6, ItemStackFactory.Instance.CreateStack(Material.BEACON.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Champions " + C.cGray + "Champions Team Game", new String[] + { + ChatColor.RESET + "", + ChatColor.RESET + "Customize one of five exciting champions", + ChatColor.RESET + "and battle with the opposing team for the", + ChatColor.RESET + "control points on the map.", + })); + + ButtonMap.put(0, new SelectSSMButton(this)); + ButtonMap.put(0, new SelectMINButton(this)); + ButtonMap.put(0, new SelectTFButton(this)); + ButtonMap.put(0, new SelectOITQButton(this)); + ButtonMap.put(0, new SelectBRButton(this)); + ButtonMap.put(0, new SelectMKButton(this)); + ButtonMap.put(0, new SelectDOMButton(this)); + } + + private void createTurfFortsCycle() + { + _turfFortsCycle.add(ItemStackFactory.Instance.CreateStack(Material.WOOL.getId(), (byte)11, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Turf Forts " + C.cGray + "Arcade Minigame", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Use your archery skills to kill your", + ChatColor.RESET + "enemies and take over their turf!" + })); + + _turfFortsCycle.add(ItemStackFactory.Instance.CreateStack(Material.WOOL.getId(), (byte)14, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Turf Forts " + C.cGray + "Arcade Minigame", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Use your archery skills to kill your", + ChatColor.RESET + "enemies and take over their turf!" + })); + } + + private void createMinigameCycle() + { + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(98, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(122, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.LEATHER_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "A Barbarian's Life", + ChatColor.RESET + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(159, (byte)14, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Turf Forts", + ChatColor.RESET + "Death Tag", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(144, (byte)1, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "A Barbarian's Life", + ChatColor.RESET +"Turf Forts", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Death Tag", + })); + } + + private void createSuperSmashCycle() + { + String[] desc = new String[] + { + ChatColor.RESET + "", + ChatColor.RESET + "Pick from a selection of monsters,", + ChatColor.RESET + "then battle other players to the ", + 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)2, 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)); + _superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs", desc)); + } + + public void Update() + { + _ssmIndex++; + _minigameIndex++; + _turfFortsIndex++; + + if (_ssmIndex >= _superSmashCycle.size()) + _ssmIndex = 0; + + if (_minigameIndex >= _minigameCycle.size()) + _minigameIndex = 0; + + if (_turfFortsIndex >= _turfFortsCycle.size()) + _turfFortsIndex = 0; + + BuildPage(); + } + + public void OpenMIN(Player player) + { + // TODO Auto-generated method stub + + } + + public void OpenSSM(Player player) + { + // TODO Auto-generated method stub + + } + + public void OpenDOM(Player player) + { + // TODO Auto-generated method stub + + } + + public void OpenBR(Player player) + { + // TODO Auto-generated method stub + + } + + public void OpenMK(Player player) + { + // TODO Auto-generated method stub + + } + + public void OpenTF(Player player) + { + // TODO Auto-generated method stub + + } + + public void OpenOITQ(Player player) + { + // TODO Auto-generated method stub + + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index ac49e3179..098ca8ae0 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -14,6 +14,7 @@ import mineplex.core.shop.page.ShopPageBase; import mineplex.hub.server.ServerInfo; import mineplex.hub.server.ServerManager; import mineplex.hub.server.ServerSorter; +import mineplex.hub.server.ui.button.JoinServerButton; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java index 5df33e5b8..a9db623a5 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java @@ -49,6 +49,10 @@ public class ServerNpcShop extends ShopBase { ((ServerNpcPage)page).Update(); } + else if (page instanceof ServerGameMenu) + { + ((ServerGameMenu)page).Update(); + } } } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/JoinServerButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/JoinServerButton.java similarity index 84% rename from Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/JoinServerButton.java rename to Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/JoinServerButton.java index 2670b67d2..e9dd82628 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/JoinServerButton.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/JoinServerButton.java @@ -1,9 +1,10 @@ -package mineplex.hub.server.ui; +package mineplex.hub.server.ui.button; import org.bukkit.entity.Player; import mineplex.core.shop.item.IButton; import mineplex.hub.server.ServerInfo; +import mineplex.hub.server.ui.ServerNpcPage; public class JoinServerButton implements IButton {