From 283d550903236ca5b3f0976b98095ea5e96d7296 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 1 May 2015 01:24:01 -0500 Subject: [PATCH 1/9] Added Wizards to quick game menu. --- .../mineplex/hub/server/ServerManager.java | 5 +++ .../hub/server/ui/ServerGameMenu.java | 31 ++++++++++++++----- .../hub/server/ui/button/SelectWIZButton.java | 23 ++++++++++++++ 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectWIZButton.java diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index 597de1c2b..a0c85fa2d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -744,4 +744,9 @@ public class ServerManager extends MiniPlugin { return _serverNpcShopMap.get("Mine-Strike"); } + + public ShopBase getWizardShop() + { + return _serverNpcShopMap.get("Wizards"); + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 6acd08b2d..2cf8cb46b 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -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 { @@ -35,7 +36,7 @@ public class ServerGameMenu extends ShopPageBase 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 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 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 { getPlugin().getMinestrikeShop().attemptShopOpen(player); } + + public void OpenWIZ(Player player) + { + getPlugin().getWizardShop().attemptShopOpen(player); + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectWIZButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectWIZButton.java new file mode 100644 index 000000000..d82bc7a23 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectWIZButton.java @@ -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); + } +} From cc65830f9be14a4f4f275171b493b814def8bc03 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 1 May 2015 19:24:20 +1200 Subject: [PATCH 2/9] ResourcePack: Ignore ServerGroup's resource pack and set MineStrike to use new ResourcePack code --- .../src/mineplex/core/serverConfig/ServerConfiguration.java | 2 +- .../src/nautilus/game/arcade/GameType.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/serverConfig/ServerConfiguration.java b/Plugins/Mineplex.Core/src/mineplex/core/serverConfig/ServerConfiguration.java index d0c29b368..02cc887b0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/serverConfig/ServerConfiguration.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/serverConfig/ServerConfiguration.java @@ -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 diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 0b1975da0..a0d9cb96f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -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), @@ -52,7 +52,7 @@ public enum GameType TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45), UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46), WitherAssault("Wither Assault", Material.SKULL_ITEM, (byte)1, GameCategory.ARCADE, 47), - Wizards("Wizards", Material.BLAZE_ROD, (byte)0, GameCategory.SURVIVAL, 48, "http://chivebox.com/file/c/ResWizards.zip", true), + Wizards("Wizards", Material.BLAZE_ROD, (byte)0, GameCategory.SURVIVAL, 48, "https://chivebox.com/file/c/ResWizards.zip", true), ZombieSurvival("Zombie Survival", Material.SKULL_ITEM, (byte)2, GameCategory.SURVIVAL, 49), Build("Master Builders", Material.BRICK, (byte)0, GameCategory.CLASSICS, 50), From c240a1752f40051e07d9ac9eff9842952375c00e Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 1 May 2015 19:28:42 +1200 Subject: [PATCH 3/9] GameType: Update resource pack to use https not http --- .../Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index a0d9cb96f..2937bd701 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -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, "http://chivebox.com/file/c/assets.zip", false), + MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CLASSICS, 25, "https://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), From e800d74976562e26dc6fc5c9803173f26449b70f Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 1 May 2015 02:29:20 -0500 Subject: [PATCH 4/9] Disabled Double Gems. --- .../src/nautilus/game/arcade/managers/GameGemManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java index 46c4b86b6..bd55ff74b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java @@ -30,7 +30,7 @@ public class GameGemManager implements Listener { ArcadeManager Manager; - boolean DoubleGem = true; + boolean DoubleGem = false; public GameGemManager(ArcadeManager manager) { From 84a5e5e5214623ff760b93b3f3e1a3e05dfe3d54 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 1 May 2015 02:29:34 -0500 Subject: [PATCH 5/9] Added motd. --- .../src/mineplex/bungee/motd/MotdManager.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index e420dfaa7..68680211a 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -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 lines = new ArrayList(); - 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) From 93a25d5a676063f8f0796d59c114c34035506bdc Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 1 May 2015 21:26:42 +1200 Subject: [PATCH 6/9] ResourcePack: Fixed links and declined message --- .../src/nautilus/game/arcade/ArcadeManager.java | 2 +- .../src/nautilus/game/arcade/GameType.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 7ad59fed2..22219056b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -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) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 2937bd701..3a514a456 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -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, "https://chivebox.com/file/c/assets.zip", false), + 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), @@ -52,7 +52,7 @@ public enum GameType TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45), UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46), WitherAssault("Wither Assault", Material.SKULL_ITEM, (byte)1, GameCategory.ARCADE, 47), - Wizards("Wizards", Material.BLAZE_ROD, (byte)0, GameCategory.SURVIVAL, 48, "https://chivebox.com/file/c/ResWizards.zip", true), + Wizards("Wizards", Material.BLAZE_ROD, (byte)0, GameCategory.SURVIVAL, 48, "http://chivebox.com/file/c/ResWizards.zip", true), ZombieSurvival("Zombie Survival", Material.SKULL_ITEM, (byte)2, GameCategory.SURVIVAL, 49), Build("Master Builders", Material.BRICK, (byte)0, GameCategory.CLASSICS, 50), From 37f1f7eabbe8f24543423f8bf9f7ea4d38e53ebd Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 1 May 2015 17:46:42 -0500 Subject: [PATCH 7/9] Master Builders changes for chiss --- .../artifacts/Mineplex_Game_Clans_jar.xml | 2 +- .../artifacts/Nautilus_Game_Arcade_jar.xml | 2 +- Plugins/.idea/misc.xml | 3 - .../core/common/util/UtilParticle.java | 113 ++++++++++++------ .../game/arcade/game/games/build/Build.java | 73 +++++++++++ .../arcade/game/games/build/BuildData.java | 7 +- .../game/games/build/gui/OptionsShop.java | 28 +++++ .../games/build/gui/page/OptionsMenu.java | 62 ++++++++++ .../games/build/gui/page/ParticlesPage.java | 86 +++++++++++++ .../game/games/build/gui/page/TimePage.java | 69 +++++++++++ .../games/build/gui/page/WeatherPage.java | 100 ++++++++++++++++ 11 files changed, 503 insertions(+), 42 deletions(-) create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/OptionsShop.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/OptionsMenu.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/TimePage.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/WeatherPage.java diff --git a/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml b/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml index 85ea6bec4..d88c9bbd4 100644 --- a/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml +++ b/Plugins/.idea/artifacts/Mineplex_Game_Clans_jar.xml @@ -5,7 +5,6 @@ - @@ -18,6 +17,7 @@ + \ No newline at end of file diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml index cd4447b88..3f5cae6e4 100644 --- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml +++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/Plugins/.idea/misc.xml b/Plugins/.idea/misc.xml index d5107f5ca..76fba6e9f 100644 --- a/Plugins/.idea/misc.xml +++ b/Plugins/.idea/misc.xml @@ -10,7 +10,4 @@ - - - \ No newline at end of file diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java index 1c42b669e..699b4f48c 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java @@ -5,6 +5,7 @@ import java.lang.reflect.Field; import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; @@ -12,47 +13,87 @@ public class UtilParticle { public enum ParticleType { - HUGE_EXPLOSION("hugeexplosion"), - LARGE_EXPLODE("largeexplode"), - FIREWORKS_SPARK("fireworksSpark"), - BUBBLE("bubble"), - SUSPEND("suspended"), - DEPTH_SUSPEND("depthSuspend"), - TOWN_AURA("townaura"), - CRIT("crit"), - MAGIC_CRIT("magicCrit"), - MOB_SPELL("mobSpell"), - MOB_SPELL_AMBIENT("mobSpellAmbient"), - SPELL("spell"), - INSTANT_SPELL("instantSpell"), - WITCH_MAGIC("witchMagic"), - NOTE("note"), - PORTAL("portal"), - ENCHANTMENT_TABLE("enchantmenttable"), - EXPLODE("explode"), - FLAME("flame"), - LAVA("lava"), - FOOTSTEP("footstep"), - SPLASH("splash"), - LARGE_SMOKE("largesmoke"), - CLOUD("cloud"), - RED_DUST("reddust"), - SNOWBALL_POOF("snowballpoof"), - DRIP_WATER("dripWater"), - DRIP_LAVA("dripLava"), - DROPLET("droplet"), - SNOW_SHOVEL("snowshovel"), - SLIME("slime"), - HEART("heart"), - ANGRY_VILLAGER("angryVillager"), - HAPPY_VILLAGER("happyVillager"); + // TODO Update material data as well as friendly name + HUGE_EXPLOSION("hugeexplosion", "Huge Explosion", Material.SAPLING, (byte) 0, true), + LARGE_EXPLODE("largeexplode", "Large Explosion", Material.SAPLING, (byte) 0, true), + FIREWORKS_SPARK("fireworksSpark", "Spark", Material.SAPLING, (byte) 0, true), + BUBBLE("bubble", "Bubble", Material.SAPLING, (byte) 0, true), + SUSPEND("suspended", "Suspended", Material.SAPLING, (byte) 0, true), + DEPTH_SUSPEND("depthSuspend", "Depth Suspend", Material.SAPLING, (byte) 0, true), + TOWN_AURA("townaura", "Town Aura", Material.SAPLING, (byte) 0, true), + CRIT("crit", "Critical Hit", Material.SAPLING, (byte) 0, true), + MAGIC_CRIT("magicCrit", "Magic Critical Hit", Material.SAPLING, (byte) 0, true), + MOB_SPELL("mobSpell", "Mob Spell", Material.SAPLING, (byte) 0, true), + MOB_SPELL_AMBIENT("mobSpellAmbient", "Mob Spell Ambient", Material.SAPLING, (byte) 0, true), + SPELL("spell", "Spell", Material.SAPLING, (byte) 0, true), + INSTANT_SPELL("instantSpell", "Instant Spell", Material.SAPLING, (byte) 0, true), + WITCH_MAGIC("witchMagic", "Witch Magic", Material.SAPLING, (byte) 0, true), + NOTE("note", "Note", Material.SAPLING, (byte) 0, true), + PORTAL("portal", "Portal", Material.SAPLING, (byte) 0, true), + ENCHANTMENT_TABLE("enchantmenttable", "Enchantment Table", Material.SAPLING, (byte) 0, true), + EXPLODE("explode", "Explode", Material.SAPLING, (byte) 0, true), + FLAME("flame", "Flame", Material.SAPLING, (byte) 0, true), + LAVA("lava", "Lava", Material.SAPLING, (byte) 0, true), + FOOTSTEP("footstep", "Footstep", Material.SAPLING, (byte) 0, true), + SPLASH("splash", "Splash", Material.SAPLING, (byte) 0, true), + LARGE_SMOKE("largesmoke", "Large Smoke", Material.SAPLING, (byte) 0, true), + CLOUD("cloud", "Cloud", Material.SAPLING, (byte) 0, true), + RED_DUST("reddust", "Red Dust", Material.SAPLING, (byte) 0, true), + SNOWBALL_POOF("snowballpoof", "Snowball Poof", Material.SAPLING, (byte) 0, true), + DRIP_WATER("dripWater", "Drip Water", Material.SAPLING, (byte) 0, true), + DRIP_LAVA("dripLava", "Drip Lava", Material.SAPLING, (byte) 0, true), + DROPLET("droplet", "Droplet", Material.SAPLING, (byte) 0, true), + SNOW_SHOVEL("snowshovel", "Snow Shovel", Material.SAPLING, (byte) 0, true), + SLIME("slime", "Slime", Material.SAPLING, (byte) 0, true), + HEART("heart", "Heart", Material.SAPLING, (byte) 0, true), + ANGRY_VILLAGER("angryVillager", "Angry Villager", Material.SAPLING, (byte) 0, true), + HAPPY_VILLAGER("happyVillager", "Happy Villager", Material.SAPLING, (byte) 0, true); public String particleName; - - ParticleType(String particleName) + private String _friendlyName; + private Material _material; + private byte _data; + private boolean _displayGuis; + + ParticleType(String particleName, String friendlyName, Material material, byte data, boolean displayGuis) { this.particleName = particleName; + _friendlyName = friendlyName; + _material = material; + _data = data; + _displayGuis = displayGuis; } + + public String getFriendlyName() + { + return _friendlyName; + } + + public Material getMaterial() + { + return _material; + } + + public byte getData() + { + return _data; + } + + public boolean shouldDisplayGuis() + { + return _displayGuis; + } + + public static ParticleType getFromFriendlyName(String name) + { + for (ParticleType t : values()) + { + if (t.getFriendlyName().equals(name)) + return t; + } + + return null; + } } public static void PlayParticle(Player player, ParticleType type, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index ea1417dee..b2fa275c2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -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!", 5, 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 * 1.5d)); } + public BuildData getBuildData(Player player) + { + return _data.get(player); + } + @EventHandler public void blockPlace(BlockPlaceEvent event) { @@ -624,4 +642,59 @@ 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 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); + } + } + else + { + System.out.println("Place particles error! This shouldn't happen!"); + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java index e007a60d6..b169ef50d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java @@ -35,7 +35,7 @@ public class BuildData public int Time = 6000; - public int Weather = 0; + public WeatherType Weather = WeatherType.SUNNY; public NautHashMap Score = new NautHashMap(); @@ -97,4 +97,9 @@ public class BuildData return true; } + + public enum WeatherType + { + SUNNY, RAINING, STORMING; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/OptionsShop.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/OptionsShop.java new file mode 100644 index 000000000..f1d9e43e1 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/OptionsShop.java @@ -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 +{ + private Build _game; + + public OptionsShop(Build game, ArcadeManager plugin, CoreClientManager clientManager, DonationManager donationManager) + { + super(plugin, clientManager, donationManager, "Options"); + _game = game; + } + + @Override + protected ShopPageBase> buildPagesFor(Player player) + { + return new OptionsMenu(_game, getPlugin(), this, getClientManager(), getDonationManager(), player); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/OptionsMenu.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/OptionsMenu.java new file mode 100644 index 000000000..4025b12ad --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/OptionsMenu.java @@ -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 +{ + 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)); + } + }); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java new file mode 100644 index 000000000..fd3bfa24f --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java @@ -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 +{ + 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.shouldDisplayGuis()) + { + 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)); + } + }); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/TimePage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/TimePage.java new file mode 100644 index 000000000..981d50e2e --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/TimePage.java @@ -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 +{ + 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)); + } + }); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/WeatherPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/WeatherPage.java new file mode 100644 index 000000000..484b3c896 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/WeatherPage.java @@ -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 +{ + 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)); + } + }); + } +} From 244ffece8a6d43cbacd52e6c15f915fe363a8622 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 1 May 2015 18:02:06 -0500 Subject: [PATCH 8/9] Fixes for build game + fix clans compile --- .../core/common/util/UtilParticle.java | 45 ++++++++++++++++++- .../src/mineplex/game/clans/Clans.java | 4 +- .../game/arcade/game/games/build/Build.java | 2 + .../games/build/gui/page/ParticlesPage.java | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java index 0cd02d837..df8cd78a2 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java @@ -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, diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index 6c61713e8..899cbc101 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -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); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 907c717cf..1b607c9aa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -686,6 +686,8 @@ public class Build extends SoloGame { data.Particles.put(event.getPlayer().getLocation(), particleType); } + + event.setCancelled(true); } else { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java index fd3bfa24f..4afc50e15 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/ParticlesPage.java @@ -46,7 +46,7 @@ public class ParticlesPage extends ShopPageBase int index = 0; for (final UtilParticle.ParticleType particleType : UtilParticle.ParticleType.values()) { - if (particleType.shouldDisplayGuis()) + if (particleType.hasFriendlyData()) { ShopItem shopItem = new ShopItem(particleType.getMaterial(), particleType.getFriendlyName(), null, 0, false); addButton(index, shopItem, new IButton() From e04b61a91dcb7d8055e278eba6beb6d0a63b8ea7 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Fri, 1 May 2015 18:03:56 -0500 Subject: [PATCH 9/9] Give build item when game starts --- .../nautilus/game/arcade/game/games/build/Build.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 1b607c9aa..826aa9289 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -646,6 +646,16 @@ public class Build extends SoloGame _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) {