Merge remote-tracking branch 'origin/master' into monster-maze

This commit is contained in:
Mysticate 2015-10-13 22:14:19 -04:00
commit a049d7666f
36 changed files with 566 additions and 325 deletions

View File

@ -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");
}
}

View File

@ -820,7 +820,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;

View File

@ -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();

View File

@ -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;
@ -42,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)
{
@ -53,6 +59,24 @@ public class BotSpamManager extends MiniPlugin
}
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void onChat(AsyncPlayerChatEvent event)
{
// 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()))
{
punishBot(event.getPlayer(), spamText);
event.setCancelled(true);
return;
}
}
}
public void punishBot(Player player, final SpamText botText)
{

View File

@ -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());
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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))
{

View File

@ -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;

View File

@ -400,10 +400,10 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
}
}, this, new SkillSalesPackage(skill), CurrencyType.Gems, player));
}
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 true;
@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
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 true;

View File

@ -312,21 +312,28 @@ public class ServerMonitor
while (_processes.size() > 0)
{
for (Iterator<ProcessRunner> iterator = _processes.iterator(); iterator.hasNext();)
try
{
ProcessRunner pr = iterator.next();
try
for (Iterator<ProcessRunner> 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++;

View File

@ -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
{
@ -944,7 +940,10 @@ 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;
// Arrows go bye bye.
@ -1390,6 +1389,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);

View File

@ -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)
{

View File

@ -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

View File

@ -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

View File

@ -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
@ -411,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);
}
}
@ -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
public void ItemSpawn(ItemSpawnEvent event)
{
@ -523,16 +559,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)
{

View File

@ -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(),
},

View File

@ -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;
}

View File

@ -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.",

View File

@ -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)

View File

@ -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<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);
}
else
{
player.teleport(GetSpectatorLocation());
}
}
}
}

View File

@ -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[]
{

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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<Entity> _fletchArrows = new HashSet<Entity>();
@ -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);
}

View File

@ -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<Item, Player> _thrown = new HashMap<Item, Player>();
@ -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,11 +110,20 @@ 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"));
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")));
}
}
}

View File

@ -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;
}
}
}

View File

@ -735,6 +735,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++)

View File

@ -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)
{

View File

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