Rank changes

MAC no longer kicks lag/fly
some H&S stuff :O
This commit is contained in:
Chiss 2013-11-07 10:18:36 +11:00
parent bcb86fc911
commit 03731de7f8
19 changed files with 327 additions and 55 deletions

View File

@ -8,18 +8,18 @@ import org.bukkit.entity.Player;
public enum Rank public enum Rank
{ {
OWNER("Owner", ChatColor.DARK_RED), OWNER("OP", ChatColor.DARK_RED),
DEVELOPER("Dev", ChatColor.RED), DEVELOPER("Dev", ChatColor.RED),
ADMIN("Admin", ChatColor.RED), ADMIN("Admin", ChatColor.RED),
MODERATOR("Mod", ChatColor.GOLD), MODERATOR("Mod", ChatColor.GOLD),
HELPER("Helper", ChatColor.YELLOW), HELPER("Helper", ChatColor.GREEN),
MAPDEV("Mapper", ChatColor.GOLD), MAPDEV("Mapper", ChatColor.BLUE),
YOUTUBE("YT", ChatColor.LIGHT_PURPLE), YOUTUBE("Legend", ChatColor.LIGHT_PURPLE),
HERO("Hero", ChatColor.LIGHT_PURPLE), HERO("Hero", ChatColor.DARK_PURPLE),
ULTRA("Ultra", ChatColor.AQUA), ULTRA("Ultra", ChatColor.AQUA),
ALL("All", ChatColor.GREEN); ALL("All", ChatColor.YELLOW);
public ChatColor Color; private ChatColor Color;
public String Name; public String Name;
Rank(String name, ChatColor color) Rank(String name, ChatColor color)
@ -48,4 +48,14 @@ public enum Rank
return false; 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;
}
} }

View File

@ -12,6 +12,7 @@ import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.portal.Portal;
import mineplex.core.punish.Category; import mineplex.core.punish.Category;
import mineplex.core.punish.Punish; import mineplex.core.punish.Punish;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -33,6 +34,7 @@ public class AntiHack extends MiniPlugin
public static AntiHack Instance; public static AntiHack Instance;
public Punish Punish; public Punish Punish;
public Portal Portal;
//Record Offenses //Record Offenses
private HashMap<Player, HashMap<String, ArrayList<Long>>> _suspicion = new HashMap<Player, HashMap<String, ArrayList<Long>>>(); 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; public ArrayList<Detector> _detectors;
protected AntiHack(JavaPlugin plugin, Punish punish) protected AntiHack(JavaPlugin plugin, Punish punish, Portal portal)
{ {
super("AntiHack", plugin); super("AntiHack", plugin);
Punish = punish; Punish = punish;
Portal = portal;
//_repository = new AntiHackRepository(this, plugin.getConfig().getString("serverstatus.name")); //_repository = new AntiHackRepository(this, plugin.getConfig().getString("serverstatus.name"));
//_repository.initialize(); //_repository.initialize();
@ -75,9 +78,9 @@ public class AntiHack extends MiniPlugin
_detectors.add(new Speed(this)); _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 @EventHandler

View File

@ -6,6 +6,7 @@ import mineplex.core.MiniPlugin;
import mineplex.core.antihack.AntiHack; import mineplex.core.antihack.AntiHack;
import mineplex.core.antihack.Detector; import mineplex.core.antihack.Detector;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -55,7 +56,11 @@ public class Idle extends MiniPlugin implements Detector
continue; continue;
//Host.addSuspicion(player, "Lag / Fly (Idle)"); //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");
} }
} }

View File

@ -106,6 +106,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
public void disguise(DisguiseBase disguise) public void disguise(DisguiseBase disguise)
{ {
if (!disguise.GetEntity().isAlive())
return;
_spawnPacketMap.put(disguise.GetEntityId(), disguise); _spawnPacketMap.put(disguise.GetEntityId(), disguise);
reApplyDisguise(disguise); reApplyDisguise(disguise);
@ -377,7 +380,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
_movePacketMap.put(movePacket.a, velocityPacket); _movePacketMap.put(movePacket.a, velocityPacket);
packetList.forceAdd(velocityPacket); //XXX packetList.forceAdd(velocityPacket);
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20) if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20)
{ {
@ -385,7 +388,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
{ {
public void run() public void run()
{ {
packetList.forceAdd(velocityPacket); //XXX packetList.forceAdd(velocityPacket);
} }
}); });
} }
@ -424,7 +427,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
_movePacketMap.put(movePacket.a, velocityPacket); _movePacketMap.put(movePacket.a, velocityPacket);
packetList.forceAdd(velocityPacket); //XXX packetList.forceAdd(velocityPacket);
if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20) if (_goingUp.contains(movePacket.a) && movePacket.c != 0 && movePacket.c > 20)
{ {
@ -432,7 +435,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
{ {
public void run() public void run()
{ {
packetList.forceAdd(velocityPacket); //XXX packetList.forceAdd(velocityPacket);
} }
}); });
} }

View File

@ -21,6 +21,16 @@ public class DisguiseBlock extends DisguiseBase
_blockData = blockData; _blockData = blockData;
} }
public int GetBlockId()
{
return _blockId;
}
public byte GetBlockData()
{
return (byte)_blockData;
}
@Override @Override
public Packet GetSpawnPacket() public Packet GetSpawnPacket()
{ {

View File

@ -135,6 +135,16 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly."); 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 //Log
//Logger().logChat("Private Message", from, to.getName(), message); //Logger().logChat("Private Message", from, to.getName(), message);

View File

@ -69,7 +69,8 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
ItemStackFactory.Initialize(this, false); ItemStackFactory.Initialize(this, false);
Recharge.Initialize(this); Recharge.Initialize(this);
Punish punish = new Punish(this, GetWebServerAddress()); 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()); DonationManager donationManager = new DonationManager(this, GetWebServerAddress());
@ -82,7 +83,6 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
//Main Modules //Main Modules
PacketHandler packetHandler = new PacketHandler(this); PacketHandler packetHandler = new PacketHandler(this);
Portal portal = new Portal(this);
PartyManager partyManager = new PartyManager(this, clientManager); 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); 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)); new ServerManager(this, clientManager, donationManager, portal, partyManager, new ServerStatusManager(this, new LagMeter(this, clientManager)), hubManager, new StackerManager(hubManager));

View File

@ -216,7 +216,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
for (Rank rank : Rank.values()) for (Rank rank : Rank.values())
{ {
if (rank != Rank.ALL) 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 else
board.registerNewTeam(rank.Name).setPrefix(""); board.registerNewTeam(rank.Name).setPrefix("");
} }
@ -290,10 +290,10 @@ public class HubManager extends MiniClientPlugin<HubClient>
//Rank Prefix //Rank Prefix
String rankStr = ""; String rankStr = "";
if (rank != Rank.ALL) if (rank != Rank.ALL)
rankStr = rank.Color + C.Bold + rank.Name.toUpperCase() + " "; rankStr = rank.GetTag(true, true) + " ";
if (ownsUltra && !rank.Has(Rank.ULTRA)) if (ownsUltra && !rank.Has(Rank.ULTRA))
rankStr = Rank.ULTRA.Color + C.Bold + Rank.ULTRA.Name.toUpperCase() + " "; rankStr = Rank.ULTRA.GetTag(true, true) + " ";
//Party Chat //Party Chat
if (event.getMessage().charAt(0) == '@') if (event.getMessage().charAt(0) == '@')

View File

@ -49,7 +49,7 @@ public class Party
for (Rank rank : Rank.values()) for (Rank rank : Rank.values())
{ {
if (rank != Rank.ALL) 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 else
_scoreboard.registerNewTeam(rank.Name).setPrefix(""); _scoreboard.registerNewTeam(rank.Name).setPrefix("");
} }

View File

@ -14,7 +14,6 @@ import mineplex.core.antihack.AntiHack;
import mineplex.core.antistack.AntiStack; import mineplex.core.antistack.AntiStack;
import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.command.CommandCenter; import mineplex.core.command.CommandCenter;
import mineplex.core.common.Rank;
import mineplex.core.common.util.FileUtil; import mineplex.core.common.util.FileUtil;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.creature.Creature; 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); _damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, GetCreature()), disguiseManager);
Portal portal = new Portal(this);
//Arcade Manager //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 //Unreferenced Modules
//new AntiStack();
Scheduler.Initialize(this); Scheduler.Initialize(this);
//new Information(this);
Punish punish = new Punish(this, GetWebServerAddress()); Punish punish = new Punish(this, GetWebServerAddress());
AntiHack.Initialize(this, punish); AntiHack.Initialize(this, punish, portal);
new MemoryFix(this); new MemoryFix(this);

View File

@ -28,11 +28,9 @@ import org.bukkit.event.server.ServerListPingEvent;
import mineplex.minecraft.game.classcombat.Class.ClassManager; import mineplex.minecraft.game.classcombat.Class.ClassManager;
import mineplex.minecraft.game.classcombat.Class.IPvpClass; import mineplex.minecraft.game.classcombat.Class.IPvpClass;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; 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.ClassCombatCustomBuildShop;
import mineplex.minecraft.game.classcombat.shop.ClassShopManager; import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
import mineplex.minecraft.game.core.IRelation; 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.ConditionManager;
import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.DamageManager; import mineplex.minecraft.game.core.damage.DamageManager;
@ -49,9 +47,7 @@ import mineplex.core.common.util.*;
import mineplex.core.creature.Creature; import mineplex.core.creature.Creature;
import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.movement.Movement;
import mineplex.core.packethandler.PacketHandler; import mineplex.core.packethandler.PacketHandler;
import mineplex.core.energy.Energy;
import mineplex.core.explosion.Explosion; import mineplex.core.explosion.Explosion;
import mineplex.core.portal.Portal; import mineplex.core.portal.Portal;
import mineplex.core.projectile.ProjectileManager; import mineplex.core.projectile.ProjectileManager;
@ -96,7 +92,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
//Games //Games
private Game _game; 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); super("Game Manager", plugin);
@ -140,7 +136,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_classCustomBuildShop = new ClassCombatCustomBuildShop(_classShopManager, clientManager, donationManager, webAddress); _classCustomBuildShop = new ClassCombatCustomBuildShop(_classShopManager, clientManager, donationManager, webAddress);
*/ */
_portal = new Portal(plugin); _portal = portal;
//Shop //Shop
_arcadeShop = new ArcadeShop(this, clientManager, donationManager); _arcadeShop = new ArcadeShop(this, clientManager, donationManager);

View File

@ -1,18 +1,35 @@
package nautilus.game.arcade.game.games.hideseek; 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.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.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.entity.PlayerDeathEvent; 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.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; 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.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; 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.TeamGame;
import nautilus.game.arcade.game.games.hideseek.kits.*; import nautilus.game.arcade.game.games.hideseek.kits.*;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
public class HideSeek extends TeamGame public class HideSeek extends TeamGame
{ {
@ -28,6 +46,12 @@ public class HideSeek extends TeamGame
private long _gameTime = 300000; 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) public HideSeek(ArcadeManager manager)
{ {
super(manager, GameType.HideSeek, super(manager, GameType.HideSeek,
@ -37,7 +61,10 @@ public class HideSeek extends TeamGame
new KitHiderAcrobat(manager), new KitHiderAcrobat(manager),
new KitHiderSwapper(manager), new KitHiderSwapper(manager),
new KitHiderShocker(manager), new KitHiderShocker(manager),
new NullKit(manager),
new KitSeekerRadar(manager), new KitSeekerRadar(manager),
new KitSeekerArcher(manager),
new KitSeekerTNT(manager),
}, },
new String[] new String[]
@ -48,6 +75,28 @@ public class HideSeek extends TeamGame
}); });
this.DeathOut = false; 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 @EventHandler
@ -63,6 +112,31 @@ public class HideSeek extends TeamGame
_seekers = GetTeamList().get(1); _seekers = GetTeamList().get(1);
_seekers.SetColor(ChatColor.RED); _seekers.SetColor(ChatColor.RED);
_seekers.SetName("Seekers"); _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);
}
}
}
} }
/* /*
@ -73,6 +147,165 @@ public class HideSeek extends TeamGame
} }
*/ */
@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 @EventHandler
public void UpdateSeekers(UpdateEvent event) public void UpdateSeekers(UpdateEvent event)
{ {
@ -102,12 +335,11 @@ public class HideSeek extends TeamGame
{ {
SetPlayerTeam(player, _seekers); SetPlayerTeam(player, _seekers);
//Kit Manager.GetDisguise().undisguise(player);
Kit newKit = GetKits()[5]; //Normal
if (forced) newKit = GetKits()[4]; //Alpha
SetKit(player, newKit, false); //Kit
newKit.ApplyKit(player); SetKit(player, GetKits()[4], false);
GetKits()[4].ApplyKit(player);
//Refresh //Refresh
for (Player other : UtilServer.getPlayers()) for (Player other : UtilServer.getPlayers())
@ -177,7 +409,6 @@ public class HideSeek extends TeamGame
ChatColor.WHITE + "§lTime: " + C.cGreen + "§l" ChatColor.WHITE + "§lTime: " + C.cGreen + "§l"
+ UtilTime.MakeStr(0)); + UtilTime.MakeStr(0));
//XXX End
SetState(GameState.End); SetState(GameState.End);
AnnounceEnd(_hiders); AnnounceEnd(_hiders);

View File

@ -8,9 +8,11 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Slime; import org.bukkit.entity.Slime;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBlock; import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseSlime; import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
@ -39,7 +41,7 @@ public class KitHiderAcrobat extends Kit
@Override @Override
public void GiveItems(Player player) 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 @Override

View File

@ -8,9 +8,11 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Slime; import org.bukkit.entity.Slime;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBlock; import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseSlime; import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
@ -38,7 +40,7 @@ public class KitHiderShocker extends Kit
@Override @Override
public void GiveItems(Player player) 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 @Override

View File

@ -8,9 +8,11 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Slime; import org.bukkit.entity.Slime;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBlock; import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseSlime; import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
@ -39,7 +41,7 @@ public class KitHiderSwapper extends Kit
@Override @Override
public void GiveItems(Player player) 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 @Override

View File

@ -21,10 +21,10 @@ public class KitSeekerArcher extends Kit
{ {
public KitSeekerArcher(ArcadeManager manager) public KitSeekerArcher(ArcadeManager manager)
{ {
super(manager, "Castle Marksman", KitAvailability.Green, super(manager, "Archer Seeker", KitAvailability.Green,
new String[] new String[]
{ {
"Skilled human marksman, can fletch arrows." "PEW"
}, },
new Perk[] new Perk[]
{ {

View File

@ -62,10 +62,10 @@ public class GameChatManager implements Listener
//Rank Prefix //Rank Prefix
String rankStr = ""; String rankStr = "";
if (rank != Rank.ALL) if (rank != Rank.ALL)
rankStr = rank.Color + C.Bold + rank.Name.toUpperCase() + " "; rankStr = rank.GetTag(true, true) + " ";
if (ownsUltra && !rank.Has(Rank.ULTRA)) 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) if (Manager.GetGame() != null && Manager.GetGame().GetType() == GameType.UHC)
{ {

View File

@ -76,7 +76,6 @@ public class GameLobbyManager implements IPacketRunnable, Listener
private Location _kitText; private Location _kitText;
private Location _teamText; private Location _teamText;
private Location _kitDisplay; private Location _kitDisplay;
private Location _teamDisplay; private Location _teamDisplay;
@ -167,7 +166,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
} }
else 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()) if (Manager.GetGame() != null && !Manager.GetGame().GetTeamList().isEmpty())
@ -180,7 +179,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
} }
else 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());
} }
} }
} }