✨ Tablist API ✨Library (1.7.x - 1.8.x)

Status
This thread has been locked.

norxir

Feedback score
0
Posts
18
Reactions
10
Resources
0
Requirements
  • Java 8 or Greater
  • Spigot (1.7.x - 1.8.x)
Features
  • Support for 1.7.x - 1.8.x
  • Ability to change fake ping and head texture
  • Constantly updated 0.2 seconds
  • Header and Footer multiples lines
Upcoming Features
  • Support 1.9.x - 1.16.x
Authors
  • CesarsDev
Screenshots
fd1cbf262e3aea868aa165332327549b.png


9632928c502460b9c007cedc32bcb246.png


7efae795d2f975c78727df2de5f5f206.png


e2e85ccdcd71a8a469de086bd6534e74.png

Usage
Code:
package ga.gamely.tab.example;

import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

import org.bukkit.entity.Player;

import com.google.common.collect.Lists;

import ga.gamely.tab.api.TabAdapter;
import ga.gamely.tab.api.TabColumn;
import ga.gamely.tab.api.TabEntry;

public class TabExampleAdapter implements TabAdapter {

    @Override
    public List<String> getHeader(Player player) {
        return Lists.newArrayList("", "Random -> " + ThreadLocalRandom.current().nextInt(1000), "");
    }

    @Override
    public List<String> getFooter(Player player) {
        return Lists.newArrayList("", "Random -> " + ThreadLocalRandom.current().nextInt(1000), "");
    }

    @Override
    public List<TabEntry> getEntries(Player player) {
        List<TabEntry> entries = Lists.newArrayList();

        for (int x = 0; x < 20; x++) {
            entries.add(new TabEntry(TabColumn.LEFT, x, "(X) " + x + " (Y) " + 0));
            entries.add(new TabEntry(TabColumn.MIDDLE, x, "(X) " + x + " (Y) " + 1));
            entries.add(new TabEntry(TabColumn.RIGHT, x, "(X) " + x + " (Y) " + 2));
            entries.add(new TabEntry(TabColumn.FAR_RIGHT, x, "(X) " + x + " (Y) " + 3));
        }
      
        return entries;
    }

}

Proof of Ownership
Code:
package ga.gamely.tab;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import com.google.common.collect.Maps;

import ga.gamely.tab.api.TabAdapter;
import ga.gamely.tab.nms.TabNMS;
import lombok.Getter;

@Getter
public class Tab {

    public static Optional<Tab> instance;

    private Map<UUID, TabPlayer> layouts = Maps.newHashMap();

    private TabNMS tabNMS;
    private TabAdapter tabAdapter;
    private TabUpdater tabUpdater;
  
    public Tab(JavaPlugin plugin, TabAdapter tabAdapter) {
        instance = Optional.of(this);
        this.tabAdapter = tabAdapter;
      
        Class<?> tabNMS;
        try {
            tabNMS = Class.forName("ga.gamely.tab.nms." + getNmsVersion() + ".Tab_" + getNmsVersion());
        } catch (ClassNotFoundException e) {
            tabNMS = null;
        }

        if (tabNMS == null) {
            Bukkit.getLogger().warning("Unsupported tablist");
            return;
        }

        try {
            this.tabNMS = (TabNMS) tabNMS.getConstructors()[0].newInstance();
        } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
                | SecurityException e1) {
            Bukkit.getLogger().warning("Failed to initialize tabNMS");
            e1.printStackTrace();
        }
      
        tabUpdater = new TabUpdater(this);
        plugin.getServer().getPluginManager().registerEvents(new TabListener(this), plugin);
  
    }

    public String getNmsVersion() {
        return (Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]);
    }

    public static Tab getInstance() {
        return (instance.orElseThrow(() -> new IllegalStateException("Tab instance is null")));
    }
}

Pricing
  • SRC ($35 USD) with updates
  • Resell rights ($47 USD)
Contact
Discord: CesarDev#6064
Twitter: @cesardev7
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.
Status
This thread has been locked.
Top