Merge remote-tracking branch 'origin/master'

# Conflicts:
#	Plugins/Mineplex.Core/src/mineplex/core/botspam/BotSpamManager.java
This commit is contained in:
Shaun Bennett 2015-10-13 22:26:11 -04:00
commit 39d88e8060
31 changed files with 524 additions and 315 deletions

View File

@ -2,6 +2,9 @@ package mineplex.core.bonuses.gui.buttons;
import java.util.ArrayList; 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.ClickEvent;
import mineplex.core.common.jsonchat.JsonMessage; import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C; 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.GuiItem;
import mineplex.core.gui.ItemRefresher; import mineplex.core.gui.ItemRefresher;
import mineplex.core.shop.item.ShopItem; 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.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -72,15 +71,15 @@ public class VoteButton implements GuiItem, Listener {
getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f); 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(), ""); UtilPlayer.message(getPlayer(), "");
new JsonMessage("Click to Open in Web Browser").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 + _url).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(), "");
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(), "----------------------------------------------------"); UtilPlayer.message(getPlayer(), C.cGold + C.Bold + C.Strike + "=============================================");
getPlayer().closeInventory(); getPlayer().closeInventory();

View File

@ -5,6 +5,7 @@ import java.util.List;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -44,6 +45,10 @@ public class BotSpamManager extends MiniPlugin
if (_clientManager.hasRank(recipient, Rank.HELPER)) if (_clientManager.hasRank(recipient, Rank.HELPER))
return; return;
// Ignore messages sent by staff members
if (_clientManager.hasRank(event.getSender(), Rank.HELPER))
return;
for (SpamText spamText : _spam) for (SpamText spamText : _spam)
{ {
if (spamText.isEnabled() && spamText.isSpam(event.getMessage())) if (spamText.isEnabled() && spamText.isSpam(event.getMessage()))
@ -55,23 +60,20 @@ public class BotSpamManager extends MiniPlugin
} }
} }
@EventHandler @EventHandler(priority = EventPriority.LOWEST)
public void onChatMessage(final AsyncPlayerChatEvent event) public void onChat(AsyncPlayerChatEvent event)
{ {
for (final SpamText spamText : _spam) // Ignore messages sent by staff members
if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER))
return;
for (SpamText spamText : _spam)
{ {
if (spamText.isEnabled() && spamText.isSpam(event.getMessage())) if (spamText.isEnabled() && spamText.isSpam(event.getMessage()))
{ {
runSync(new Runnable() punishBot(event.getPlayer(), spamText);
{
@Override
public void run()
{
punishBot(event.getPlayer(), spamText);
}
});
event.setCancelled(true); event.setCancelled(true);
return;
} }
} }
} }

View File

@ -23,6 +23,7 @@ public class SpamText
public boolean isSpam(String message) public boolean isSpam(String message)
{ {
//System.out.println(message.toLowerCase() + " vs " + _text.toLowerCase() + " == " + message.toLowerCase().contains(_text.toLowerCase()));
return message.toLowerCase().contains(_text.toLowerCase()); return message.toLowerCase().contains(_text.toLowerCase());
} }

View File

@ -13,7 +13,7 @@ public class BotSpamAddCommand extends CommandBase<BotSpamManager>
{ {
public BotSpamAddCommand(BotSpamManager plugin) public BotSpamAddCommand(BotSpamManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "add"); super(plugin, Rank.ADMIN, "add");
} }
@Override @Override

View File

@ -12,7 +12,7 @@ public class BotSpamCommand extends MultiCommandBase<BotSpamManager>
{ {
public BotSpamCommand(BotSpamManager plugin) public BotSpamCommand(BotSpamManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "botban", "botspam"); super(plugin, Rank.ADMIN, "botban", "botspam");
AddCommand(new BotSpamAddCommand(Plugin)); AddCommand(new BotSpamAddCommand(Plugin));
AddCommand(new BotSpamEnableCommand(Plugin)); AddCommand(new BotSpamEnableCommand(Plugin));

View File

@ -13,7 +13,7 @@ public class BotSpamDisableCommand extends CommandBase<BotSpamManager>
{ {
public BotSpamDisableCommand(BotSpamManager plugin) public BotSpamDisableCommand(BotSpamManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "disable"); super(plugin, Rank.ADMIN, "disable");
} }
@Override @Override

View File

@ -13,7 +13,7 @@ public class BotSpamEnableCommand extends CommandBase<BotSpamManager>
{ {
public BotSpamEnableCommand(BotSpamManager plugin) public BotSpamEnableCommand(BotSpamManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "enable"); super(plugin, Rank.ADMIN, "enable");
} }
@Override @Override

View File

@ -17,7 +17,7 @@ public class BotSpamListCommand extends CommandBase<BotSpamManager>
{ {
public BotSpamListCommand(BotSpamManager plugin) public BotSpamListCommand(BotSpamManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "list"); super(plugin, Rank.ADMIN, "list");
} }
@Override @Override

View File

@ -18,7 +18,7 @@ public class MorphTitan extends MorphGadget
C.cRed + "Unlocked with Titan Rank", C.cRed + "Unlocked with Titan Rank",
}, },
-1, -1,
Material.REDSTONE_BLOCK, (byte)0); Material.INK_SACK, (byte)8);
} }
@Override @Override

View File

@ -17,6 +17,6 @@ public class ParticleTitan extends ParticleGadget
C.cRed + "Unlocked with Titan Rank", C.cRed + "Unlocked with Titan Rank",
}, },
-1, -1,
Material.REDSTONE_BLOCK, (byte)0); Material.INK_SACK, (byte)8);
} }
} }

View File

@ -19,8 +19,8 @@ public class MountTitan extends HorseMount
" ", " ",
C.cRed + "Unlocked with Titan Rank", C.cRed + "Unlocked with Titan Rank",
}, },
Material.REDSTONE_BLOCK, Material.INK_SACK,
(byte)0, (byte)8,
-1, -1,
Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null); Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null);
} }

View File

@ -403,7 +403,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
private boolean isSkillLocked(ISkill skill) private boolean isSkillLocked(ISkill skill)
{ {
if (skill.IsFree() || 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 false;
return true; return true;
@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
private boolean isItemLocked(Item item) private boolean isItemLocked(Item item)
{ {
if (item.isFree() || 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 false;
return true; return true;

View File

@ -1,12 +1,113 @@
package nautilus.game.arcade; package nautilus.game.arcade;
import java.awt.Event;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map.Entry; 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.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@ -38,111 +139,6 @@ import org.bukkit.util.Vector;
import com.google.common.base.Objects; 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 public class ArcadeManager extends MiniPlugin implements IRelation
{ {
// Modules // Modules
@ -944,7 +940,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation
player.setLevel(0); player.setLevel(0);
player.setExp(0f); player.setExp(0f);
player.setPlayerTime(player.getWorld().getTime(), false);
((CraftPlayer) player).getHandle().spectating = false; ((CraftPlayer) player).getHandle().spectating = false;
((CraftPlayer) player).getHandle().ghost = false;
((CraftPlayer) player).getHandle().k = true; ((CraftPlayer) player).getHandle().k = true;
// Arrows go bye bye. // Arrows go bye bye.
@ -1390,6 +1389,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
player.setFlying(true); player.setFlying(true);
player.setFlySpeed(0.1f); player.setFlySpeed(0.1f);
((CraftPlayer) player).getHandle().spectating = true; ((CraftPlayer) player).getHandle().spectating = true;
((CraftPlayer) player).getHandle().ghost = true;
((CraftPlayer) player).getHandle().k = false; ((CraftPlayer) player).getHandle().k = false;
GetCondition().Factory().Cloak("Spectator", player, player, 7777, true, true); GetCondition().Factory().Cloak("Spectator", player, player, 7777, true, true);

View File

@ -6,6 +6,52 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.UUID; 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.ChatColor;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
@ -29,6 +75,7 @@ import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent; import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.event.player.PlayerBucketEmptyEvent;
@ -40,45 +87,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.Vector; 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 public class Bridge extends TeamGame implements OreObsfucation
{ {
/** /**
@ -1159,6 +1167,59 @@ public class Bridge extends TeamGame implements OreObsfucation
if (!IsAlive(event.getPlayer())) if (!IsAlive(event.getPlayer()))
return; 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 //Too High
if (event.getBlock().getLocation().getBlockY() > GetHeightLimit()) if (event.getBlock().getLocation().getBlockY() > GetHeightLimit())
{ {
@ -1736,6 +1797,40 @@ public class Bridge extends TeamGame implements OreObsfucation
} }
} }
@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) public void cheaterKill(Player player)
{ {
Announce(C.Bold + player.getName() + " was killed for cheating!"); Announce(C.Bold + player.getName() + " was killed for cheating!");

View File

@ -943,19 +943,25 @@ public class Build extends SoloGame
if (!event.getBlock().isLiquid()) if (!event.getBlock().isLiquid())
return; return;
boolean in = false;
for (BuildData data : _data.values()) for (BuildData data : _data.values())
{ {
if (!data.inBuildArea(event.getBlock())) if (data.inBuildArea(event.getBlock()))
{ {
event.setCancelled(true); in = true;
break;
event.getEntity().remove();
//Effect
event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, ((FallingBlock) event.getEntity()).getBlockId());
return;
} }
} }
if (!in)
{
event.setCancelled(true);
event.getEntity().remove();
//Effect
event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, ((FallingBlock) event.getEntity()).getBlockId());
}
} }
@EventHandler @EventHandler

View File

@ -358,6 +358,14 @@ public class Draw extends SoloGame
return; return;
} }
} }
else if (_drawers.HasPlayer(event.getPlayer()))
{
if (event.getMessage().toLowerCase().contains(_round.Word.toLowerCase()))
{
event.setCancelled(true);
return;
}
}
} }
@EventHandler @EventHandler

View File

@ -6,23 +6,6 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; 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.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock; 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.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.halloween.creatures.*; import nautilus.game.arcade.game.games.halloween.creatures.CreatureBase;
import nautilus.game.arcade.game.games.halloween.kits.*; import nautilus.game.arcade.game.games.halloween.creatures.InterfaceMove;
import nautilus.game.arcade.game.games.halloween.waves.*; 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 nautilus.game.arcade.kit.Kit;
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; 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 public class Halloween extends SoloGame
{ {
//Wave Data //Wave Data
@ -411,6 +423,10 @@ public class Halloween extends SoloGame
for (Player player : GetPlayers(false)) 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); Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), Manager.GetClients().Get(player).getAccountId(), "Decrepit Warhorse", false, 0, true);
} }
} }
@ -461,6 +477,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 @EventHandler
public void ItemSpawn(ItemSpawnEvent event) public void ItemSpawn(ItemSpawnEvent event)
{ {
@ -523,16 +559,16 @@ public class Halloween extends SoloGame
//Rounds //Rounds
Scoreboard.WriteBlank(); Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellow + "Wave"); Scoreboard.Write(C.cYellow + C.Bold + "Wave");
Scoreboard.Write(Math.min(6, _wave+1) + " of 6"); Scoreboard.Write(Math.min(6, _wave+1) + " of 6");
Scoreboard.WriteBlank(); Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellow + "Monsters"); Scoreboard.Write(C.cYellow + C.Bold + "Monsters");
Scoreboard.Write("" + _mobs.size()); Scoreboard.Write("" + _mobs.size());
//Drawer //Drawer
Scoreboard.WriteBlank(); Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellow + "Players"); Scoreboard.Write(C.cYellow + C.Bold + "Players");
if (GetPlayers(true).size() < 8) if (GetPlayers(true).size() < 8)
{ {

View File

@ -38,7 +38,7 @@ public class KitThor extends AbbreviatedKit
new Perk[] new Perk[]
{ {
new PerkKnockbackAttack(2), new PerkKnockbackAttack(2),
new PerkFletcher(2, 2, true), new PerkFletcher(2, 2, true, 9),
new PerkSeismicHammer(), new PerkSeismicHammer(),
new PerkHammerThrow(), new PerkHammerThrow(),
}, },

View File

@ -95,7 +95,7 @@ public abstract class Grenade extends StrikeItem
if (alreadyHas >= _limit) if (alreadyHas >= _limit)
return false; 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; bestSlot = i;
} }

View File

@ -58,7 +58,7 @@ public class KitZombie extends SmashKit
UtilInv.Clear(player); UtilInv.Clear(player);
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, 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[] new String[]
{ {
ChatColor.RESET + "Spew up your dinner from last night.", ChatColor.RESET + "Spew up your dinner from last night.",

View File

@ -288,7 +288,17 @@ public class TurfForts extends TeamGame
if (event.isCancelled()) // this statement might save just a small amount of time if (event.isCancelled()) // this statement might save just a small amount of time
return; 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 @EventHandler
@ -304,6 +314,17 @@ public class TurfForts extends TeamGame
return; return;
} }
if (!IsAlive(event.getPlayer()))
{
event.setCancelled(true);
return;
}
if (UtilPlayer.isSpectator(event.getPlayer()))
{
event.setCancelled(true);
return;
}
//On Own //On Own
Block block = event.getBlock().getRelative(BlockFace.DOWN); Block block = event.getBlock().getRelative(BlockFace.DOWN);

View File

@ -4,6 +4,37 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; 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.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Chunk; import org.bukkit.Chunk;
@ -26,12 +57,12 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent; 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.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent; import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
@ -55,37 +86,6 @@ import org.bukkit.potion.PotionEffectType;
import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective; 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 public class UHC extends TeamGame
{ {
private NautHashMap<Player, Player> _teamReqs = new NautHashMap<Player, Player>(); private NautHashMap<Player, Player> _teamReqs = new NautHashMap<Player, Player>();
@ -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);
player.getWorld().playSound(loc, Sound.NOTE_BASS, 2f, 1f); player.getWorld().playSound(loc, Sound.NOTE_BASS, 2f, 1f);
} }
else
{
player.teleport(GetSpectatorLocation());
}
} }
} }
} }

View File

@ -144,6 +144,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer
this.TeamArmor = true; this.TeamArmor = true;
this.TeamArmorHotbar = false; this.TeamArmorHotbar = false;
this.InventoryClick = false;
this.InventoryOpenBlock = false;
_help = new String[] _help = new String[]
{ {
"Blocks placed by an Editor can be passed by other humans by " + C.cDGreen + "Right-clicking the block", "Blocks placed by an Editor can be passed by other humans by " + C.cDGreen + "Right-clicking the block",

View File

@ -1,13 +1,10 @@
package nautilus.game.arcade.kit.perks; 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.common.util.C;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import org.bukkit.entity.Player;
public class PerkDigger extends Perk public class PerkDigger extends Perk
{ {
public PerkDigger() public PerkDigger()
@ -18,21 +15,14 @@ public class PerkDigger extends Perk
}); });
} }
@EventHandler @Override
public void DigSpeed(UpdateEvent event) public void Apply(Player player)
{ {
if (event.getType() != UpdateType.FAST) addEffects(player);
return; }
if (Manager.GetGame() == null) private void addEffects(Player player)
return; {
Manager.GetCondition().Factory().DigFast(GetName(), player, null, Integer.MAX_VALUE, 1, false, false, true);
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);
}
} }
} }

View File

@ -96,6 +96,12 @@ public class PerkFlameSlam extends Perk
for (Player player : copy.keySet()) for (Player player : copy.keySet())
{ {
if (!Manager.IsAlive(player) || UtilPlayer.isSpectator(player))
{
_live.remove(player);
continue;
}
Vector vel = player.getLocation().getDirection(); Vector vel = player.getLocation().getDirection();
vel.setY(0); vel.setY(0);
UtilAlg.Normalize(vel); UtilAlg.Normalize(vel);

View File

@ -3,7 +3,18 @@ package nautilus.game.arcade.kit.perks;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; 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.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; 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.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; 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 public class PerkFletcher extends Perk
{ {
private HashSet<Entity> _fletchArrows = new HashSet<Entity>(); private HashSet<Entity> _fletchArrows = new HashSet<Entity>();
@ -37,8 +36,14 @@ public class PerkFletcher extends Perk
private int _max = 0; private int _max = 0;
private int _time = 0; private int _time = 0;
private boolean _remove; private boolean _remove;
private int _slot;
public PerkFletcher(int time, int max, boolean remove) 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[] super("Fletcher", new String[]
{ {
@ -48,6 +53,7 @@ public class PerkFletcher extends Perk
_time = time; _time = time;
_max = max; _max = max;
_remove = remove; _remove = remove;
_slot = slot;
} }
public boolean isFletchedArrow(ItemStack stack) public boolean isFletchedArrow(ItemStack stack)
@ -126,7 +132,14 @@ public class PerkFletcher extends Perk
continue; continue;
//Add //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); cur.playSound(cur.getLocation(), Sound.ITEM_PICKUP, 2f, 1f);
} }

View File

@ -3,6 +3,24 @@ package nautilus.game.arcade.kit.perks;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; 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.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -12,28 +30,12 @@ import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector; 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 public class PerkHammerThrow extends Perk implements IThrown
{ {
private HashMap<Item, Player> _thrown = new HashMap<Item, Player>(); private HashMap<Item, Player> _thrown = new HashMap<Item, Player>();
@ -52,16 +54,13 @@ public class PerkHammerThrow extends Perk implements IThrown
if (event.isCancelled()) if (event.isCancelled())
return; return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) if (!UtilEvent.isAction(event, ActionType.R))
return; return;
if (UtilBlock.usable(event.getClickedBlock())) if (UtilBlock.usable(event.getClickedBlock()))
return; 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; return;
Player player = event.getPlayer(); Player player = event.getPlayer();
@ -96,7 +95,7 @@ public class PerkHammerThrow extends Perk implements IThrown
Player player = _thrown.remove(event.getItem()); 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 @EventHandler
@ -111,11 +110,20 @@ public class PerkHammerThrow extends Perk implements IThrown
{ {
Item item = itemIterator.next(); 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"));
item.remove(); item.remove();
itemIterator.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")));
} }
} }
} }

View File

@ -197,6 +197,13 @@ public class PerkHorsePet extends Perk
if (!_horseMap.containsValue(event.getRightClicked())) if (!_horseMap.containsValue(event.getRightClicked()))
return; return;
if (!Manager.GetGame().IsLive())
{
event.setCancelled(true);
event.getPlayer().teleport(event.getPlayer().getLocation());
return;
}
Player player = event.getPlayer(); Player player = event.getPlayer();
Horse horse = (Horse)event.getRightClicked(); Horse horse = (Horse)event.getRightClicked();
@ -206,11 +213,5 @@ public class PerkHorsePet extends Perk
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
if (!Manager.GetGame().IsLive())
{
event.setCancelled(true);
return;
}
} }
} }

View File

@ -732,6 +732,7 @@ public class GameFlagManager implements Listener
player.setAllowFlight(true); player.setAllowFlight(true);
player.setFlying(true); player.setFlying(true);
((CraftPlayer)player).getHandle().spectating = true; ((CraftPlayer)player).getHandle().spectating = true;
((CraftPlayer) player).getHandle().ghost = true;
((CraftPlayer)player).getHandle().k = false; ((CraftPlayer)player).getHandle().k = false;
for (int i=0 ; i<9 ; i++) for (int i=0 ; i<9 ; i++)

View File

@ -1290,6 +1290,18 @@ public class GameLobbyManager implements Listener, IPacketHandler
Manager.GetGame().AddGemBooster(event.getPlayer()); 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) @EventHandler(priority = EventPriority.LOWEST)
public void velocityEventCancel(PlayerVelocityEvent event) public void velocityEventCancel(PlayerVelocityEvent event)
{ {

View File

@ -27,6 +27,9 @@ public class WinStatTracker extends StatTracker<Game>
{ {
for (Player winner : winners) for (Player winner : winners)
{ {
if (!winner.isOnline())
continue;
addStat(winner, "Wins", 1, false, false); addStat(winner, "Wins", 1, false, false);
// if (getGame().GetKit(winner) != null) // if (getGame().GetKit(winner) != null)