Merge branch 'master' of ssh://dev.mineplex.com:7999/min/Mineplex
This commit is contained in:
commit
e0d10f6550
@ -8,18 +8,18 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public enum Rank
|
||||
{
|
||||
OWNER("Owner", ChatColor.DARK_RED),
|
||||
OWNER("OP", ChatColor.DARK_RED),
|
||||
DEVELOPER("Dev", ChatColor.RED),
|
||||
ADMIN("Admin", ChatColor.RED),
|
||||
MODERATOR("Mod", ChatColor.GOLD),
|
||||
HELPER("Helper", ChatColor.YELLOW),
|
||||
MAPDEV("Mapper", ChatColor.GOLD),
|
||||
YOUTUBE("YT", ChatColor.LIGHT_PURPLE),
|
||||
HERO("Hero", ChatColor.LIGHT_PURPLE),
|
||||
HELPER("Helper", ChatColor.GREEN),
|
||||
MAPDEV("Mapper", ChatColor.BLUE),
|
||||
YOUTUBE("Legend", ChatColor.LIGHT_PURPLE),
|
||||
HERO("Hero", ChatColor.DARK_PURPLE),
|
||||
ULTRA("Ultra", ChatColor.AQUA),
|
||||
ALL("All", ChatColor.GREEN);
|
||||
ALL("All", ChatColor.YELLOW);
|
||||
|
||||
public ChatColor Color;
|
||||
private ChatColor Color;
|
||||
public String Name;
|
||||
|
||||
Rank(String name, ChatColor color)
|
||||
@ -48,4 +48,14 @@ public enum Rank
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String GetTag(boolean bold, boolean uppercase)
|
||||
{
|
||||
String name = Name;
|
||||
if (uppercase)
|
||||
name = Name.toUpperCase();
|
||||
|
||||
if (bold) return Color + C.Bold + name;
|
||||
else return Color + name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.punish.Category;
|
||||
import mineplex.core.punish.Punish;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
@ -33,6 +34,7 @@ public class AntiHack extends MiniPlugin
|
||||
public static AntiHack Instance;
|
||||
|
||||
public Punish Punish;
|
||||
public Portal Portal;
|
||||
|
||||
//Record Offenses
|
||||
private HashMap<Player, HashMap<String, ArrayList<Long>>> _suspicion = new HashMap<Player, HashMap<String, ArrayList<Long>>>();
|
||||
@ -59,11 +61,12 @@ public class AntiHack extends MiniPlugin
|
||||
|
||||
public ArrayList<Detector> _detectors;
|
||||
|
||||
protected AntiHack(JavaPlugin plugin, Punish punish)
|
||||
protected AntiHack(JavaPlugin plugin, Punish punish, Portal portal)
|
||||
{
|
||||
super("AntiHack", plugin);
|
||||
|
||||
Punish = punish;
|
||||
Portal = portal;
|
||||
|
||||
//_repository = new AntiHackRepository(this, plugin.getConfig().getString("serverstatus.name"));
|
||||
//_repository.initialize();
|
||||
@ -75,9 +78,9 @@ public class AntiHack extends MiniPlugin
|
||||
_detectors.add(new Speed(this));
|
||||
}
|
||||
|
||||
public static void Initialize(JavaPlugin plugin, Punish punish)
|
||||
public static void Initialize(JavaPlugin plugin, Punish punish, Portal portal)
|
||||
{
|
||||
Instance = new AntiHack(plugin, punish);
|
||||
Instance = new AntiHack(plugin, punish, portal);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -6,6 +6,7 @@ import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.antihack.Detector;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
@ -55,7 +56,11 @@ public class Idle extends MiniPlugin implements Detector
|
||||
continue;
|
||||
|
||||
//Host.addSuspicion(player, "Lag / Fly (Idle)");
|
||||
player.kickPlayer(C.cGold + "Mineplex " + C.cRed + "Anti-Cheat " + C.cWhite + "Kicked for Lag / Fly (Idle)");
|
||||
//player.kickPlayer(C.cGold + "Mineplex " + C.cRed + "Anti-Cheat " + C.cWhite + "Kicked for Lag / Fly (Idle)");
|
||||
|
||||
UtilPlayer.message(player, C.cRed + C.Bold + "Mineplex Anti-Cheat detected Lagging / Fly (Idle)");
|
||||
UtilPlayer.message(player, C.cRed + C.Bold + "You have been returned to Lobby.");
|
||||
Host.Portal.SendPlayerToServer(player, "Lobby");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
|
||||
public void disguise(DisguiseBase disguise)
|
||||
{
|
||||
if (!disguise.GetEntity().isAlive())
|
||||
return;
|
||||
|
||||
_spawnPacketMap.put(disguise.GetEntityId(), disguise);
|
||||
|
||||
reApplyDisguise(disguise);
|
||||
@ -387,7 +390,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
|
||||
_movePacketMap.put(movePacket.a, velocityPacket);
|
||||
|
||||
packetList.forceAdd(velocityPacket);
|
||||
//XXX packetList.forceAdd(velocityPacket);
|
||||
|
||||
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20)
|
||||
{
|
||||
@ -395,7 +398,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
packetList.forceAdd(velocityPacket);
|
||||
//XXX packetList.forceAdd(velocityPacket);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -434,7 +437,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
|
||||
_movePacketMap.put(movePacket.a, velocityPacket);
|
||||
|
||||
packetList.forceAdd(velocityPacket);
|
||||
//XXX packetList.forceAdd(velocityPacket);
|
||||
|
||||
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20)
|
||||
{
|
||||
@ -442,7 +445,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
packetList.forceAdd(velocityPacket);
|
||||
//XXX packetList.forceAdd(velocityPacket);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -20,6 +20,16 @@ public class DisguiseBlock extends DisguiseBase
|
||||
_blockId = blockId;
|
||||
_blockData = blockData;
|
||||
}
|
||||
|
||||
public int GetBlockId()
|
||||
{
|
||||
return _blockId;
|
||||
}
|
||||
|
||||
public byte GetBlockData()
|
||||
{
|
||||
return (byte)_blockData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet GetSpawnPacket()
|
||||
|
@ -135,6 +135,16 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly.");
|
||||
}
|
||||
|
||||
//Youtuber
|
||||
if (_clientManager.Get(to).GetRank() == Rank.YOUTUBE)
|
||||
{
|
||||
if (!_clientManager.Get(from).GetRank().Has(from, Rank.MODERATOR, true))
|
||||
{
|
||||
UtilPlayer.message(from, C.cPurple + "YouTubers cannot be private messaged.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Log
|
||||
//Logger().logChat("Private Message", from, to.getName(), message);
|
||||
|
||||
|
@ -69,7 +69,8 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
|
||||
ItemStackFactory.Initialize(this, false);
|
||||
Recharge.Initialize(this);
|
||||
Punish punish = new Punish(this, GetWebServerAddress());
|
||||
AntiHack.Initialize(this, punish);
|
||||
Portal portal = new Portal(this);
|
||||
AntiHack.Initialize(this, punish, portal);
|
||||
|
||||
DonationManager donationManager = new DonationManager(this, GetWebServerAddress());
|
||||
|
||||
@ -82,7 +83,6 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
|
||||
|
||||
//Main Modules
|
||||
PacketHandler packetHandler = new PacketHandler(this);
|
||||
Portal portal = new Portal(this);
|
||||
PartyManager partyManager = new PartyManager(this, clientManager);
|
||||
HubManager hubManager = new HubManager(this, new BlockRestore(this), clientManager, donationManager, new ConditionManager(this), new DisguiseManager(this, packetHandler), new TaskManager(this, GetWebServerAddress()), portal, partyManager);
|
||||
new ServerManager(this, clientManager, donationManager, portal, partyManager, new ServerStatusManager(this, new LagMeter(this, clientManager)), hubManager, new StackerManager(hubManager));
|
||||
|
@ -216,7 +216,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
for (Rank rank : Rank.values())
|
||||
{
|
||||
if (rank != Rank.ALL)
|
||||
board.registerNewTeam(rank.Name).setPrefix(rank.Color + C.Bold + rank.Name + ChatColor.RESET + " ");
|
||||
board.registerNewTeam(rank.Name).setPrefix(rank.GetTag(true, false) + ChatColor.RESET + " ");
|
||||
else
|
||||
board.registerNewTeam(rank.Name).setPrefix("");
|
||||
}
|
||||
@ -290,10 +290,10 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
//Rank Prefix
|
||||
String rankStr = "";
|
||||
if (rank != Rank.ALL)
|
||||
rankStr = rank.Color + C.Bold + rank.Name.toUpperCase() + " ";
|
||||
rankStr = rank.GetTag(true, true) + " ";
|
||||
|
||||
if (ownsUltra && !rank.Has(Rank.ULTRA))
|
||||
rankStr = Rank.ULTRA.Color + C.Bold + Rank.ULTRA.Name.toUpperCase() + " ";
|
||||
rankStr = Rank.ULTRA.GetTag(true, true) + " ";
|
||||
|
||||
//Party Chat
|
||||
if (event.getMessage().charAt(0) == '@')
|
||||
|
@ -21,6 +21,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
@ -179,6 +180,16 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is not playing stacker."));
|
||||
return;
|
||||
}
|
||||
|
||||
//YouTuber
|
||||
if (stackee instanceof Player && Manager.GetClients().Get((Player)stackee).GetRank() == Rank.YOUTUBE)
|
||||
{
|
||||
if (!Manager.GetClients().Get(stacker).GetRank().Has(Rank.YOUTUBE))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " cannot be stacked! Leave him/her alone!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (stackee instanceof LivingEntity)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ public class Party
|
||||
for (Rank rank : Rank.values())
|
||||
{
|
||||
if (rank != Rank.ALL)
|
||||
_scoreboard.registerNewTeam(rank.Name).setPrefix(rank.Color + C.Bold + rank.Name + ChatColor.RESET + " ");
|
||||
_scoreboard.registerNewTeam(rank.Name).setPrefix(rank.GetTag(true, false) + ChatColor.RESET + " ");
|
||||
else
|
||||
_scoreboard.registerNewTeam(rank.Name).setPrefix("");
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.hub.party.Party;
|
||||
import mineplex.hub.party.PartyManager;
|
||||
@ -88,6 +89,16 @@ public class PartyCommand extends CommandBase<PartyManager>
|
||||
UtilPlayer.message(caller, F.main("Party", "You cannot Party with yourself."));
|
||||
return;
|
||||
}
|
||||
|
||||
//YouTuber
|
||||
if (Plugin.GetClients().Get(target).GetRank() == Rank.YOUTUBE)
|
||||
{
|
||||
if (Plugin.GetClients().Get(caller).GetRank().Has(Rank.YOUTUBE))
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Stacker", "You may not party with " + F.name(UtilEnt.getName(target)) + "! Leave him/her alone!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Invite or Suggest
|
||||
if (party != null)
|
||||
|
@ -14,7 +14,6 @@ import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.antistack.AntiStack;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.command.CommandCenter;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.FileUtil;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.creature.Creature;
|
||||
@ -124,16 +123,16 @@ public class Arcade extends JavaPlugin implements INautilusPlugin, IPlugin
|
||||
|
||||
_damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, GetCreature()), disguiseManager);
|
||||
|
||||
Portal portal = new Portal(this);
|
||||
|
||||
//Arcade Manager
|
||||
_gameManager = new ArcadeManager(this, ReadServerConfig(), _clientManager, _donationManager, conditionManager, _damageManager, disguiseManager, GetCreature(), GetBlood(), antistack, packetHandler, GetWebServerAddress());
|
||||
_gameManager = new ArcadeManager(this, ReadServerConfig(), _clientManager, _donationManager, conditionManager, _damageManager, disguiseManager, GetCreature(), GetBlood(), antistack, portal, packetHandler, GetWebServerAddress());
|
||||
|
||||
//Unreferenced Modules
|
||||
//new AntiStack();
|
||||
Scheduler.Initialize(this);
|
||||
//new Information(this);
|
||||
|
||||
Punish punish = new Punish(this, GetWebServerAddress());
|
||||
AntiHack.Initialize(this, punish);
|
||||
AntiHack.Initialize(this, punish, portal);
|
||||
|
||||
new MemoryFix(this);
|
||||
|
||||
|
@ -28,11 +28,9 @@ import org.bukkit.event.server.ServerListPingEvent;
|
||||
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.classcombat.itempack.ItemPackFactory;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassCombatCustomBuildShop;
|
||||
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
|
||||
import mineplex.minecraft.game.core.IRelation;
|
||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||
@ -49,9 +47,7 @@ import mineplex.core.common.util.*;
|
||||
import mineplex.core.creature.Creature;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.movement.Movement;
|
||||
import mineplex.core.packethandler.PacketHandler;
|
||||
import mineplex.core.energy.Energy;
|
||||
import mineplex.core.explosion.Explosion;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
@ -96,7 +92,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
//Games
|
||||
private Game _game;
|
||||
|
||||
public ArcadeManager(Arcade plugin, GameServerConfig serverConfig, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DamageManager damageManager, DisguiseManager disguiseManager, Creature creature, Blood blood, AntiStack antistack, PacketHandler packetHandler, String webAddress)
|
||||
public ArcadeManager(Arcade plugin, GameServerConfig serverConfig, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DamageManager damageManager, DisguiseManager disguiseManager, Creature creature, Blood blood, AntiStack antistack, Portal portal, PacketHandler packetHandler, String webAddress)
|
||||
{
|
||||
super("Game Manager", plugin);
|
||||
|
||||
@ -140,7 +136,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
_classCustomBuildShop = new ClassCombatCustomBuildShop(_classShopManager, clientManager, donationManager, webAddress);
|
||||
*/
|
||||
|
||||
_portal = new Portal(plugin);
|
||||
_portal = portal;
|
||||
|
||||
//Shop
|
||||
_arcadeShop = new ArcadeShop(this, clientManager, donationManager);
|
||||
|
@ -25,7 +25,7 @@ public class KitHumanMarksman extends Kit
|
||||
new String[]
|
||||
{
|
||||
"Skilled human marksman, can fletch arrows."
|
||||
},
|
||||
},
|
||||
new Perk[]
|
||||
{
|
||||
new PerkBarrage(5, 250, true, false),
|
||||
|
@ -1,18 +1,35 @@
|
||||
package nautilus.game.arcade.game.games.hideseek;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseBlock;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
@ -20,6 +37,7 @@ import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.hideseek.kits.*;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.NullKit;
|
||||
|
||||
public class HideSeek extends TeamGame
|
||||
{
|
||||
@ -27,6 +45,12 @@ public class HideSeek extends TeamGame
|
||||
private GameTeam _seekers;
|
||||
|
||||
private long _gameTime = 300000;
|
||||
|
||||
private HashMap<Player, DisguiseBase> _disguises = new HashMap<Player, DisguiseBase>();
|
||||
private HashMap<Player, Block> _disguiseBlock = new HashMap<Player, Block>();
|
||||
private HashMap<Player, Location> _disguiseMovement = new HashMap<Player, Location>();
|
||||
|
||||
private ArrayList<Material> _allowedBlocks;
|
||||
|
||||
public HideSeek(ArcadeManager manager)
|
||||
{
|
||||
@ -37,7 +61,10 @@ public class HideSeek extends TeamGame
|
||||
new KitHiderAcrobat(manager),
|
||||
new KitHiderSwapper(manager),
|
||||
new KitHiderShocker(manager),
|
||||
new NullKit(manager),
|
||||
new KitSeekerRadar(manager),
|
||||
new KitSeekerArcher(manager),
|
||||
new KitSeekerTNT(manager),
|
||||
},
|
||||
|
||||
new String[]
|
||||
@ -48,8 +75,30 @@ public class HideSeek extends TeamGame
|
||||
});
|
||||
|
||||
this.DeathOut = false;
|
||||
|
||||
_allowedBlocks = new ArrayList<Material>();
|
||||
_allowedBlocks.add(Material.TNT);
|
||||
_allowedBlocks.add(Material.BOOKSHELF);
|
||||
_allowedBlocks.add(Material.CHEST);
|
||||
_allowedBlocks.add(Material.WORKBENCH);
|
||||
_allowedBlocks.add(Material.FURNACE);
|
||||
_allowedBlocks.add(Material.MELON_BLOCK);
|
||||
_allowedBlocks.add(Material.CAULDRON);
|
||||
_allowedBlocks.add(Material.BEACON);
|
||||
_allowedBlocks.add(Material.FLOWER_POT);
|
||||
_allowedBlocks.add(Material.ANVIL);
|
||||
_allowedBlocks.add(Material.HAY_BLOCK);
|
||||
_allowedBlocks.add(Material.CAKE);
|
||||
}
|
||||
|
||||
|
||||
public Material GetItemEquivilent(Material mat)
|
||||
{
|
||||
if (mat == Material.CAULDRON) return Material.CAULDRON_ITEM;
|
||||
if (mat == Material.FLOWER_POT) return Material.FLOWER_POT_ITEM;
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CustomTeamGeneration(GameStateChangeEvent event)
|
||||
{
|
||||
@ -63,6 +112,31 @@ public class HideSeek extends TeamGame
|
||||
_seekers = GetTeamList().get(1);
|
||||
_seekers.SetColor(ChatColor.RED);
|
||||
_seekers.SetName("Seekers");
|
||||
|
||||
RestrictKits();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void RestrictKits()
|
||||
{
|
||||
for (Kit kit : GetKits())
|
||||
{
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
if (team.GetColor() == ChatColor.RED)
|
||||
{
|
||||
if (kit.GetName().contains("Hider"))
|
||||
team.GetRestrictedKits().add(kit);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (kit.GetName().contains("Seeker"))
|
||||
team.GetRestrictedKits().add(kit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -72,7 +146,166 @@ public class HideSeek extends TeamGame
|
||||
return _hiders;
|
||||
}
|
||||
*/
|
||||
|
||||
@EventHandler
|
||||
public void InitialDisguise(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Live)
|
||||
return;
|
||||
|
||||
for (Player player : _hiders.GetPlayers(true))
|
||||
SetDisguiseBlock(player, _allowedBlocks.get(UtilMath.r(_allowedBlocks.size())));
|
||||
}
|
||||
|
||||
public void SetDisguiseBlock(Player player, Material type)
|
||||
{
|
||||
DisguiseBlock disguise = new DisguiseBlock(player, type.getId(), 0);
|
||||
_disguises.put(player, disguise);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(type, (byte)0, false) + " Block") + "!"));
|
||||
|
||||
//Give Item
|
||||
player.getInventory().setItem(8, new ItemStack(GetItemEquivilent(type)));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void SolidifyUpdate(UpdateEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Player player : _hiders.GetPlayers(true))
|
||||
{
|
||||
DisguiseBase disguise = _disguises.get(player);
|
||||
if (disguise == null || !(disguise instanceof DisguiseBlock))
|
||||
continue;
|
||||
|
||||
DisguiseBlock blockDisguise = (DisguiseBlock)disguise;
|
||||
|
||||
if (!_disguiseMovement.containsKey(player))
|
||||
_disguiseMovement.put(player, player.getLocation());
|
||||
|
||||
//Not a Block
|
||||
if (!_disguiseBlock.containsKey(player))
|
||||
{
|
||||
//Moved
|
||||
if (!_disguiseMovement.get(player).getBlock().equals(player.getLocation().getBlock()))
|
||||
{
|
||||
player.setExp(0);
|
||||
_disguiseMovement.put(player, player.getLocation());
|
||||
}
|
||||
//Unmoved
|
||||
else
|
||||
{
|
||||
player.setExp((float) Math.min(0.999f, player.getExp() + 0.025));
|
||||
|
||||
//Set Block
|
||||
if (player.getExp() >= 0.999f)
|
||||
{
|
||||
Block block = player.getLocation().getBlock();
|
||||
|
||||
//Not Able
|
||||
if (block.getType() != Material.AIR)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You cannot become a Solid Block here."));
|
||||
player.setExp(0f);
|
||||
continue;
|
||||
}
|
||||
|
||||
//Set Block
|
||||
_disguiseBlock.put(player, block);
|
||||
|
||||
//Effect
|
||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, blockDisguise.GetBlockId());
|
||||
|
||||
//Display
|
||||
SolidifyVisual(player);
|
||||
|
||||
//Invisible
|
||||
Manager.GetCondition().Factory().Cloak("Disguised as Block", player, player, 60000, false, false);
|
||||
|
||||
//Sound
|
||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Is a Block
|
||||
else
|
||||
{
|
||||
//Moved
|
||||
if (!_disguiseBlock.get(player).equals(player.getLocation().getBlock()))
|
||||
{
|
||||
SolidifyRemove(player);
|
||||
}
|
||||
//Send Packets
|
||||
else
|
||||
{
|
||||
SolidifyVisual(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SolidifyRemove(Player player)
|
||||
{
|
||||
Block block = _disguiseBlock.remove(player);
|
||||
|
||||
if (block == null)
|
||||
return;
|
||||
|
||||
MapUtil.QuickChangeBlockAt(block.getLocation(), 0, (byte)0);
|
||||
|
||||
player.setExp(0f);
|
||||
|
||||
Manager.GetCondition().EndCondition(player, null, "Disguised as Block");
|
||||
|
||||
//Inform
|
||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 0.5f);
|
||||
}
|
||||
|
||||
public void SolidifyVisual(Player player)
|
||||
{
|
||||
if (!_disguises.containsKey(player) || !(_disguises.get(player) instanceof DisguiseBlock))
|
||||
{
|
||||
SolidifyRemove(player);
|
||||
return;
|
||||
}
|
||||
|
||||
DisguiseBlock block = (DisguiseBlock)_disguises.get(player);
|
||||
|
||||
//Others
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
other.sendBlockChange(player.getLocation(), block.GetBlockId(), block.GetBlockData());
|
||||
|
||||
//Self
|
||||
player.sendBlockChange(player.getLocation(), 36, (byte)0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void BlockDamage(BlockDamageEvent event)
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (!_disguiseBlock.containsKey(player))
|
||||
continue;
|
||||
|
||||
if (!_disguiseBlock.get(player).equals(event.getBlock()))
|
||||
continue;
|
||||
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(player, event.getPlayer(), null,
|
||||
DamageCause.CUSTOM, 5, true, true, false,
|
||||
event.getPlayer().getName(), "Block Form Attack");
|
||||
|
||||
SolidifyRemove(player);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void UpdateSeekers(UpdateEvent event)
|
||||
{
|
||||
@ -101,13 +334,12 @@ public class HideSeek extends TeamGame
|
||||
public void SetSeeker(Player player, boolean forced)
|
||||
{
|
||||
SetPlayerTeam(player, _seekers);
|
||||
|
||||
Manager.GetDisguise().undisguise(player);
|
||||
|
||||
//Kit
|
||||
Kit newKit = GetKits()[5]; //Normal
|
||||
if (forced) newKit = GetKits()[4]; //Alpha
|
||||
|
||||
SetKit(player, newKit, false);
|
||||
newKit.ApplyKit(player);
|
||||
SetKit(player, GetKits()[4], false);
|
||||
GetKits()[4].ApplyKit(player);
|
||||
|
||||
//Refresh
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
@ -176,8 +408,7 @@ public class HideSeek extends TeamGame
|
||||
GetObjectiveSide().setDisplayName(
|
||||
ChatColor.WHITE + "§lTime: " + C.cGreen + "§l"
|
||||
+ UtilTime.MakeStr(0));
|
||||
|
||||
//XXX End
|
||||
|
||||
SetState(GameState.End);
|
||||
AnnounceEnd(_hiders);
|
||||
|
||||
|
@ -8,9 +8,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.disguises.DisguiseBlock;
|
||||
import mineplex.core.disguise.disguises.DisguiseSlime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
@ -39,7 +41,7 @@ public class KitHiderAcrobat extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SLIME_BALL, (byte)0, 1,C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Change Form"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,9 +8,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.disguises.DisguiseBlock;
|
||||
import mineplex.core.disguise.disguises.DisguiseSlime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
@ -38,7 +40,7 @@ public class KitHiderShocker extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SLIME_BALL, (byte)0, 1,C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Change Form"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,9 +8,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.disguises.DisguiseBlock;
|
||||
import mineplex.core.disguise.disguises.DisguiseSlime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
@ -39,7 +41,7 @@ public class KitHiderSwapper extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SLIME_BALL, (byte)0, 1,C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Change Form"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
package nautilus.game.arcade.game.games.hideseek.kits;
|
||||
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -21,10 +21,10 @@ public class KitSeekerArcher extends Kit
|
||||
{
|
||||
public KitSeekerArcher(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Castle Marksman", KitAvailability.Green,
|
||||
super(manager, "Archer Seeker", KitAvailability.Green,
|
||||
new String[]
|
||||
{
|
||||
"Skilled human marksman, can fletch arrows."
|
||||
"PEW"
|
||||
},
|
||||
new Perk[]
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ public class GameChatManager implements Listener
|
||||
Manager = manager;
|
||||
|
||||
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void MeCancel(PlayerCommandPreprocessEvent event)
|
||||
@ -62,10 +62,10 @@ public class GameChatManager implements Listener
|
||||
//Rank Prefix
|
||||
String rankStr = "";
|
||||
if (rank != Rank.ALL)
|
||||
rankStr = rank.Color + C.Bold + rank.Name.toUpperCase() + " ";
|
||||
rankStr = rank.GetTag(true, true) + " ";
|
||||
|
||||
if (ownsUltra && !rank.Has(Rank.ULTRA))
|
||||
rankStr = Rank.ULTRA.Color + C.Bold + Rank.ULTRA.Name.toUpperCase() + " ";
|
||||
rankStr = Rank.ULTRA.GetTag(true, true) + " ";
|
||||
|
||||
if (Manager.GetGame() != null && Manager.GetGame().GetType() == GameType.UHC)
|
||||
{
|
||||
|
@ -76,9 +76,8 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
private Location _kitText;
|
||||
private Location _teamText;
|
||||
|
||||
|
||||
private Location _kitDisplay;
|
||||
private Location _teamDisplay;
|
||||
private Location _teamDisplay;
|
||||
|
||||
private Location spawn;
|
||||
|
||||
@ -92,7 +91,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
private Color _fireworkColor;
|
||||
|
||||
private int _advertiseStage = 0;
|
||||
|
||||
|
||||
//Scoreboard
|
||||
private NautHashMap<Player, Scoreboard> _scoreboardMap = new NautHashMap<Player, Scoreboard>();
|
||||
private NautHashMap<Player, Integer> _gemMap = new NautHashMap<Player, Integer>();
|
||||
@ -167,7 +166,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
}
|
||||
else
|
||||
{
|
||||
scoreboard.registerNewTeam(rank.Name).setPrefix(rank.Color + C.Bold + rank.Name.toUpperCase() + ChatColor.RESET + " " + ChatColor.WHITE);
|
||||
scoreboard.registerNewTeam(rank.Name).setPrefix(rank.GetTag(true, true) + ChatColor.RESET + " " + ChatColor.WHITE);
|
||||
}
|
||||
|
||||
if (Manager.GetGame() != null && !Manager.GetGame().GetTeamList().isEmpty())
|
||||
@ -180,7 +179,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
}
|
||||
else
|
||||
{
|
||||
scoreboard.registerNewTeam(rank.Name + team.GetName().toUpperCase()).setPrefix(rank.Color + C.Bold + rank.Name.toUpperCase() + ChatColor.RESET + " " + team.GetColor());
|
||||
scoreboard.registerNewTeam(rank.Name + team.GetName().toUpperCase()).setPrefix(rank.GetTag(true, true) + ChatColor.RESET + " " + team.GetColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user