vanish error fixes
This commit is contained in:
parent
69091c079f
commit
af8f0fff16
@ -17,7 +17,6 @@ import mineplex.core.vanish.commands.VanishCommand;
|
|||||||
import mineplex.core.vanish.events.PreVanishEvent;
|
import mineplex.core.vanish.events.PreVanishEvent;
|
||||||
import mineplex.core.vanish.repository.VanishClient;
|
import mineplex.core.vanish.repository.VanishClient;
|
||||||
import mineplex.core.vanish.repository.VanishRepository;
|
import mineplex.core.vanish.repository.VanishRepository;
|
||||||
import mineplex.game.clans.tutorials.Tutorial;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
|
||||||
|
|
||||||
@ -36,28 +35,20 @@ public class Vanish extends MiniClientPlugin<VanishClient>
|
|||||||
packetHandler.addPacketHandler(info -> {
|
packetHandler.addPacketHandler(info -> {
|
||||||
PacketPlayOutChat packet = (PacketPlayOutChat) info.getPacket();
|
PacketPlayOutChat packet = (PacketPlayOutChat) info.getPacket();
|
||||||
|
|
||||||
if (packet.getPacket() instanceof PacketPlayOutChat)
|
if (packet.b == 1)
|
||||||
{
|
{
|
||||||
PacketPlayOutChat chat = (PacketPlayOutChat) packet.getPacket();
|
if (packet.a.a().isEmpty())
|
||||||
|
|
||||||
if (chat.b == 1)
|
|
||||||
{
|
|
||||||
if (chat.a.a().isEmpty())
|
|
||||||
{
|
{
|
||||||
return;
|
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()))
|
info.setCancelled(true);
|
||||||
{
|
|
||||||
packet.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, PacketPlayOutChat.class);
|
}, PacketPlayOutChat.class);
|
||||||
|
Loading…
Reference in New Issue
Block a user