From 5e7ddb968e6cc3f2954485544c8a0ffa9ab5dcc3 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sat, 10 Oct 2015 15:54:18 -0400 Subject: [PATCH 01/17] Changes and bug fixes. --- .../nautilus/game/arcade/ArcadeManager.java | 210 +++++++++--------- .../game/games/halloween/kits/KitThor.java | 2 +- .../game/arcade/kit/perks/PerkFlameSlam.java | 6 + .../game/arcade/kit/perks/PerkFletcher.java | 41 ++-- .../arcade/kit/perks/PerkHammerThrow.java | 51 +++-- .../game/arcade/kit/perks/PerkHorsePet.java | 13 +- .../game/arcade/managers/GameFlagManager.java | 1 + 7 files changed, 171 insertions(+), 153 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 76e4c2e9d..90b0a8c20 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -1,12 +1,113 @@ package nautilus.game.arcade; -import java.awt.Event; import java.io.File; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClientManager; +import mineplex.core.achievement.AchievementManager; +import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.blood.Blood; +import mineplex.core.bonuses.BonusManager; +import mineplex.core.chat.Chat; +import mineplex.core.common.Rank; +import mineplex.core.common.jsonchat.ClickEvent; +import mineplex.core.common.jsonchat.JsonMessage; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.creature.Creature; +import mineplex.core.disguise.DisguiseManager; +import mineplex.core.donation.DonationManager; +import mineplex.core.elo.EloManager; +import mineplex.core.energy.Energy; +import mineplex.core.explosion.Explosion; +import mineplex.core.explosion.ExplosionEvent; +import mineplex.core.hologram.HologramManager; +import mineplex.core.inventory.InventoryManager; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.movement.Movement; +import mineplex.core.notifier.NotificationManager; +import mineplex.core.npc.NpcManager; +import mineplex.core.packethandler.IPacketHandler; +import mineplex.core.packethandler.PacketHandler; +import mineplex.core.packethandler.PacketInfo; +import mineplex.core.packethandler.PacketPlayResourcePackStatus; +import mineplex.core.packethandler.PacketPlayResourcePackStatus.EnumResourcePackStatus; +import mineplex.core.party.PartyManager; +import mineplex.core.pet.PetManager; +import mineplex.core.poll.PollManager; +import mineplex.core.portal.Portal; +import mineplex.core.preferences.PreferencesManager; +import mineplex.core.projectile.ProjectileManager; +import mineplex.core.resourcepack.ResPackManager; +import mineplex.core.resourcepack.ResUnloadCheck; +import mineplex.core.resourcepack.redis.RedisUnloadResPack; +import mineplex.core.reward.RewardRarity; +import mineplex.core.reward.rewards.PetReward; +import mineplex.core.stats.StatsManager; +import mineplex.core.status.ServerStatusManager; +import mineplex.core.task.TaskManager; +import mineplex.core.teleport.Teleport; +import mineplex.core.timing.TimingManager; +import mineplex.core.titangiveaway.TitanGiveawayManager; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.classcombat.Class.ClassManager; +import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager; +import mineplex.minecraft.game.classcombat.Skill.SkillFactory; +import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; +import mineplex.minecraft.game.classcombat.item.ItemFactory; +import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent; +import mineplex.minecraft.game.classcombat.shop.ClassCombatShop; +import mineplex.minecraft.game.classcombat.shop.ClassShopManager; +import mineplex.minecraft.game.core.IRelation; +import mineplex.minecraft.game.core.condition.ConditionManager; +import mineplex.minecraft.game.core.damage.DamageManager; +import mineplex.minecraft.game.core.fire.Fire; +import nautilus.game.arcade.addons.SoupAddon; +import nautilus.game.arcade.addons.TeamArmorAddon; +import nautilus.game.arcade.addons.compass.CompassAddon; +import nautilus.game.arcade.command.DisguiseCommand; +import nautilus.game.arcade.command.GameCommand; +import nautilus.game.arcade.command.KitUnlockCommand; +import nautilus.game.arcade.command.RequiredRankCommand; +import nautilus.game.arcade.command.WriteCommand; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.GameServerConfig; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.games.event.EventModule; +import nautilus.game.arcade.game.games.uhc.UHC; +import nautilus.game.arcade.managers.GameAchievementManager; +import nautilus.game.arcade.managers.GameChatManager; +import nautilus.game.arcade.managers.GameCreationManager; +import nautilus.game.arcade.managers.GameFlagManager; +import nautilus.game.arcade.managers.GameGemManager; +import nautilus.game.arcade.managers.GameHostManager; +import nautilus.game.arcade.managers.GameLobbyManager; +import nautilus.game.arcade.managers.GameLootManager; +import nautilus.game.arcade.managers.GameManager; +import nautilus.game.arcade.managers.GamePlayerManager; +import nautilus.game.arcade.managers.GameSpectatorManager; +import nautilus.game.arcade.managers.GameStatManager; +import nautilus.game.arcade.managers.GameTournamentManager; +import nautilus.game.arcade.managers.GameWorldManager; +import nautilus.game.arcade.managers.HolidayManager; +import nautilus.game.arcade.managers.IdleManager; +import nautilus.game.arcade.managers.MiscManager; +import nautilus.game.arcade.shop.ArcadeShop; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; @@ -37,111 +138,6 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.util.Vector; import com.google.common.base.Objects; - -import mineplex.core.MiniPlugin; -import mineplex.core.account.CoreClientManager; -import mineplex.core.achievement.AchievementManager; -import mineplex.core.blockrestore.BlockRestore; -import mineplex.core.blood.Blood; -import mineplex.core.bonuses.BonusManager; -import mineplex.core.chat.Chat; -import mineplex.core.common.Rank; -import mineplex.core.common.jsonchat.ClickEvent; -import mineplex.core.common.jsonchat.JsonMessage; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilGear; -import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.cosmetic.CosmeticManager; -import mineplex.core.creature.Creature; -import mineplex.core.disguise.DisguiseManager; -import mineplex.core.donation.DonationManager; -import mineplex.core.elo.EloManager; -import mineplex.core.energy.Energy; -import mineplex.core.explosion.Explosion; -import mineplex.core.explosion.ExplosionEvent; -import mineplex.core.gadget.gadgets.OutfitTeam; -import mineplex.core.gadget.types.Gadget; -import mineplex.core.gadget.types.GadgetType; -import mineplex.core.hologram.HologramManager; -import mineplex.core.inventory.InventoryManager; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.movement.Movement; -import mineplex.core.notifier.NotificationManager; -import mineplex.core.npc.NpcManager; -import mineplex.core.packethandler.IPacketHandler; -import mineplex.core.packethandler.PacketHandler; -import mineplex.core.packethandler.PacketInfo; -import mineplex.core.packethandler.PacketPlayResourcePackStatus; -import mineplex.core.packethandler.PacketPlayResourcePackStatus.EnumResourcePackStatus; -import mineplex.core.party.PartyManager; -import mineplex.core.pet.PetManager; -import mineplex.core.poll.PollManager; -import mineplex.core.portal.Portal; -import mineplex.core.preferences.PreferencesManager; -import mineplex.core.projectile.ProjectileManager; -import mineplex.core.resourcepack.ResUnloadCheck; -import mineplex.core.resourcepack.ResPackManager; -import mineplex.core.resourcepack.redis.RedisUnloadResPack; -import mineplex.core.reward.RewardRarity; -import mineplex.core.reward.rewards.PetReward; -import mineplex.core.stats.StatsManager; -import mineplex.core.status.ServerStatusManager; -import mineplex.core.task.TaskManager; -import mineplex.core.teleport.Teleport; -import mineplex.core.timing.TimingManager; -import mineplex.core.titangiveaway.TitanGiveawayManager; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.classcombat.Class.ClassManager; -import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager; -import mineplex.minecraft.game.classcombat.Skill.SkillFactory; -import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; -import mineplex.minecraft.game.classcombat.item.ItemFactory; -import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent; -import mineplex.minecraft.game.classcombat.shop.ClassCombatShop; -import mineplex.minecraft.game.classcombat.shop.ClassShopManager; -import mineplex.minecraft.game.core.IRelation; -import mineplex.minecraft.game.core.condition.ConditionManager; -import mineplex.minecraft.game.core.damage.DamageManager; -import mineplex.minecraft.game.core.fire.Fire; -import nautilus.game.arcade.addons.SoupAddon; -import nautilus.game.arcade.addons.TeamArmorAddon; -import nautilus.game.arcade.addons.compass.CompassAddon; -import nautilus.game.arcade.command.DisguiseCommand; -import nautilus.game.arcade.command.GameCommand; -import nautilus.game.arcade.command.RequiredRankCommand; -import nautilus.game.arcade.command.WriteCommand; -import nautilus.game.arcade.command.KitUnlockCommand; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.Game; -import nautilus.game.arcade.game.Game.GameState; -import nautilus.game.arcade.game.GameServerConfig; -import nautilus.game.arcade.game.GameTeam; -import nautilus.game.arcade.game.games.event.EventModule; -import nautilus.game.arcade.game.games.uhc.UHC; -import nautilus.game.arcade.managers.GameAchievementManager; -import nautilus.game.arcade.managers.GameChatManager; -import nautilus.game.arcade.managers.GameCreationManager; -import nautilus.game.arcade.managers.GameFlagManager; -import nautilus.game.arcade.managers.GameGemManager; -import nautilus.game.arcade.managers.GameHostManager; -import nautilus.game.arcade.managers.GameLobbyManager; -import nautilus.game.arcade.managers.GameLootManager; -import nautilus.game.arcade.managers.GameManager; -import nautilus.game.arcade.managers.GamePlayerManager; -import nautilus.game.arcade.managers.GameSpectatorManager; -import nautilus.game.arcade.managers.GameStatManager; -import nautilus.game.arcade.managers.GameTournamentManager; -import nautilus.game.arcade.managers.GameWorldManager; -import nautilus.game.arcade.managers.HolidayManager; -import nautilus.game.arcade.managers.IdleManager; -import nautilus.game.arcade.managers.MiscManager; -import nautilus.game.arcade.shop.ArcadeShop; public class ArcadeManager extends MiniPlugin implements IRelation { @@ -945,6 +941,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation player.setExp(0f); ((CraftPlayer) player).getHandle().spectating = false; + ((CraftPlayer) player).getHandle().ghost = false; ((CraftPlayer) player).getHandle().k = true; // Arrows go bye bye. @@ -1390,6 +1387,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation player.setFlying(true); player.setFlySpeed(0.1f); ((CraftPlayer) player).getHandle().spectating = true; + ((CraftPlayer) player).getHandle().ghost = true; ((CraftPlayer) player).getHandle().k = false; GetCondition().Factory().Cloak("Spectator", player, player, 7777, true, true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitThor.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitThor.java index fcfddb3d1..cf589fb4e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitThor.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/kits/KitThor.java @@ -38,7 +38,7 @@ public class KitThor extends AbbreviatedKit new Perk[] { new PerkKnockbackAttack(2), - new PerkFletcher(2, 2, true), + new PerkFletcher(2, 2, true, 9), new PerkSeismicHammer(), new PerkHammerThrow(), }, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java index e81e54e69..8a10e6100 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java @@ -96,6 +96,12 @@ public class PerkFlameSlam extends Perk for (Player player : copy.keySet()) { + if (!Manager.IsAlive(player) || UtilPlayer.isSpectator(player)) + { + _live.remove(player); + continue; + } + Vector vel = player.getLocation().getDirection(); vel.setY(0); UtilAlg.Normalize(vel); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFletcher.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFletcher.java index ac6763c56..399fc38e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFletcher.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFletcher.java @@ -3,7 +3,18 @@ package nautilus.game.arcade.kit.perks; import java.util.HashSet; import java.util.Iterator; -import org.bukkit.GameMode; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.kit.Perk; + import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; @@ -18,18 +29,6 @@ import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilGear; -import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.recharge.Recharge; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; -import nautilus.game.arcade.kit.Perk; - public class PerkFletcher extends Perk { private HashSet _fletchArrows = new HashSet(); @@ -37,8 +36,14 @@ public class PerkFletcher extends Perk private int _max = 0; private int _time = 0; private boolean _remove; + private int _slot; public PerkFletcher(int time, int max, boolean remove) + { + this(time, max, remove, -1); + } + + public PerkFletcher(int time, int max, boolean remove, int slot) { super("Fletcher", new String[] { @@ -48,6 +53,7 @@ public class PerkFletcher extends Perk _time = time; _max = max; _remove = remove; + _slot = slot; } public boolean isFletchedArrow(ItemStack stack) @@ -126,7 +132,14 @@ public class PerkFletcher extends Perk continue; //Add - cur.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Fletched Arrow"))); + if (_slot == -1) + { + cur.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Fletched Arrow"))); + } + else + { + cur.getInventory().setItem(_slot, ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Fletched Arrow"))); + } cur.playSound(cur.getLocation(), Sound.ITEM_PICKUP, 2f, 1f); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java index 17d725b8b..d8fedabd0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java @@ -3,6 +3,24 @@ package nautilus.game.arcade.kit.perks; import java.util.HashMap; import java.util.Iterator; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.kit.Perk; + import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -12,28 +30,12 @@ import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.projectile.IThrown; -import mineplex.core.projectile.ProjectileUser; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.kit.Perk; - public class PerkHammerThrow extends Perk implements IThrown { private HashMap _thrown = new HashMap(); @@ -51,19 +53,16 @@ public class PerkHammerThrow extends Perk implements IThrown { if (event.isCancelled()) return; - - if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) + + if (!UtilEvent.isAction(event, ActionType.R)) return; if (UtilBlock.usable(event.getClickedBlock())) return; - if (event.getPlayer().getItemInHand() == null) + if (!UtilInv.IsItem(event.getItem(), Material.DIAMOND_AXE, (byte) -1)) return; - - if (!event.getPlayer().getItemInHand().getType().toString().contains("DIAMOND_AXE")) - return; - + Player player = event.getPlayer(); if (!Kit.HasKit(player)) @@ -96,7 +95,7 @@ public class PerkHammerThrow extends Perk implements IThrown Player player = _thrown.remove(event.getItem()); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, "Thor Hammer")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer"))); } @EventHandler @@ -111,9 +110,9 @@ public class PerkHammerThrow extends Perk implements IThrown { Item item = itemIterator.next(); - if (item.getTicksLived() > 200) + if (item.getTicksLived() > 200 || !item.isValid()) { - _thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, "Thor Hammer")); + _thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer"))); item.remove(); itemIterator.remove(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java index 0ad07da03..e50a3da04 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java @@ -196,6 +196,13 @@ public class PerkHorsePet extends Perk if (!_horseMap.containsValue(event.getRightClicked())) return; + + if (!Manager.GetGame().IsLive()) + { + event.setCancelled(true); + event.getPlayer().teleport(event.getPlayer().getLocation()); + return; + } Player player = event.getPlayer(); Horse horse = (Horse)event.getRightClicked(); @@ -206,11 +213,5 @@ public class PerkHorsePet extends Perk event.setCancelled(true); return; } - - if (!Manager.GetGame().IsLive()) - { - event.setCancelled(true); - return; - } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 8d4ba746e..3c2b43bcb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -732,6 +732,7 @@ public class GameFlagManager implements Listener player.setAllowFlight(true); player.setFlying(true); ((CraftPlayer)player).getHandle().spectating = true; + ((CraftPlayer) player).getHandle().ghost = true; ((CraftPlayer)player).getHandle().k = false; for (int i=0 ; i<9 ; i++) From 5a8e500ec0916dfc582cc2dc817e299de96486fa Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sat, 10 Oct 2015 16:15:10 -0400 Subject: [PATCH 02/17] Fixed another thing --- .../game/games/halloween/Halloween.java | 78 +++++++++++++------ 1 file changed, 55 insertions(+), 23 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java index 6c6bac0b8..d6ba6b3ea 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java @@ -6,23 +6,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import org.bukkit.ChatColor; -import org.bukkit.Difficulty; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDeathEvent; -import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.event.entity.ItemSpawnEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; - import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; @@ -40,12 +23,41 @@ import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; -import nautilus.game.arcade.game.games.halloween.creatures.*; -import nautilus.game.arcade.game.games.halloween.kits.*; -import nautilus.game.arcade.game.games.halloween.waves.*; +import nautilus.game.arcade.game.games.halloween.creatures.CreatureBase; +import nautilus.game.arcade.game.games.halloween.creatures.InterfaceMove; +import nautilus.game.arcade.game.games.halloween.kits.KitFinn; +import nautilus.game.arcade.game.games.halloween.kits.KitRobinHood; +import nautilus.game.arcade.game.games.halloween.kits.KitThor; +import nautilus.game.arcade.game.games.halloween.waves.Wave1; +import nautilus.game.arcade.game.games.halloween.waves.Wave2; +import nautilus.game.arcade.game.games.halloween.waves.Wave3; +import nautilus.game.arcade.game.games.halloween.waves.Wave4; +import nautilus.game.arcade.game.games.halloween.waves.Wave5; +import nautilus.game.arcade.game.games.halloween.waves.WaveBase; +import nautilus.game.arcade.game.games.halloween.waves.WaveBoss; +import nautilus.game.arcade.game.games.halloween.waves.WaveVictory; import nautilus.game.arcade.kit.Kit; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; +import org.bukkit.ChatColor; +import org.bukkit.Difficulty; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.entity.Fireball; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.ItemSpawnEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; + public class Halloween extends SoloGame { //Wave Data @@ -461,6 +473,26 @@ public class Halloween extends SoloGame } } + @EventHandler + public void makeFireballsNotGetRektBcFireballsAreRudeAf(EntityDamageByEntityEvent event) + { + if (!IsLive()) + return; + + if (!(event.getDamager() instanceof Player)) + return; + + Player player = (Player) event.getDamager(); + + if (!UtilPlayer.isSpectator(player) || IsAlive(player)) + return; + + if (!(event.getEntity() instanceof Fireball)) + return; + + event.setCancelled(true); + } + @EventHandler public void ItemSpawn(ItemSpawnEvent event) { @@ -523,16 +555,16 @@ public class Halloween extends SoloGame //Rounds Scoreboard.WriteBlank(); - Scoreboard.Write(C.cYellow + "Wave"); + Scoreboard.Write(C.cYellow + C.Bold + "Wave"); Scoreboard.Write(Math.min(6, _wave+1) + " of 6"); Scoreboard.WriteBlank(); - Scoreboard.Write(C.cYellow + "Monsters"); + Scoreboard.Write(C.cYellow + C.Bold + "Monsters"); Scoreboard.Write("" + _mobs.size()); //Drawer Scoreboard.WriteBlank(); - Scoreboard.Write(C.cYellow + "Players"); + Scoreboard.Write(C.cYellow + C.Bold + "Players"); if (GetPlayers(true).size() < 8) { From 72d943f51b7da5825968325a41e032dac42493e7 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sat, 10 Oct 2015 16:20:28 -0400 Subject: [PATCH 03/17] Restored skills to pre-eula ultra --- .../minecraft/game/classcombat/shop/page/SkillPage.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java index df15f8c08..6e23c71a9 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java @@ -5,7 +5,6 @@ import java.util.List; import mineplex.core.account.CoreClientManager; import mineplex.core.common.CurrencyType; -import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.donation.DonationManager; import mineplex.core.itemstack.ItemStackFactory; @@ -403,7 +402,7 @@ public class SkillPage extends ShopPageBase private boolean isSkillLocked(ISkill skill) { - if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) + if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) return false; return true; @@ -411,7 +410,7 @@ public class SkillPage extends ShopPageBase private boolean isItemLocked(Item item) { - if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) + if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) return false; return true; From 83d1e011fc81e285a6bd3a2d00f191b0e3f313a9 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sat, 10 Oct 2015 23:33:54 -0400 Subject: [PATCH 04/17] Changes. --- .../game/classcombat/shop/page/SkillPage.java | 5 +++-- .../game/arcade/kit/perks/PerkHammerThrow.java | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java index 6e23c71a9..0d561611b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java @@ -5,6 +5,7 @@ import java.util.List; import mineplex.core.account.CoreClientManager; import mineplex.core.common.CurrencyType; +import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.donation.DonationManager; import mineplex.core.itemstack.ItemStackFactory; @@ -402,7 +403,7 @@ public class SkillPage extends ShopPageBase private boolean isSkillLocked(ISkill skill) { - if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) + if (skill.IsFree() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) return false; return true; @@ -410,7 +411,7 @@ public class SkillPage extends ShopPageBase private boolean isItemLocked(Item item) { - if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) + if (item.isFree() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) return false; return true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java index d8fedabd0..03cf62e88 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java @@ -112,9 +112,18 @@ public class PerkHammerThrow extends Perk implements IThrown if (item.getTicksLived() > 200 || !item.isValid()) { - _thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer"))); item.remove(); itemIterator.remove(); + + Player player = _thrown.get(item); + + if (!Manager.IsAlive(player)) + continue; + + if (UtilPlayer.isSpectator(player)) + continue; + + _thrown.get(item).getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer"))); } } } From 606937d227833f0ccd54b37254313bc1b54c0ade Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 11 Oct 2015 09:42:36 -0400 Subject: [PATCH 05/17] Fixed flashbang glitch --- .../arcade/game/games/minestrike/items/grenades/Grenade.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/Grenade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/Grenade.java index cd9093026..be8715efc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/Grenade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/Grenade.java @@ -95,7 +95,7 @@ public abstract class Grenade extends StrikeItem if (alreadyHas >= _limit) return false; - if ((player.getInventory().getItem(i) == null || isStack(player.getInventory().getItem(i))) && bestSlot == -1) + if ((player.getInventory().getItem(i) == null || UtilInv.IsItem(player.getInventory().getItem(i), Material.AIR, (byte) -1) && bestSlot == -1)) bestSlot = i; } From dda65b4c77ed7c3c44e500765f4c6d99e21484d9 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 11 Oct 2015 19:56:36 -0400 Subject: [PATCH 06/17] Fixed tnt exploding lobbies --- .../game/arcade/managers/GameLobbyManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index b21d2ba89..76f41dd0b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -1290,6 +1290,18 @@ public class GameLobbyManager implements Listener, IPacketHandler Manager.GetGame().AddGemBooster(event.getPlayer()); } + @EventHandler(priority = EventPriority.LOWEST) + public void explodeBlockBreakFix(EntityExplodeEvent event) + { + if (Manager.GetGame() == null) + return; + + if (Manager.GetGame().GetState() == GameState.Live) + return; + + event.blockList().clear(); + } + @EventHandler(priority = EventPriority.LOWEST) public void velocityEventCancel(PlayerVelocityEvent event) { From 7a4ccdf680d8c65a7a65186a0ea0bff241bacb53 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 11 Oct 2015 22:17:34 -0400 Subject: [PATCH 07/17] Bug fixes --- .../core/bonuses/gui/buttons/VoteButton.java | 17 +- .../nautilus/game/arcade/ArcadeManager.java | 2 + .../game/arcade/game/games/bridge/Bridge.java | 173 ++++++++++++++---- .../game/arcade/game/games/build/Build.java | 22 ++- .../game/arcade/game/games/draw/Draw.java | 8 + .../game/games/smash/kits/KitZombie.java | 2 +- .../game/games/turfforts/TurfForts.java | 27 ++- .../game/arcade/game/games/uhc/UHC.java | 70 +++---- .../arcade/game/games/wither/WitherGame.java | 3 + .../game/arcade/kit/perks/PerkDigger.java | 30 +-- 10 files changed, 241 insertions(+), 113 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/VoteButton.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/VoteButton.java index 0110d5fa0..0812dbe2a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/VoteButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/VoteButton.java @@ -2,6 +2,9 @@ package mineplex.core.bonuses.gui.buttons; import java.util.ArrayList; +import mineplex.core.bonuses.BonusAmount; +import mineplex.core.bonuses.BonusClientData; +import mineplex.core.bonuses.BonusManager; import mineplex.core.common.jsonchat.ClickEvent; import mineplex.core.common.jsonchat.JsonMessage; import mineplex.core.common.util.C; @@ -11,10 +14,6 @@ import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.gui.GuiItem; import mineplex.core.gui.ItemRefresher; import mineplex.core.shop.item.ShopItem; -import mineplex.core.bonuses.BonusAmount; -import mineplex.core.bonuses.BonusClientData; -import mineplex.core.bonuses.BonusManager; -import mineplex.core.bonuses.StreakRecord; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -72,15 +71,15 @@ public class VoteButton implements GuiItem, Listener { getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f); - UtilPlayer.message(getPlayer(), "----------------------------------------------------"); + UtilPlayer.message(getPlayer(), C.cGold + C.Bold + C.Strike + "============================================="); UtilPlayer.message(getPlayer(), ""); - new JsonMessage("Click to Open in Web Browser").click(ClickEvent.OPEN_URL, _url).sendToPlayer(getPlayer()); - new JsonMessage(C.cGreen + _url).click(ClickEvent.OPEN_URL, _url).sendToPlayer(getPlayer()); + new JsonMessage(" " + C.Bold + "Click to Open in Web Browser").click(ClickEvent.OPEN_URL, _url).sendToPlayer(getPlayer()); + new JsonMessage( " " + C.cGreen + C.Line + _url).click(ClickEvent.OPEN_URL, _url).sendToPlayer(getPlayer()); UtilPlayer.message(getPlayer(), ""); - UtilPlayer.message(getPlayer(), "Please be patient, votes may take a few minutes to register."); + UtilPlayer.message(getPlayer(), "Please be patient. Votes may take a few minutes to register."); UtilPlayer.message(getPlayer(), ""); - UtilPlayer.message(getPlayer(), "----------------------------------------------------"); + UtilPlayer.message(getPlayer(), C.cGold + C.Bold + C.Strike + "============================================="); getPlayer().closeInventory(); 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 90b0a8c20..2fba19105 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -940,6 +940,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation player.setLevel(0); player.setExp(0f); + player.setPlayerTime(player.getWorld().getTime(), false); + ((CraftPlayer) player).getHandle().spectating = false; ((CraftPlayer) player).getHandle().ghost = false; ((CraftPlayer) player).getHandle().k = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index f839c7539..e10942288 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -6,6 +6,52 @@ import java.util.HashSet; import java.util.Iterator; import java.util.UUID; +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.MapUtil; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilWorld; +import mineplex.core.explosion.ExplosionEvent; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.events.PlayerDeathOutEvent; +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.TeamGame; +import nautilus.game.arcade.game.games.bridge.kits.KitApple; +import nautilus.game.arcade.game.games.bridge.kits.KitArcher; +import nautilus.game.arcade.game.games.bridge.kits.KitBeserker; +import nautilus.game.arcade.game.games.bridge.kits.KitBomber; +import nautilus.game.arcade.game.games.bridge.kits.KitDestructor; +import nautilus.game.arcade.game.games.bridge.kits.KitMammoth; +import nautilus.game.arcade.game.games.bridge.kits.KitMiner; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.ore.OreHider; +import nautilus.game.arcade.ore.OreObsfucation; +import nautilus.game.arcade.stats.BridgesSniperStatTracker; +import nautilus.game.arcade.stats.DeathBomberStatTracker; +import nautilus.game.arcade.stats.FoodForTheMassesStatTracker; +import nautilus.game.arcade.stats.KillFastStatTracker; +import nautilus.game.arcade.stats.TntMinerStatTracker; + import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.Location; @@ -29,6 +75,7 @@ import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntitySpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.inventory.PrepareItemCraftEvent; import org.bukkit.event.player.PlayerBucketEmptyEvent; @@ -40,45 +87,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.util.Vector; -import mineplex.core.common.Rank; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.MapUtil; -import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilEvent; -import mineplex.core.common.util.UtilGear; -import mineplex.core.common.util.UtilTextMiddle; -import mineplex.core.common.util.UtilWorld; -import mineplex.core.common.util.UtilEvent.ActionType; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.explosion.ExplosionEvent; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; -import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.ArcadeManager; -import nautilus.game.arcade.GameType; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.events.PlayerDeathOutEvent; -import nautilus.game.arcade.game.Game; -import nautilus.game.arcade.game.GameTeam; -import nautilus.game.arcade.game.TeamGame; -import nautilus.game.arcade.game.games.bridge.kits.*; -import nautilus.game.arcade.kit.Kit; -import nautilus.game.arcade.ore.OreHider; -import nautilus.game.arcade.ore.OreObsfucation; -import nautilus.game.arcade.stats.BridgesSniperStatTracker; -import nautilus.game.arcade.stats.DeathBomberStatTracker; -import nautilus.game.arcade.stats.KillFastStatTracker; -import nautilus.game.arcade.stats.FoodForTheMassesStatTracker; -import nautilus.game.arcade.stats.TntMinerStatTracker; - public class Bridge extends TeamGame implements OreObsfucation { /** @@ -1159,6 +1167,59 @@ public class Bridge extends TeamGame implements OreObsfucation if (!IsAlive(event.getPlayer())) return; + //No water basing + if (event.getBlock().getRelative(BlockFace.UP).isLiquid() || + event.getBlockReplacedState().getTypeId() == 8 || + event.getBlockReplacedState().getTypeId() == 9 || + event.getBlockReplacedState().getTypeId() == 10 || + event.getBlockReplacedState().getTypeId() == 11) + { + if (event.getItemInHand() != null && + event.getItemInHand().getType() == Material.WOOD_DOOR || + event.getItemInHand().getTypeId() == 193 || //1.8 doors + event.getItemInHand().getTypeId() == 194 || //1.8 doors + event.getItemInHand().getTypeId() == 195 || //1.8 doors + event.getItemInHand().getTypeId() == 196 || //1.8 doors + event.getItemInHand().getTypeId() == 197 || //1.8 doors + event.getItemInHand().getTypeId() == 330 || //1.8 doors + event.getItemInHand().getTypeId() == 427 || //1.8 doors + event.getItemInHand().getTypeId() == 428 || //1.8 doors + event.getItemInHand().getTypeId() == 429 || //1.8 doors + event.getItemInHand().getTypeId() == 430 || //1.8 doors + event.getItemInHand().getTypeId() == 431 || //1.8 doors + event.getItemInHand().getType() == Material.TRAP_DOOR || + event.getItemInHand().getTypeId() == 167 || //Iron trap door + event.getItemInHand().getType() == Material.LADDER || + event.getItemInHand().getType() == Material.STONE_PLATE || + event.getItemInHand().getType() == Material.WOOD_PLATE || + event.getItemInHand().getType() == Material.IRON_PLATE || + event.getItemInHand().getType() == Material.GOLD_PLATE || + event.getItemInHand().getType() == Material.WOOD_BUTTON || + event.getItemInHand().getType() == Material.STONE_BUTTON || + event.getItemInHand().getType() == Material.SIGN || + event.getItemInHand().getType() == Material.FENCE || + event.getItemInHand().getType() == Material.FENCE_GATE || + event.getItemInHand().getTypeId() == 183 || //1.8 Fences stuff + event.getItemInHand().getTypeId() == 184 || + event.getItemInHand().getTypeId() == 185 || + event.getItemInHand().getTypeId() == 186 || + event.getItemInHand().getTypeId() == 187 || + event.getItemInHand().getTypeId() == 188 || + event.getItemInHand().getTypeId() == 189 || + event.getItemInHand().getTypeId() == 190 || + event.getItemInHand().getTypeId() == 191 || + event.getItemInHand().getTypeId() == 192 || + event.getItemInHand().getType() == Material.NETHER_FENCE || + event.getItemInHand().getType() == Material.STEP || + event.getItemInHand().getType() == Material.WOOD_STEP || + event.getItemInHand().getTypeId() == 182) //Red sandstone slab + { + event.getPlayer().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, event.getItemInHand().getTypeId()); + event.setCancelled(true); + return; + } + } + //Too High if (event.getBlock().getLocation().getBlockY() > GetHeightLimit()) { @@ -1735,6 +1796,40 @@ public class Bridge extends TeamGame implements OreObsfucation cheaterKill(damager); } } + + @EventHandler + public void preventMinecarts(PlayerInteractEvent event) + { + if (!IsLive()) + return; + + if (!IsAlive(event.getPlayer())) + return; + + if (!UtilEvent.isAction(event, ActionType.R)) + return; + + if (event.getItem() == null) + return; + + if (event.getItem().getType().toString().toLowerCase().contains("minecart")) + { + event.setCancelled(true); + UtilInv.Update(event.getPlayer()); + } + } + + @EventHandler + public void preventMinecarts(EntitySpawnEvent event) + { + if (!IsLive()) + return; + + if (event.getEntityType().toString().toLowerCase().contains("minecart")) + { + event.getEntity().remove(); + } + } public void cheaterKill(Player player) { 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 8fe75397a..e0fad7f01 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 @@ -943,19 +943,25 @@ public class Build extends SoloGame if (!event.getBlock().isLiquid()) return; + boolean in = false; for (BuildData data : _data.values()) { - if (!data.inBuildArea(event.getBlock())) + if (data.inBuildArea(event.getBlock())) { - event.setCancelled(true); - - event.getEntity().remove(); - - //Effect - event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, ((FallingBlock) event.getEntity()).getBlockId()); - return; + in = true; + break; } } + + if (!in) + { + event.setCancelled(true); + + event.getEntity().remove(); + + //Effect + event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, ((FallingBlock) event.getEntity()).getBlockId()); + } } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index 9d30a56f1..cde5143bf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -358,6 +358,14 @@ public class Draw extends SoloGame return; } } + else if (_drawers.HasPlayer(event.getPlayer())) + { + if (event.getMessage().toLowerCase().contains(_round.Word.toLowerCase())) + { + event.setCancelled(true); + return; + } + } } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitZombie.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitZombie.java index 00e5e30fb..08ea676e6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitZombie.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitZombie.java @@ -58,7 +58,7 @@ public class KitZombie extends SmashKit UtilInv.Clear(player); player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, - C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bile Blaster", + C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Bile Blaster", new String[] { ChatColor.RESET + "Spew up your dinner from last night.", 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 3e4b5c774..e1c15992d 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 @@ -287,10 +287,20 @@ public class TurfForts extends TeamGame { if (event.isCancelled()) // this statement might save just a small amount of time return; - - if(getArcadeManager().isSpectator(event.getPlayer())) event.setCancelled(true); + + if (!IsAlive(event.getPlayer())) + { + event.setCancelled(true); + return; + } + + if (UtilPlayer.isSpectator(event.getPlayer())) + { + event.setCancelled(true); + return; + } } - + @EventHandler public void BlockPlace(BlockPlaceEvent event) { @@ -304,7 +314,18 @@ public class TurfForts extends TeamGame return; } + if (!IsAlive(event.getPlayer())) + { + event.setCancelled(true); + return; + } + if (UtilPlayer.isSpectator(event.getPlayer())) + { + event.setCancelled(true); + return; + } + //On Own Block block = event.getBlock().getRelative(BlockFace.DOWN); while (block.getTypeId() == 0) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java index 9175d6350..84e3459ae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java @@ -4,6 +4,37 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilWorld; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.packethandler.PacketPlayOutWorldBorder; +import mineplex.core.recharge.Recharge; +import mineplex.core.timing.TimingManager; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.combat.CombatLog; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import mineplex.serverdata.Utility; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.GameTeam; +import nautilus.game.arcade.game.TeamGame; +import nautilus.game.arcade.kit.Kit; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Chunk; @@ -26,12 +57,12 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityRegainHealthEvent; -import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; +import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.inventory.PrepareItemCraftEvent; import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; @@ -55,37 +86,6 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.Objective; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilEvent; -import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilWorld; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTextMiddle; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.packethandler.PacketPlayOutWorldBorder; -import mineplex.core.recharge.Recharge; -import mineplex.core.timing.TimingManager; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.combat.CombatLog; -import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import mineplex.serverdata.Utility; -import nautilus.game.arcade.ArcadeManager; -import nautilus.game.arcade.GameType; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.GameTeam; -import nautilus.game.arcade.game.TeamGame; -import nautilus.game.arcade.kit.Kit; - public class UHC extends TeamGame { private NautHashMap _teamReqs = new NautHashMap(); @@ -344,6 +344,10 @@ public class UHC extends TeamGame player.getWorld().playSound(loc, Sound.NOTE_BASS, 2f, 1f); player.getWorld().playSound(loc, Sound.NOTE_BASS, 2f, 1f); } + else + { + player.teleport(GetSpectatorLocation()); + } } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java index 925d0d6fb..47f61d98f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java @@ -143,6 +143,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer this.TeamArmor = true; this.TeamArmorHotbar = false; + + this.InventoryClick = false; + this.InventoryOpenBlock = false; _help = new String[] { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDigger.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDigger.java index da6f350e3..400cb8b65 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDigger.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDigger.java @@ -1,13 +1,10 @@ package nautilus.game.arcade.kit.perks; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; - import mineplex.core.common.util.C; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; import nautilus.game.arcade.kit.Perk; +import org.bukkit.entity.Player; + public class PerkDigger extends Perk { public PerkDigger() @@ -18,21 +15,14 @@ public class PerkDigger extends Perk }); } - @EventHandler - public void DigSpeed(UpdateEvent event) + @Override + public void Apply(Player player) + { + addEffects(player); + } + + private void addEffects(Player player) { - if (event.getType() != UpdateType.FAST) - return; - - if (Manager.GetGame() == null) - return; - - for (Player player : Manager.GetGame().GetPlayers(true)) - { - if (!Kit.HasKit(player)) - continue; - - Manager.GetCondition().Factory().DigFast(GetName(), player, player, 2.9, 1, false, false, true); - } + Manager.GetCondition().Factory().DigFast(GetName(), player, null, Integer.MAX_VALUE, 1, false, false, true); } } From 2abf3edad47ba3d2317ee1c20c0182ab6e2bc9f8 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 11 Oct 2015 22:29:26 -0400 Subject: [PATCH 08/17] Made items for titanic cosmetics dyes. --- .../src/mineplex/core/gadget/gadgets/MorphTitan.java | 2 +- .../src/mineplex/core/gadget/gadgets/ParticleTitan.java | 2 +- .../src/mineplex/core/mount/types/MountTitan.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java index ad7c925bf..26d1bd925 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java @@ -18,7 +18,7 @@ public class MorphTitan extends MorphGadget C.cRed + "Unlocked with Titan Rank", }, -1, - Material.REDSTONE_BLOCK, (byte)0); + Material.INK_SACK, (byte)8); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java index 53e35329f..e9f3c8022 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java @@ -17,6 +17,6 @@ public class ParticleTitan extends ParticleGadget C.cRed + "Unlocked with Titan Rank", }, -1, - Material.REDSTONE_BLOCK, (byte)0); + Material.INK_SACK, (byte)8); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java index 80a3f1e00..e4ea28811 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java @@ -19,8 +19,8 @@ public class MountTitan extends HorseMount " ", C.cRed + "Unlocked with Titan Rank", }, - Material.REDSTONE_BLOCK, - (byte)0, + Material.INK_SACK, + (byte)8, -1, Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null); } From 3eb36a6581920a10833041e626999f5b4a814147 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 11 Oct 2015 22:43:21 -0400 Subject: [PATCH 09/17] Prevented farming --- .../nautilus/game/arcade/game/games/halloween/Halloween.java | 4 ++++ .../src/nautilus/game/arcade/stats/WinStatTracker.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java index d6ba6b3ea..5371ff69f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java @@ -423,6 +423,10 @@ public class Halloween extends SoloGame for (Player player : GetPlayers(false)) { + //Prevent game hopping + if (!player.isOnline()) + continue; + Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), Manager.GetClients().Get(player).getAccountId(), "Decrepit Warhorse", false, 0, true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinStatTracker.java index 6836ec0a2..382b6bbd0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinStatTracker.java @@ -27,6 +27,9 @@ public class WinStatTracker extends StatTracker { for (Player winner : winners) { + if (!winner.isOnline()) + continue; + addStat(winner, "Wins", 1, false, false); // if (getGame().GetKit(winner) != null) From 1aecc9505c702167aeca5fd3301762264ce46c5d Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 12 Oct 2015 01:30:31 -0400 Subject: [PATCH 10/17] Add region to titan, new MOTD --- .../src/mineplex/bungee/motd/MotdManager.java | 4 ++-- .../src/mineplex/core/achievement/Achievement.java | 2 +- .../core/titangiveaway/TitanGiveawayManager.java | 2 +- .../core/titangiveaway/TitanGiveawayRepository.java | 13 +++++++------ 4 files changed, 11 insertions(+), 10 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 75cf934cf..bd381a4d8 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -55,12 +55,12 @@ public class MotdManager implements Listener, Runnable //String motdLine = "§f§l◄ §c§lMaintenance§f§l ►"; //String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►"; - String motdLine = " §b§l◄§f§lNEW GAME§b§l► §f§l◄§b§lEVOLUTION§f§l► §b§l◄§f§lNEW GAME§b§l►"; + String motdLine = " §4§l§n H A L L O W E E N H O R R O R §f"; //String motdLine = " §f§l◄ §a§lCarl the Creeper§f§l ▬ §c§l75% OFF SALE§f§l ►"; //String motdLine = " §d§lRank Sale §a§l40% Off"); //String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►"); - updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", motdLine); + updateMainMotd(" §4§l§m §f§l§m §8§l§m[ §r §4§lMineplex§r §f§lGames§r §8§l§m ]§f§l§m §4§l§m §r", motdLine); System.out.println("Updated Bungee MOTD"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index 4f474f52c..cc6073831 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -784,7 +784,7 @@ public enum Achievement public static String getExperienceString(int level) { if (level < 0) - return C.cPurple + level; + return C.cAqua + level; if (level < 20) return C.cGray + level; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java index 6b935affb..0c66030eb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java @@ -53,7 +53,7 @@ public class TitanGiveawayManager extends MiniPlugin @Override public void run() { - final boolean pass = _repository.canGiveaway(); + final boolean pass = _repository.canGiveaway(region); if (pass && _repository.addTitan(accountId, region, serverName)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayRepository.java index d021c6011..4eb95a46d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayRepository.java @@ -41,17 +41,18 @@ public class TitanGiveawayRepository extends RepositoryBase return 1 == executeUpdate(ADD_TITAN, new ColumnInt("accountId", accountId), new ColumnVarChar("region", 10, region.name()), new ColumnVarChar("serverName", 64, serverName)); } - public boolean canGiveaway() + public boolean canGiveaway(Region region) { try (Connection connection = getConnection(); - CallableStatement callableStatement = connection.prepareCall("{call check_titanGiveaway(?, ?)}")) + CallableStatement callableStatement = connection.prepareCall("{call check_titanGiveaway(?, ?, ?)}")) { - callableStatement.registerOutParameter(1, Types.BOOLEAN); - callableStatement.registerOutParameter(2, Types.INTEGER); + callableStatement.setString(1, region.name()); + callableStatement.registerOutParameter(2, Types.BOOLEAN); + callableStatement.registerOutParameter(3, Types.INTEGER); callableStatement.executeUpdate(); - boolean pass = callableStatement.getBoolean(1); - int titanCount = callableStatement.getInt(2); + boolean pass = callableStatement.getBoolean(2); + int titanCount = callableStatement.getInt(3); _titanCount = titanCount; return pass; From be96842de53637ab82f52c7f837d6e381210b543 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Mon, 12 Oct 2015 17:02:34 -0400 Subject: [PATCH 11/17] Ultra --- .../minecraft/game/classcombat/shop/page/SkillPage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java index 0d561611b..0b42795ac 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java @@ -403,7 +403,7 @@ public class SkillPage extends ShopPageBase private boolean isSkillLocked(ISkill skill) { - if (skill.IsFree() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) + if (skill.IsFree() || getDonationManager().Get(getPlayer()).OwnsUltraPackage() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) return false; return true; @@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase private boolean isItemLocked(Item item) { - if (item.isFree() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) + if (item.isFree() || getDonationManager().Get(getPlayer()).OwnsUltraPackage() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) return false; return true; From 37639a413c133c14b9bf5b62c0a49e7d9f625ce3 Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 13 Oct 2015 11:22:10 +1100 Subject: [PATCH 12/17] fixed skill stuff --- .../minecraft/game/classcombat/shop/page/SkillPage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java index 0b42795ac..9151d4f82 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java @@ -400,10 +400,10 @@ public class SkillPage extends ShopPageBase } }, this, new SkillSalesPackage(skill), CurrencyType.Gems, player)); } - + private boolean isSkillLocked(ISkill skill) { - if (skill.IsFree() || getDonationManager().Get(getPlayer()).OwnsUltraPackage() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) + if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) return false; return true; @@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase private boolean isItemLocked(Item item) { - if (item.isFree() || getDonationManager().Get(getPlayer()).OwnsUltraPackage() || getClientManager().hasRank(getPlayer(), Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) + if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) return false; return true; From 3e5ac58ae9902bd3377c6c9409a4411064f833de Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 13 Oct 2015 11:23:00 +1100 Subject: [PATCH 13/17] helpers! --- .../minecraft/game/classcombat/shop/page/SkillPage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java index 9151d4f82..176cfb332 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/page/SkillPage.java @@ -403,7 +403,7 @@ public class SkillPage extends ShopPageBase private boolean isSkillLocked(ISkill skill) { - if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) + if (skill.IsFree() || getClientManager().Get(getPlayer().getName()).GetRank().has(Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName())) return false; return true; @@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase private boolean isItemLocked(Item item) { - if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) + if (item.isFree() || getClientManager().Get(getPlayer().getName()).GetRank().has(Rank.HELPER) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName())) return false; return true; From e8388437b616f27f5bd8c55dfe9a4719e4e83227 Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 13 Oct 2015 11:58:14 +1100 Subject: [PATCH 14/17] botspam now checks for chat as well --- .../mineplex/core/botspam/BotSpamManager.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java index a977b3685..15896b339 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java @@ -5,6 +5,8 @@ import java.util.List; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; @@ -53,6 +55,24 @@ public class BotSpamManager extends MiniPlugin } } } + + @EventHandler(priority = EventPriority.LOWEST) + public void onChat(AsyncPlayerChatEvent event) + { + // Ignore messages sent to staff members + if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER)) + return; + + for (SpamText spamText : _spam) + { + if (spamText.isEnabled() && spamText.isSpam(event.getMessage())) + { + punishBot(event.getPlayer(), spamText); + event.setCancelled(true); + return; + } + } + } public void punishBot(Player player, final SpamText botText) { From a292fdb3c55bcebd7532f3c81a494ea538cc70ed Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 12 Oct 2015 22:26:24 -0500 Subject: [PATCH 15/17] Added failsafe for ServerMonitor. --- .../mineplex/servermonitor/ServerMonitor.java | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java index 6725da134..8056b8d2a 100644 --- a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java +++ b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java @@ -312,21 +312,28 @@ public class ServerMonitor while (_processes.size() > 0) { - for (Iterator iterator = _processes.iterator(); iterator.hasNext();) + try { - ProcessRunner pr = iterator.next(); - - try + for (Iterator iterator = _processes.iterator(); iterator.hasNext();) { - pr.join(100); - } - catch (InterruptedException e) - { - e.printStackTrace(); + ProcessRunner pr = iterator.next(); + + try + { + pr.join(100); + } + catch (InterruptedException e) + { + e.printStackTrace(); + } + + if (pr.isDone()) + iterator.remove(); } - - if (pr.isDone()) - iterator.remove(); + } + catch (Exception ex) + { + ex.printStackTrace(); } if (_processes.size() > 0) @@ -342,7 +349,7 @@ public class ServerMonitor } } - if (processWaits >= 10) + if (processWaits >= 5) { log("Killing stale processes."); @@ -351,6 +358,8 @@ public class ServerMonitor iterator.next().abort(); iterator.remove(); } + + _processes.clear(); } processWaits++; From d105ea5d7e3c3236c8c378f84be788c4a95d1a1c Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 13 Oct 2015 23:19:48 +1100 Subject: [PATCH 16/17] botspam addition --- .../src/mineplex/core/botspam/BotSpamManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java index 15896b339..aabdeca92 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java @@ -44,6 +44,10 @@ public class BotSpamManager extends MiniPlugin // Ignore messages sent to staff members if (_clientManager.hasRank(recipient, Rank.HELPER)) return; + + // Ignore messages sent by staff members + if (_clientManager.hasRank(event.getSender(), Rank.HELPER)) + return; for (SpamText spamText : _spam) { @@ -59,7 +63,7 @@ public class BotSpamManager extends MiniPlugin @EventHandler(priority = EventPriority.LOWEST) public void onChat(AsyncPlayerChatEvent event) { - // Ignore messages sent to staff members + // Ignore messages sent by staff members if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER)) return; From 45cd2a38e1b126de667a7ac744423e4266ab4ff7 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 14 Oct 2015 11:55:59 +1100 Subject: [PATCH 17/17] admins can botspam --- Plugins/Mineplex.Core/src/mineplex/core/botspam/SpamText.java | 1 + .../src/mineplex/core/botspam/command/BotSpamAddCommand.java | 2 +- .../src/mineplex/core/botspam/command/BotSpamCommand.java | 2 +- .../mineplex/core/botspam/command/BotSpamDisableCommand.java | 2 +- .../src/mineplex/core/botspam/command/BotSpamEnableCommand.java | 2 +- .../src/mineplex/core/botspam/command/BotSpamListCommand.java | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/SpamText.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/SpamText.java index a4d466082..4fae3baf8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/SpamText.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/SpamText.java @@ -23,6 +23,7 @@ public class SpamText public boolean isSpam(String message) { + //System.out.println(message.toLowerCase() + " vs " + _text.toLowerCase() + " == " + message.toLowerCase().contains(_text.toLowerCase())); return message.toLowerCase().contains(_text.toLowerCase()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamAddCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamAddCommand.java index d662dec7d..224f3506c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamAddCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamAddCommand.java @@ -13,7 +13,7 @@ public class BotSpamAddCommand extends CommandBase { public BotSpamAddCommand(BotSpamManager plugin) { - super(plugin, Rank.DEVELOPER, "add"); + super(plugin, Rank.ADMIN, "add"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamCommand.java index 233939e7b..99a3e1bab 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamCommand.java @@ -12,7 +12,7 @@ public class BotSpamCommand extends MultiCommandBase { public BotSpamCommand(BotSpamManager plugin) { - super(plugin, Rank.DEVELOPER, "botban", "botspam"); + super(plugin, Rank.ADMIN, "botban", "botspam"); AddCommand(new BotSpamAddCommand(Plugin)); AddCommand(new BotSpamEnableCommand(Plugin)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamDisableCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamDisableCommand.java index e59f7c84f..4afcb9894 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamDisableCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamDisableCommand.java @@ -13,7 +13,7 @@ public class BotSpamDisableCommand extends CommandBase { public BotSpamDisableCommand(BotSpamManager plugin) { - super(plugin, Rank.DEVELOPER, "disable"); + super(plugin, Rank.ADMIN, "disable"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamEnableCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamEnableCommand.java index ce0242395..d694e06cc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamEnableCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamEnableCommand.java @@ -13,7 +13,7 @@ public class BotSpamEnableCommand extends CommandBase { public BotSpamEnableCommand(BotSpamManager plugin) { - super(plugin, Rank.DEVELOPER, "enable"); + super(plugin, Rank.ADMIN, "enable"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamListCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamListCommand.java index 96e71da64..47e31606c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamListCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/botspam/command/BotSpamListCommand.java @@ -17,7 +17,7 @@ public class BotSpamListCommand extends CommandBase { public BotSpamListCommand(BotSpamManager plugin) { - super(plugin, Rank.DEVELOPER, "list"); + super(plugin, Rank.ADMIN, "list"); } @Override