diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index 74c23c30e..62a00686a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -110,8 +110,8 @@ public enum GameDisplay BattleRoyale("Battle Royale", Material.DIAMOND_SWORD, (byte)0, GameCategory.EVENT, 72, false), - CakeWars4("Cake Wars Standard", Material.CAKE, (byte)0, GameCategory.INTERMEDIATE, 73, true), - CakeWarsDuos("Cake Wars Duos", Material.SUGAR, (byte)0, GameCategory.INTERMEDIATE, 74, false), + CakeWars4("Cake Wars Standard", "Cake Wars", Material.CAKE, (byte)0, GameCategory.INTERMEDIATE, 73, true), + CakeWarsDuos("Cake Wars Duos", "Cake Wars", Material.SUGAR, (byte)0, GameCategory.INTERMEDIATE, 74, false), GemHunters("Gem Hunters", Material.EMERALD, (byte) 0, GameCategory.EVENT, 71, false), 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 236ec8d70..ad08ffda0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -74,6 +74,8 @@ import nautilus.game.arcade.game.games.spleef.Spleef; import nautilus.game.arcade.game.games.squidshooters.SquidShooters; import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesNewSolo; import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesNewTeams; +import nautilus.game.arcade.game.games.survivalgames.modes.OverpoweredSGSolo; +import nautilus.game.arcade.game.games.survivalgames.modes.OverpoweredSGTeams; import nautilus.game.arcade.game.games.tug.TugOfWool; import nautilus.game.arcade.game.games.turfforts.TurfForts; import nautilus.game.arcade.game.games.typewars.TypeWars; @@ -169,8 +171,14 @@ public enum GameType implements Voteable SnowFight(SnowFight.class, GameDisplay.SnowFight), SpeedBuilders(SpeedBuilders.class, GameDisplay.SpeedBuilders), Spleef(Spleef.class, GameDisplay.Spleef), - SurvivalGames(SurvivalGamesNewSolo.class, GameDisplay.SurvivalGames), - SurvivalGamesTeams(SurvivalGamesNewTeams.class, GameDisplay.SurvivalGamesTeams, new GameType[]{GameType.SurvivalGames}, false), + SurvivalGames(SurvivalGamesNewSolo.class, new GameMode[] + { + new GameMode(OverpoweredSGSolo.class, "Overpowered") + }, GameDisplay.SurvivalGames), + SurvivalGamesTeams(SurvivalGamesNewTeams.class, new GameMode[] + { + new GameMode(OverpoweredSGTeams.class, "Overpowered") + }, GameDisplay.SurvivalGamesTeams, new GameType[]{GameType.SurvivalGames}, false), TurfWars(TurfForts.class, GameDisplay.TurfWars), UHC(UHCTeams.class, GameDisplay.UHC), UHCSolo(UHCSolo.class, GameDisplay.UHCSolo, new GameType[] { GameType.UHC }, false), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java index f3586e7e3..89473e94e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/OverpoweredBridge.java @@ -8,6 +8,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.inventory.ItemStack; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; + import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; @@ -52,6 +54,12 @@ public class OverpoweredBridge extends Bridge player.getInventory().addItem(_items); } + @EventHandler + public void damage(CustomDamageEvent event) + { + event.SetDamageToLevel(false); + } + @Override public String GetMode() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java index 12e6750b2..c94018e21 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java @@ -624,6 +624,12 @@ public class CakeWars extends TeamGame return DeathMessageType.Detailed; } + @Override + public String GetMode() + { + return "Standard"; + } + public int getGeneratorRate(CakeResource resource, int current) { return current; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/CakeWarsDuos.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/CakeWarsDuos.java index 94ddc2778..222bc8d7e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/CakeWarsDuos.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/CakeWarsDuos.java @@ -20,4 +20,10 @@ public class CakeWarsDuos extends CakeWars new TeamRequestsModule() .register(this); } + + @Override + public String GetMode() + { + return "Duos"; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/OPCakeWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/OPCakeWars.java index cfe7b4392..f030839f4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/OPCakeWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/modes/OPCakeWars.java @@ -134,8 +134,8 @@ public class OPCakeWars extends CakeWars return; } - event.AddMod(GetMode(), event.GetDamage() * 0.25); - event.AddKnockback(GetMode(), 1.25); + event.AddMod(GetName(), event.GetDamage() * 0.25); + event.AddKnockback(GetName(), 1.25); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java index 9a2ad64b9..e34930123 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java @@ -290,7 +290,7 @@ public class Spleef extends SoloGame { if (player.getFoodLevel() <= 0) { - Manager.GetDamage().NewDamageEvent(player, null, null, DamageCause.STARVATION, 1, false, true, false, GetMode(), "Starvation"); + Manager.GetDamage().NewDamageEvent(player, null, null, DamageCause.STARVATION, 1, false, true, false, GetName(), "Starvation"); player.sendMessage(F.main("Game", C.cRedB + "Break blocks to restore hunger!")); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesNew.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesNew.java index 6fd6634e6..5ee9a66c6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesNew.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesNew.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.survivalgames; import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -37,6 +38,8 @@ import org.bukkit.inventory.BeaconInventory; import org.bukkit.inventory.ItemStack; import org.bukkit.scoreboard.NameTagVisibility; +import com.google.common.collect.Lists; + import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; @@ -467,7 +470,15 @@ public abstract class SurvivalGamesNew extends Game ChestLootModule lootModule = new ChestLootModule(); - lootModule.registerChestType("Tier 1", _chests, 0.35, + setupTier1Loot(lootModule, compassModule, tnt, _chests); + setupTier2Loot(lootModule, compassModule, tnt, midChests); + + lootModule.register(this); + } + + protected void setupTier1Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + lootModule.registerChestType("Tier 1", chests, 0.35, new ChestLootPool() .addItem(new ItemStack(Material.WOOD_AXE), 240) @@ -524,8 +535,11 @@ public abstract class SurvivalGamesNew extends Game .addItem(compassModule.getCompass(5)) .addItem(tnt, 50) ); + } - lootModule.registerChestType("Tier 2", midChests, + protected void setupTier2Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + lootModule.registerChestType("Tier 2", chests, new ChestLootPool() .addItem(new ItemStack(Material.WOOD_AXE), 240) @@ -591,8 +605,29 @@ public abstract class SurvivalGamesNew extends Game .addItem(tnt, 50) ); + } - lootModule.register(this); + public void setupSupplyDropLoot(Map> items) + { + items.put(1, Lists.newArrayList + ( + new ItemStack(Material.IRON_BOOTS), + new ItemStack(Material.IRON_SWORD), + new ItemStack(Material.DIAMOND_AXE) + )); + items.put(2, Lists.newArrayList + ( + new ItemStack(Material.IRON_CHESTPLATE), + new ItemStack(Material.IRON_LEGGINGS), + new ItemStack(Material.DIAMOND_HELMET), + new ItemStack(Material.DIAMOND_BOOTS) + )); + items.put(3, Lists.newArrayList + ( + new ItemStack(Material.DIAMOND_CHESTPLATE), + new ItemStack(Material.DIAMOND_LEGGINGS), + new ItemStack(Material.DIAMOND_SWORD) + )); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGModule.java new file mode 100644 index 000000000..aaeaf7ddd --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGModule.java @@ -0,0 +1,183 @@ +package nautilus.game.arcade.game.games.survivalgames.modes; + +import java.util.List; +import java.util.Map; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; + +import com.google.common.collect.Lists; + +import mineplex.core.itemstack.ItemBuilder; + +import nautilus.game.arcade.game.games.survivalgames.modules.TrackingCompassModule; +import nautilus.game.arcade.game.modules.Module; +import nautilus.game.arcade.game.modules.chest.ChestLootModule; +import nautilus.game.arcade.game.modules.chest.ChestLootPool; + +class OverpoweredSGModule extends Module +{ + + void setupTier1Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + lootModule.registerChestType("Tier 1", chests, 0.35, + + new ChestLootPool() + .addItem(new ItemStack(Material.DIAMOND_AXE), 240) + .addItem(new ItemStack(Material.DIAMOND_SWORD), 210) + .setUnbreakable(true) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.DIAMOND_HELMET)) + .addItem(new ItemStack(Material.DIAMOND_CHESTPLATE)) + .addItem(new ItemStack(Material.DIAMOND_LEGGINGS)) + .addItem(new ItemStack(Material.DIAMOND_BOOTS)) + .setAmountsPerChest(1, 2) + .setUnbreakable(true) + .setEnchantmentRarity(0.3) + .addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2) + .addEnchantment(Enchantment.PROTECTION_PROJECTILE, 2) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.BOW)) + .setProbability(0.2) + .setUnbreakable(true) + .setEnchantmentRarity(0.5) + .addEnchantment(Enchantment.ARROW_DAMAGE, 2) + .addEnchantment(Enchantment.ARROW_KNOCKBACK, 2) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.FISHING_ROD)) + .addItem(new ItemStack(Material.ARROW), 10, 20, 50) + .addItem(new ItemStack(Material.SNOW_BALL), 10, 20) + .addItem(new ItemStack(Material.EGG), 10, 20) + .setUnbreakable(true) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.COOKED_BEEF), 4, 8) + .addItem(new ItemStack(Material.COOKED_CHICKEN), 4, 8) + .addItem(new ItemStack(Material.GRILLED_PORK), 4, 8) + .addItem(new ItemStack(Material.MUSHROOM_SOUP)) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.EXP_BOTTLE), 16, 32) + .addItem(new ItemStack(Material.STICK), 1, 2) + .addItem(new ItemStack(Material.BOAT), 50) + .addItem(new ItemStack(Material.FLINT), 1, 2, 70) + .addItem(new ItemStack(Material.FEATHER), 1, 2, 70) + .addItem(new ItemStack(Material.GOLD_INGOT), 1, 1, 80) + .addItem(compassModule.getCompass(10)) + .addItem(tnt) + ); + } + + void setupTier2Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + lootModule.registerChestType("Tier 2", chests, + + new ChestLootPool() + .addItem(new ItemStack(Material.DIAMOND_SWORD)) + .setUnbreakable(true) + .setEnchantmentRarity(0.5) + .addEnchantment(Enchantment.DAMAGE_ALL, 2) + .addEnchantment(Enchantment.KNOCKBACK, 2) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.DIAMOND_HELMET)) + .addItem(new ItemStack(Material.DIAMOND_CHESTPLATE)) + .addItem(new ItemStack(Material.DIAMOND_LEGGINGS)) + .addItem(new ItemStack(Material.DIAMOND_BOOTS)) + .setAmountsPerChest(1, 2) + .setUnbreakable(true) + .setEnchantmentRarity(0.5) + .addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3) + .addEnchantment(Enchantment.PROTECTION_PROJECTILE, 3) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.BOW)) + .setProbability(0.2) + .setUnbreakable(true) + .setEnchantmentRarity(0.5) + .addEnchantment(Enchantment.ARROW_DAMAGE, 3) + .addEnchantment(Enchantment.ARROW_KNOCKBACK, 3), + + new ChestLootPool() + .addItem(new ItemStack(Material.FISHING_ROD)) + .addItem(new ItemStack(Material.ARROW), 10, 20, 50) + .addItem(new ItemStack(Material.SNOW_BALL), 10, 20) + .addItem(new ItemStack(Material.EGG), 10, 20) + .setUnbreakable(true) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.COOKED_BEEF), 4, 8) + .addItem(new ItemStack(Material.COOKED_CHICKEN), 4, 8) + .addItem(new ItemStack(Material.GRILLED_PORK), 4, 8) + .addItem(new ItemStack(Material.MUSHROOM_SOUP)) + , + + new ChestLootPool() + .addItem(new ItemStack(Material.EXP_BOTTLE), 16, 32) + .addItem(new ItemStack(Material.STICK), 1, 2) + .addItem(new ItemStack(Material.BOAT), 50) + .addItem(new ItemStack(Material.FLINT), 1, 2, 70) + .addItem(new ItemStack(Material.FEATHER), 1, 2, 70) + .addItem(new ItemStack(Material.GOLD_INGOT), 1, 1, 80) + .addItem(new ItemStack(Material.DIAMOND), 1, 1, 70) + .addItem(compassModule.getCompass(10)) + .addItem(tnt) + + ); + } + + void setupSupplyDropLoot(Map> items) + { + items.put(1, Lists.newArrayList + ( + new ItemBuilder(Material.DIAMOND_HELMET) + .addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3) + .setUnbreakable(true) + .build(), + new ItemBuilder(Material.DIAMOND_CHESTPLATE) + .addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3) + .setUnbreakable(true) + .build(), + new ItemBuilder(Material.DIAMOND_LEGGINGS) + .addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3) + .setUnbreakable(true) + .build(), + new ItemBuilder(Material.DIAMOND_BOOTS) + .addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3) + .setUnbreakable(true) + .build() + )); + items.put(2, Lists.newArrayList + ( + new ItemBuilder(Material.DIAMOND_SWORD) + .addEnchantment(Enchantment.DAMAGE_ALL, 2) + .addEnchantment(Enchantment.KNOCKBACK, 2) + .setUnbreakable(true) + .build(), + new ItemBuilder(Material.DIAMOND_SWORD) + .addEnchantment(Enchantment.DAMAGE_ALL, 1) + .addEnchantment(Enchantment.KNOCKBACK, 1) + .setUnbreakable(true) + .build() + )); + items.put(3, Lists.newArrayList + ( + new ItemBuilder(Material.STICK) + .addEnchantment(Enchantment.KNOCKBACK, 4) + .build() + )); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGSolo.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGSolo.java new file mode 100644 index 000000000..1aa132ab2 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGSolo.java @@ -0,0 +1,56 @@ +package nautilus.game.arcade.game.games.survivalgames.modes; + +import java.util.List; +import java.util.Map; + +import org.bukkit.Location; +import org.bukkit.inventory.ItemStack; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesNewSolo; +import nautilus.game.arcade.game.games.survivalgames.modules.TrackingCompassModule; +import nautilus.game.arcade.game.modules.chest.ChestLootModule; + +public class OverpoweredSGSolo extends SurvivalGamesNewSolo +{ + + private final OverpoweredSGModule _opModule; + + public OverpoweredSGSolo(ArcadeManager manager) + { + super(manager); + + _opModule = new OverpoweredSGModule(); + _opModule.register(this); + } + + @Override + protected void setupTier1Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + _opModule.setupTier1Loot(lootModule, compassModule, tnt, chests); + } + + @Override + protected void setupTier2Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + _opModule.setupTier2Loot(lootModule, compassModule, tnt, chests); + } + + @Override + public void setupSupplyDropLoot(Map> items) + { + _opModule.setupSupplyDropLoot(items); + } + + @Override + public boolean isAllowingGameStats() + { + return false; + } + + @Override + public String GetMode() + { + return "Overpowered"; + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGTeams.java new file mode 100644 index 000000000..2eb3b5ab6 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/OverpoweredSGTeams.java @@ -0,0 +1,56 @@ +package nautilus.game.arcade.game.games.survivalgames.modes; + +import java.util.List; +import java.util.Map; + +import org.bukkit.Location; +import org.bukkit.inventory.ItemStack; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesNewTeams; +import nautilus.game.arcade.game.games.survivalgames.modules.TrackingCompassModule; +import nautilus.game.arcade.game.modules.chest.ChestLootModule; + +public class OverpoweredSGTeams extends SurvivalGamesNewTeams +{ + + private final OverpoweredSGModule _opModule; + + public OverpoweredSGTeams(ArcadeManager manager) + { + super(manager); + + _opModule = new OverpoweredSGModule(); + _opModule.register(this); + } + + @Override + protected void setupTier1Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + _opModule.setupTier1Loot(lootModule, compassModule, tnt, chests); + } + + @Override + protected void setupTier2Loot(ChestLootModule lootModule, TrackingCompassModule compassModule, ItemStack tnt, List chests) + { + _opModule.setupTier2Loot(lootModule, compassModule, tnt, chests); + } + + @Override + public void setupSupplyDropLoot(Map> items) + { + _opModule.setupSupplyDropLoot(items); + } + + @Override + public boolean isAllowingGameStats() + { + return false; + } + + @Override + public String GetMode() + { + return "Overpowered"; + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modules/SupplyDropModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modules/SupplyDropModule.java index f68af00bb..1494679a3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modules/SupplyDropModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modules/SupplyDropModule.java @@ -26,9 +26,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; - import mineplex.core.blockrestore.BlockRestore; import mineplex.core.common.Pair; import mineplex.core.common.util.C; @@ -51,6 +48,9 @@ import mineplex.core.treasure.util.TreasureUtil; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesNew; import nautilus.game.arcade.game.modules.Module; public class SupplyDropModule extends Module @@ -85,7 +85,7 @@ public class SupplyDropModule extends Module 2, 3 } }; - private final ImmutableMap> _lootTable; + private final Map> _lootTable; private final Inventory _chestInventory; private SupplyDrop _supplyDrop; private Block _lastBlock; @@ -94,28 +94,7 @@ public class SupplyDropModule extends Module public SupplyDropModule() { - _lootTable = ImmutableMap.>builder() - .put(1, Lists.newArrayList - ( - new ItemStack(Material.IRON_BOOTS), - new ItemStack(Material.IRON_SWORD), - new ItemStack(Material.DIAMOND_AXE) - )) - .put(2, Lists.newArrayList - ( - new ItemStack(Material.IRON_CHESTPLATE), - new ItemStack(Material.IRON_LEGGINGS), - new ItemStack(Material.DIAMOND_HELMET), - new ItemStack(Material.DIAMOND_BOOTS) - )) - .put(3, Lists.newArrayList - ( - new ItemStack(Material.DIAMOND_CHESTPLATE), - new ItemStack(Material.DIAMOND_LEGGINGS), - new ItemStack(Material.DIAMOND_SWORD) - )) - .build(); - + _lootTable = new HashMap<>(3); _chestInventory = Bukkit.createInventory(null, 27, "Supply Drop"); } @@ -127,6 +106,17 @@ public class SupplyDropModule extends Module _lastBlock = null; } + @EventHandler + public void prepare(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Prepare) + { + return; + } + + ((SurvivalGamesNew) getGame()).setupSupplyDropLoot(_lootTable); + } + @EventHandler public void update(UpdateEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java index 66cebddbf..c044f58d9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java @@ -514,7 +514,7 @@ public class TurfForts extends TeamGame } else { - event.AddMod(GetMode(), "One Hit Kill", 500, false); + event.AddMod(GetName(), "One Hit Kill", 500, false); } } else if (event.GetCause() == DamageCause.ENTITY_ATTACK) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java index 0befac722..e9b57ccbe 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java @@ -40,7 +40,7 @@ public class GamePlayerManager implements Listener public static final String FOOTER = "Visit " + C.cGreen + "www.mineplex.com" + C.Reset + " for News, Forums and Shop"; public static String getHeader(Game game) { - return C.cGoldB + (game == null ? "Waiting For Players" : game.GetType().getName() + (game.GetMode() == null ? "" : C.cWhiteB + " - " + C.cYellowB + game.GetMode())); + return C.cGoldB + (game == null ? "Waiting For Players" : game.GetType().GetLobbyName() + (game.GetMode() == null ? "" : C.cWhiteB + " - " + C.cYellowB + game.GetMode())); } final ArcadeManager Manager;