vanish error fixes

This commit is contained in:
Ben 2016-03-08 21:00:19 +00:00
parent 69091c079f
commit af8f0fff16

View File

@ -17,7 +17,6 @@ import mineplex.core.vanish.commands.VanishCommand;
import mineplex.core.vanish.events.PreVanishEvent;
import mineplex.core.vanish.repository.VanishClient;
import mineplex.core.vanish.repository.VanishRepository;
import mineplex.game.clans.tutorials.Tutorial;
import net.md_5.bungee.api.ChatColor;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
@ -36,28 +35,20 @@ public class Vanish extends MiniClientPlugin<VanishClient>
packetHandler.addPacketHandler(info -> {
PacketPlayOutChat packet = (PacketPlayOutChat) info.getPacket();
if (packet.getPacket() instanceof PacketPlayOutChat)
if (packet.b == 1)
{
PacketPlayOutChat chat = (PacketPlayOutChat) packet.getPacket();
if (chat.b == 1)
{
if (chat.a.a().isEmpty())
if (packet.a.a().isEmpty())
{
return;
}
if (chat.a.a().get(0).c().equals(ChatColor.stripColor(Tutorial.AllowedMessage)))
if (packet.a.a().get(0).c().equals(ChatColor.stripColor("Join>")))
{
chat.a.a().remove(0);
packet.a.a().remove(0);
}
else if (!chat.a.a().get(0).c().contains(Tutorial.AllowedBypass))
else if (!packet.a.a().get(0).c().contains("Join>"))
{
if (isInTutorial(packet.getPlayer()))
{
packet.setCancelled(true);
}
}
info.setCancelled(true);
}
}
}, PacketPlayOutChat.class);