Merge branch 'master' of ssh://198.245.50.91:7999/min/master
This commit is contained in:
commit
9cac72dc1e
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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<Chunk> chunks = new HashSet<Chunk>();
|
||||
|
||||
//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<letter[x].length ; y++)
|
||||
{
|
||||
if (letter[x][y] == 1)
|
||||
chunks.add(MapUtil.ChunkBlockChange(block.getLocation(), id, data));
|
||||
{
|
||||
chunks.add(MapUtil.ChunkBlockChange(world, bX, bY, bZ, id, data));
|
||||
}
|
||||
|
||||
//Forward
|
||||
block = block.getRelative(face);
|
||||
bX += face.getModX();
|
||||
bY += face.getModY();
|
||||
bZ += face.getModZ();
|
||||
}
|
||||
|
||||
//Back
|
||||
block = block.getRelative(face, -1 * letter[x].length);
|
||||
bX += face.getModX() * -1 * letter[x].length;
|
||||
bY += face.getModY() * -1 * letter[x].length;
|
||||
bZ += face.getModZ() * -1 * letter[x].length;
|
||||
|
||||
//Down
|
||||
block = block.getRelative(BlockFace.DOWN);
|
||||
bY--;
|
||||
}
|
||||
|
||||
block = block.getRelative(BlockFace.UP, 5);
|
||||
block = block.getRelative(face, letter[0].length + 1);
|
||||
bY += 5;
|
||||
bX += face.getModX() * (letter[0].length + 1);
|
||||
bY += face.getModY() * (letter[0].length + 1);
|
||||
bZ += face.getModZ() * (letter[0].length + 1);
|
||||
}
|
||||
|
||||
for (Chunk c : chunks)
|
||||
{
|
||||
c.initLighting();
|
||||
}
|
||||
|
||||
MapUtil.ResendChunksForNearbyPlayers(chunks);
|
||||
|
@ -22,6 +22,8 @@ public enum UpdateType
|
||||
|
||||
private long _time;
|
||||
private long _last;
|
||||
private long _timeSpent;
|
||||
private long _timeCount;
|
||||
|
||||
UpdateType(long time)
|
||||
{
|
||||
@ -39,4 +41,20 @@ public enum UpdateType
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void StartTime()
|
||||
{
|
||||
_timeCount = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void StopTime()
|
||||
{
|
||||
_timeSpent += System.currentTimeMillis() - _timeCount;
|
||||
}
|
||||
|
||||
public void PrintAndResetTime()
|
||||
{
|
||||
System.out.println(this.name() + " in a second: " + _timeSpent);
|
||||
_timeSpent = 0;
|
||||
}
|
||||
}
|
||||
|
@ -17,14 +17,29 @@ public class Updater implements Runnable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
boolean second = false;
|
||||
|
||||
for (UpdateType updateType : UpdateType.values())
|
||||
{
|
||||
if (updateType.Elapsed())
|
||||
{
|
||||
//long startTime = System.currentTimeMillis();
|
||||
if (updateType == UpdateType.SEC)
|
||||
second = true;
|
||||
|
||||
//updateType.StartTime();
|
||||
_plugin.getServer().getPluginManager().callEvent(new UpdateEvent(updateType));
|
||||
//System.out.println("UpdateType " + updateType.name() + " : " + (System.currentTimeMillis() - startTime) + "ms");
|
||||
//updateType.StopTime();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (second)
|
||||
{
|
||||
for (UpdateType updateType : UpdateType.values())
|
||||
{
|
||||
updateType.PrintAndResetTime();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.energy.Energy;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.message.MessageManager;
|
||||
import mineplex.core.monitor.LagMeter;
|
||||
import mineplex.core.movement.Movement;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
import mineplex.core.packethandler.PacketHandler;
|
||||
@ -82,7 +81,7 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
|
||||
new Chat(this, clientManager);
|
||||
new MemoryFix(this);
|
||||
new FileUpdater(this, portal);
|
||||
new LagMeter(this, clientManager);
|
||||
//new LagMeter(this, clientManager);
|
||||
|
||||
CombatManager combatManager = new CombatManager(this);
|
||||
BlockRestore blockRestore = new BlockRestore(this);
|
||||
|
@ -100,7 +100,6 @@ public class TextCreator extends MiniPlugin
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
|
||||
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER);
|
||||
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
|
||||
|
||||
|
@ -17,8 +17,12 @@ import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
|
||||
@ -32,12 +36,14 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.hub.party.Party;
|
||||
import mineplex.hub.party.PartyManager;
|
||||
import mineplex.hub.server.command.ServerNpcCommand;
|
||||
import mineplex.hub.server.ui.ServerGameMenu;
|
||||
import mineplex.hub.server.ui.ServerNpcShop;
|
||||
|
||||
public class ServerManager extends MiniPlugin implements PluginMessageListener
|
||||
@ -52,7 +58,8 @@ public class ServerManager extends MiniPlugin implements PluginMessageListener
|
||||
private NautHashMap<String, ServerInfo> _serverInfoMap = new NautHashMap<String, ServerInfo>();
|
||||
private NautHashMap<String, Long> _serverUpdate = new NautHashMap<String, Long>();
|
||||
|
||||
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())
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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<ServerManager, ServerNpcShop>
|
||||
{
|
||||
private List<ItemStack> _superSmashCycle = new ArrayList<ItemStack>();
|
||||
private List<ItemStack> _minigameCycle = new ArrayList<ItemStack>();
|
||||
private List<ItemStack> _turfFortsCycle = new ArrayList<ItemStack>();
|
||||
|
||||
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
|
||||
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -49,6 +49,10 @@ public class ServerNpcShop extends ShopBase<ServerManager>
|
||||
{
|
||||
((ServerNpcPage)page).Update();
|
||||
}
|
||||
else if (page instanceof ServerGameMenu)
|
||||
{
|
||||
((ServerGameMenu)page).Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
{
|
Loading…
Reference in New Issue
Block a user