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

This commit is contained in:
Mini-Chiss 2015-05-01 18:05:55 -05:00
commit ab6937a525
20 changed files with 544 additions and 33 deletions

View File

@ -5,7 +5,6 @@
<element id="module-output" name="Mineplex.Core" />
<element id="module-output" name="Mineplex.Core.Common" />
<element id="module-output" name="Mineplex.Database" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.4.2.jar" path-in-jar="/" />
<element id="module-output" name="Mineplex.Game.Clans" />
<element id="module-output" name="Mineplex.Minecraft.Game.Core" />
<element id="module-output" name="Mineplex.Minecraft.Game.ClassCombat" />
@ -18,6 +17,7 @@
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/gson-2.2.1.jar" path-in-jar="/" />
<element id="file-copy" path="$PROJECT_DIR$/Mineplex.Game.Clans/plugin.yml" />
<element id="module-output" name="Mineplex.ServerData" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.5.2.jar" path-in-jar="/" />
</root>
</artifact>
</component>

View File

@ -17,7 +17,7 @@
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jedis-2.4.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/gson-2.2.1.jar" path-in-jar="/" />
<element id="module-output" name="Mineplex.Database" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.4.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.5.2.jar" path-in-jar="/" />
</root>
</artifact>
</component>

View File

@ -10,7 +10,4 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="TaskProjectConfiguration">
<server type="JIRA" url="http://184.154.0.242:8080" />
</component>
</project>

View File

@ -1,5 +1,6 @@
package mineplex.bungee.motd;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
@ -53,23 +54,13 @@ public class MotdManager implements Listener, Runnable
public void run()
{
// Add in default MOTD listing to database
/*
if (!_repository.elementExists("MainMotd"))
{
_repository.removeElement("MainMotd");
List<String> lines = new ArrayList<String>();
lines.add(" §a§lDouble Gems for 1.8 Players!");
lines.add(" §e§lChampions Update §a§lBalance Patch");
lines.add(" §6§lSpecial Egg Baskets!");
lines.add(" §e§lBunny Morph §a§lLimited Time!");
lines.add(" §d§lHero Sale §a§l33% Off");
lines.add(" §a§lDouble Gems for 1.8 Players!");
lines.add(" §e§lNEW GAME §a§lWizards!");
lines.add(" §d§lRank Sale §a§l40% Off");
updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines);
}
*/
GlobalMotd motd = _repository.getElement("MainMotd");
if (motd != null)

View File

@ -12,7 +12,7 @@ public class UtilParticle
{
public enum ParticleType
{
ANGRY_VILLAGER("angryVillager"),
ANGRY_VILLAGER("angryVillager", "Angry Villager", Material.SAPLING, (byte) 0),
BLOCK_CRACK("blockcrack_1_0")
{
@ -117,16 +117,59 @@ public class UtilParticle
WITCH_MAGIC("witchMagic");
public String particleName;
private boolean _friendlyData;
private String _friendlyName;
private Material _material;
private byte _data;
ParticleType(String particleName)
{
this.particleName = particleName;
_friendlyData = false;
}
ParticleType(String particleName, String friendlyName, Material material, byte data)
{
_friendlyData = true;
_friendlyName = friendlyName;
_material = material;
_data = data;
}
public String getParticle(Material type, int data)
{
return particleName;
}
public boolean hasFriendlyData()
{
return _friendlyData;
}
public String getFriendlyName()
{
return _friendlyName;
}
public Material getMaterial()
{
return _material;
}
public byte getData()
{
return _data;
}
public static ParticleType getFromFriendlyName(String name)
{
for (ParticleType type : values())
{
if (type.hasFriendlyData() && type.getFriendlyName().equals(name))
return type;
}
return null;
}
}
private static PacketPlayOutWorldParticles getPacket(String particleName, Location location, float offsetX, float offsetY,

View File

@ -50,7 +50,7 @@ public class ServerConfiguration extends MiniPlugin
_plugin.getServer().setWhitelist(_serverGroup.getWhitelist());
((CraftServer)_plugin.getServer()).getServer().setPvP(_serverGroup.getPvp());
((CraftServer)_plugin.getServer()).getServer().setTexturePack(_serverGroup.getResourcePack());
//((CraftServer)_plugin.getServer()).getServer().setTexturePack(_serverGroup.getResourcePack());
}
@EventHandler

View File

@ -6,6 +6,7 @@ import net.minecraft.server.v1_7_R4.MinecraftServer;
import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.chat.Chat;
import mineplex.core.command.CommandCenter;
import mineplex.core.donation.DonationManager;
import mineplex.core.explosion.Explosion;
@ -78,7 +79,8 @@ public class Clans extends JavaPlugin
BlockRestore blockRestore = new BlockRestore(this);
IgnoreManager ignoreManager = new IgnoreManager(this, _clientManager, preferenceManager, portal);
new MessageManager(this, _clientManager, preferenceManager, ignoreManager, punish, new FriendManager(this, _clientManager, preferenceManager, portal));
Chat chat = new Chat(this, _clientManager, preferenceManager, serverStatusManager.getCurrentServerName());
new MessageManager(this, _clientManager, preferenceManager, ignoreManager, punish, new FriendManager(this, _clientManager, preferenceManager, portal), chat);
new MemoryFix(this);
new Explosion(this, blockRestore);

View File

@ -744,4 +744,9 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Mine-Strike");
}
public ShopBase<ServerManager> getWizardShop()
{
return _serverNpcShopMap.get("Wizards");
}
}

View File

@ -24,6 +24,7 @@ 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;
import mineplex.hub.server.ui.button.SelectWIZButton;
public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
@ -35,7 +36,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
{
super(plugin, quickShop, clientManager, donationManager, name, player, 27);
super(plugin, quickShop, clientManager, donationManager, name, player, 56);
createSuperSmashCycle();
createMinigameCycle();
@ -74,12 +75,12 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
this.setItem(6, _superSmashCycle.get(_ssmIndex));
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[]
this.setItem(8, ItemStackFactory.Instance.CreateStack(Material.BLAZE_ROD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Wizards " + C.cGray + "Last Man Standing", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Hide as blocks/animals, upgrade your ",
ChatColor.RESET + "weapon and fight to survive against",
ChatColor.RESET + "the Hunters!",
ChatColor.RESET + "Wield powerful spells to fight",
ChatColor.RESET + "against other players in this",
ChatColor.RESET + "exciting free-for-all brawl!",
}));
this.setItem(18, ItemStackFactory.Instance.CreateStack(Material.BOOK_AND_QUILL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Draw My Thing " + C.cGray + "Pictionary!", new String[]
@ -113,20 +114,29 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "and battle with the opposing team to the",
ChatColor.RESET + "last man standing.",
}));
this.setItem(26, 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 ",
ChatColor.RESET + "weapon and fight to survive against",
ChatColor.RESET + "the Hunters!",
}));
this.setItem(26, _minigameCycle.get(_minigameIndex));
this.setItem(40, _minigameCycle.get(_minigameIndex));
getButtonMap().put(0, new SelectBRButton(this));
getButtonMap().put(2, new SelectSGButton(this));
getButtonMap().put(4, new SelectMSButton(this));
getButtonMap().put(6, new SelectSSMButton(this));
getButtonMap().put(8, new SelectBHButton(this));
getButtonMap().put(8, new SelectWIZButton(this));
getButtonMap().put(18, new SelectDMTButton(this));
getButtonMap().put(20, new SelectCSButton(this));
getButtonMap().put(22, new SelectDOMButton(this));
getButtonMap().put(24, new SelectTDMButton(this));
getButtonMap().put(26, new SelectMINButton(this));
getButtonMap().put(26, new SelectBHButton(this));
getButtonMap().put(40, new SelectMINButton(this));
}
@SuppressWarnings("deprecation")
@ -407,4 +417,9 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
getPlugin().getMinestrikeShop().attemptShopOpen(player);
}
public void OpenWIZ(Player player)
{
getPlugin().getWizardShop().attemptShopOpen(player);
}
}

View File

@ -0,0 +1,23 @@
package mineplex.hub.server.ui.button;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.shop.item.IButton;
import mineplex.hub.server.ui.ServerGameMenu;
public class SelectWIZButton implements IButton
{
private ServerGameMenu _menu;
public SelectWIZButton(ServerGameMenu menu)
{
_menu = menu;
}
@Override
public void onClick(Player player, ClickType clickType)
{
_menu.OpenWIZ(player);
}
}

View File

@ -346,7 +346,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
_resourcePackNoResponse.remove(player.getName());
returnHubNoResPack(player, "Failed to download resource pack!");
returnHubNoResPack(player, "You need to accept the resource pack!");
}
else if (response == EnumResourcePackStatus.FAILED_DOWNLOAD)
{

View File

@ -28,7 +28,7 @@ public enum GameType
Horse("Horseback", Material.IRON_BARDING, (byte)0, GameCategory.ARCADE, 21),
Micro("Micro Battle", Material.LAVA_BUCKET, (byte)0, GameCategory.ARCADE, 24),
MilkCow("Milk the Cow", Material.MILK_BUCKET, (byte)0, GameCategory.ARCADE, 27),
MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CLASSICS, 25),
MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CLASSICS, 25, "http://chivebox.com/file/c/assets.zip", false),
MineWare("MineWare", Material.PAPER, (byte)0, GameCategory.ARCADE, 26),
Paintball("Super Paintball", Material.ENDER_PEARL, (byte)0, GameCategory.ARCADE, 28),
Quiver("One in the Quiver", Material.ARROW, (byte)0, GameCategory.ARCADE, 29),

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.build;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
@ -22,7 +23,9 @@ import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
@ -52,6 +55,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
import nautilus.game.arcade.game.games.draw.kits.*;
import nautilus.game.arcade.kit.Kit;
@ -70,6 +74,9 @@ public class Build extends SoloGame
private String _word = "?";
private OptionsShop _shop;
private ItemStack _shopItem;
public Build(ArcadeManager manager)
{
super(manager, GameType.Build,
@ -107,6 +114,9 @@ public class Build extends SoloGame
{
"Pirate Ship", "Mineshaft", "Archers Tower", "Dinner Table", "Pokemon"
};
_shop = new OptionsShop(this, getArcadeManager(), getArcadeManager().GetClients(), getArcadeManager().GetDonation());
_shopItem = ItemStackFactory.Instance.CreateStack(Material.DIAMOND, (byte) 0, 1, C.cGreen + "Options");
}
@EventHandler
@ -168,6 +178,9 @@ public class Build extends SoloGame
this.InventoryClick = false;
UtilTextMiddle.display(null, C.cYellow + "Time Up!", 0, 60, 5);
for (Player player : GetPlayers(true))
player.getInventory().clear(8);
}
}
//Pause
@ -356,6 +369,11 @@ public class Build extends SoloGame
return BuildQuality.getQuality(score / (double)(GetPlayers(true).size()-1));
}
public BuildData getBuildData(Player player)
{
return _data.get(player);
}
@EventHandler
public void blockPlace(BlockPlaceEvent event)
{
@ -620,4 +638,71 @@ public class Build extends SoloGame
Scoreboard.Draw();
}
@EventHandler
public void openShop(PlayerInteractEvent event)
{
if (IsAlive(event.getPlayer()) && _shopItem.equals(event.getPlayer().getItemInHand()))
_shop.attemptShopOpen(event.getPlayer());
}
@EventHandler
public void giveItemStart(GameStateChangeEvent event)
{
if (event.GetGame() == this && event.GetState() == GameState.Live)
{
for (Player player : GetPlayers(true))
player.getInventory().setItem(8, _shopItem);
}
}
@EventHandler
public void giveItem(UpdateEvent event)
{
if (event.getType() != UpdateType.TWOSEC) return;
if (IsLive() && _buildGameState == 0)
for (Player player : GetPlayers(true))
player.getInventory().setItem(8, _shopItem);
}
@EventHandler
public void stopShopItemMove(InventoryClickEvent event)
{
if (event.getClickedInventory() != null && _shopItem.equals(event.getClickedInventory().getItem(event.getSlot())))
event.setCancelled(true);
}
@EventHandler
public void stopShopItemDrop(PlayerDropItemEvent event)
{
if (_shopItem.equals(event.getItemDrop().getItemStack()))
event.setCancelled(true);
}
@EventHandler
public void placeParticles(PlayerInteractEvent event)
{
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
ItemStack itemInHand = event.getPlayer().getItemInHand();
if (itemInHand != null && itemInHand.getItemMeta().getDisplayName().startsWith(ChatColor.GREEN + "Place "))
{
ParticleType particleType = ParticleType.getFromFriendlyName(itemInHand.getItemMeta().getDisplayName().substring(8));
if (particleType != null)
{
BuildData data = _data.get(event.getPlayer());
if (data != null)
{
data.Particles.put(event.getPlayer().getLocation(), particleType);
}
event.setCancelled(true);
}
else
{
System.out.println("Place particles error! This shouldn't happen!");
}
}
}
}

View File

@ -35,7 +35,7 @@ public class BuildData
public int Time = 6000;
public int Weather = 0;
public WeatherType Weather = WeatherType.SUNNY;
public NautHashMap<Player, Integer> Score = new NautHashMap<Player, Integer>();
@ -97,4 +97,9 @@ public class BuildData
return true;
}
public enum WeatherType
{
SUNNY, RAINING, STORMING;
}
}

View File

@ -0,0 +1,28 @@
package nautilus.game.arcade.game.games.build.gui;
import org.bukkit.entity.Player;
import mineplex.core.account.CoreClientManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.ShopBase;
import mineplex.core.shop.page.ShopPageBase;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.build.gui.page.OptionsMenu;
public class OptionsShop extends ShopBase<ArcadeManager>
{
private Build _game;
public OptionsShop(Build game, ArcadeManager plugin, CoreClientManager clientManager, DonationManager donationManager)
{
super(plugin, clientManager, donationManager, "Options");
_game = game;
}
@Override
protected ShopPageBase<ArcadeManager, ? extends ShopBase<ArcadeManager>> buildPagesFor(Player player)
{
return new OptionsMenu(_game, getPlugin(), this, getClientManager(), getDonationManager(), player);
}
}

View File

@ -0,0 +1,62 @@
package nautilus.game.arcade.game.games.build.gui.page;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.account.CoreClientManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
public class OptionsMenu extends ShopPageBase<ArcadeManager, OptionsShop>
{
private Build _game;
public OptionsMenu(Build game, ArcadeManager plugin, OptionsShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
{
super(plugin, shop, clientManager, donationManager, "Options", player, 9);
_game = game;
buildPage();
}
@Override
protected void buildPage()
{
ShopItem particles = new ShopItem(Material.NETHER_STAR, "Particles", 0, false);
ShopItem weather = new ShopItem(Material.FEATHER, "Weather", 0, false);
ShopItem time = new ShopItem(Material.WATCH, "Time of Day", 0, false);
addButton(2, particles, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(player, new ParticlesPage(_game, getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
addButton(4, weather, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(player, new WeatherPage(_game, getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
addButton(6, time, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(player, new TimePage(_game, getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
}
}

View File

@ -0,0 +1,86 @@
package nautilus.game.arcade.game.games.build.gui.page;
import java.util.Arrays;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.build.BuildData;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
public class ParticlesPage extends ShopPageBase<ArcadeManager, OptionsShop>
{
private Build _game;
public ParticlesPage(Build game, ArcadeManager plugin, OptionsShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
{
super(plugin, shop, clientManager, donationManager, "Add Particles", player);
_game = game;
buildPage();
}
@Override
protected void buildPage()
{
final BuildData buildData = _game.getBuildData(getPlayer());
if (buildData == null)
{
getPlayer().closeInventory();
return;
}
int index = 0;
for (final UtilParticle.ParticleType particleType : UtilParticle.ParticleType.values())
{
if (particleType.hasFriendlyData())
{
ShopItem shopItem = new ShopItem(particleType.getMaterial(), particleType.getFriendlyName(), null, 0, false);
addButton(index, shopItem, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
String[] lore = { ChatColor.GRAY + "Right click to place" };
ItemStack itemStack = ItemStackFactory.Instance.CreateStack(particleType.getMaterial(), particleType.getData(), 1, ChatColor.GREEN + "Place " + particleType.getFriendlyName(), Arrays.asList(lore));
player.getInventory().addItem(itemStack);
}
});
index++;
}
}
ShopItem clearButton = new ShopItem(Material.TNT, "Clear Particles", null, 0, false);
addButton(53, clearButton, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
buildData.Particles.clear();
}
});
addButton((9 * 5) + 4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(player, new OptionsMenu(_game, getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
}
}

View File

@ -0,0 +1,69 @@
package nautilus.game.arcade.game.games.build.gui.page;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.build.BuildData;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
public class TimePage extends ShopPageBase<ArcadeManager, OptionsShop>
{
private Build _game;
public TimePage(Build game, ArcadeManager plugin, OptionsShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
{
super(plugin, shop, clientManager, donationManager, "Set Time", player, 18);
_game = game;
buildPage();
}
@Override
protected void buildPage()
{
final BuildData buildData = _game.getBuildData(getPlayer());
if (buildData == null)
{
getPlayer().closeInventory();
return;
}
for (int i = 0; i < 9; i++)
{
final int ticks = 3000 * i;
boolean am = (ticks >= 0 && ticks < 6000) || (ticks >= 18000);
int time = (6 + (ticks / 1000)) % 12;
if (time == 0) time = 12;
byte data = (byte) (buildData.Time == ticks ? 5 : 14);
ShopItem item = new ShopItem(Material.STAINED_CLAY, data, time + (am ? " am" : " pm"), null, 0, false, false);
addButton(i, item, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
buildData.Time = ticks;
buildPage();
}
});
}
addButton(9 + 4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(player, new OptionsMenu(_game, getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
}
}

View File

@ -0,0 +1,100 @@
package nautilus.game.arcade.game.games.build.gui.page;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.build.BuildData;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
public class WeatherPage extends ShopPageBase<ArcadeManager, OptionsShop>
{
private Build _game;
public WeatherPage(Build game, ArcadeManager plugin, OptionsShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
{
super(plugin, shop, clientManager, donationManager, "Set Weather", player, 18);
_game = game;
buildPage();
}
@Override
protected void buildPage()
{
final BuildData buildData = _game.getBuildData(getPlayer());
if (buildData == null)
{
getPlayer().closeInventory();
return;
}
int sunnySlot = 2;
int rainingSlot = 4;
int stormingSlot = 6;
ShopItem sunny = new ShopItem(Material.DOUBLE_PLANT, "Sunny", 1, false);
ShopItem raining = new ShopItem(Material.WATER_BUCKET, "Raining", 1, false);
ShopItem storming = new ShopItem(Material.BLAZE_ROD, "Storming", 1, false);
addButton(sunnySlot, sunny, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
buildData.Weather = BuildData.WeatherType.SUNNY;
buildPage();
}
});
addButton(rainingSlot, raining, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
buildData.Weather = BuildData.WeatherType.RAINING;
buildPage();
}
});
addButton(stormingSlot, storming, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
buildData.Weather = BuildData.WeatherType.STORMING;
buildPage();
}
});
switch (buildData.Weather)
{
case RAINING:
addGlow(rainingSlot);
break;
case STORMING:
addGlow(stormingSlot);
break;
default:
addGlow(sunnySlot);
}
addButton(9 + 4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(player, new OptionsMenu(_game, getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
}
}

View File

@ -30,7 +30,7 @@ public class GameGemManager implements Listener
{
ArcadeManager Manager;
boolean DoubleGem = true;
boolean DoubleGem = false;
public GameGemManager(ArcadeManager manager)
{