Trying to make header and border for TAB menu. Halp!

Discussion in 'Spigot Plugin Development' started by radu, May 18, 2015.

  1. I'm trying to make header and border for a TAB menu but i got stuck. It says that org.spigotmc.ProtocolInjector canno't be resolved and i have a weird error at line 32.
    package plugin.tab.Menu;

    import net.minecraft.server.v1_8_R2.IChatBaseComponent;
    import net.minecraft.server.v1_8_R2.IChatBaseComponent.ChatSerializer;
    import net.minecraft.server.v1_8_R2.PlayerConnection;

    import org.bukkit.Bukkit;
    import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.spigotmc.ProtocolInjector;

    public class TabMenuTut extends JavaPlugin implements Listener{

    public void onEnable(){
    Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onPlayerConnect(playerJoinEvent e) {
    Player p = e.getPlayer();
    }

    PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
    IChatBaseComponent top = ChatSerializer
    .a("{'extra': [{text: 'Laleagane', color: 'red', bold 'true'}],'color': 'yellow', 'bold': 'true', 'text': 'Minecraft'}");
    IChatBaseComponent bottom = ChatSerializer
    .a("{'extra': [{'color': 'aqua', 'text': 'mc.laleagane.ro', 'underlined': 'true'}], 'color': 'orange', 'text': 'Va ureaza distarctie placuta' }");

    connection.sendPacket(new ProtocolInjector().PacketTabHeader(top,bottom));
    }
     
  2. Only one error. With org.spigotmc.ProtocolInjector
     
  3. The ProtocolInjector is found in the protocol hack, not in 1.8. The packet class is net.minecraft.server.<version>.PacketPlayOutPlayerListHeaderFooter.