Skip to content

Tablist API for 1.7x-1.8x Spigot servers

Notifications You must be signed in to change notification settings

hardcorefactions/Edge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edge

An open-sourced Tablist API primarily made for 1.7x-1.8x Spigot servers. (This API can produce errors, please report them to me if you encounter any)


Importing with Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
    
<dependencies>
    <dependency> <!-- Edge -->
	    <groupId>com.github.Lucaniuss</groupId>
	    <artifactId>Edge</artifactId>
	    <version>-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

How to use & implement

/**
 * Implement the TabAdapter interface
 */
public class TabLayout implements TabAdapter {
    
    private final ExamplePlugin plugin = ExamplePlugin.getInstance();

    /**
     * Return your desired tab header
     */
    @Override
    public List<String> getHeader(Player player) {
        return Arrays.asList(" ", CC.BLUE + CC.BOLD + "Edge", " ");
    }

    /**
     * Return your desired tab footer
     */
    @Override
    public List<String> getFooter(Player player) {
        return Arrays.asList(" ", CC.GRAY + CC.ITALIC + "lucanius.me", " ");
    }

    /**
     * Return your desired tab entries by creating a Set of TabData
     *
     * new TabData(TabColumn column, int slot, String text, int latency, Skin skin)
     */
    @Override
    public Set<TabData> getEntries(Player player) {
        Set<TabData> entries = new HashSet<>();

        entries.add(new TabData(TabColumn.MIDDLE, 1, CC.BLUE + CC.BOLD + "Edge"));
        entries.add(new TabData(TabColumn.MIDDLE, 2, CC.GRAY + CC.ITALIC + "lucanius.me"));

        entries.add(new TabData(TabColumn.LEFT, 4, "Left"));
        entries.add(new TabData(TabColumn.MIDDLE, 4, "Center"));
        entries.add(new TabData(TabColumn.RIGHT, 4, "Right"));
        entries.add(new TabData(TabColumn.FAR_RIGHT, 4, "Far Right"));

        entries.add(new TabData(TabColumn.MIDDLE, 19, "Your Skin", plugin.getEdge().getSkin(player.getUniqueId())));

        return entries;
    }
}
public class ExamplePlugin extends JavaPlugin {
    
    private static ExamplePlugin instance;
    
    private Edge edge;

    /**
     * new Edge(Plugin plugin, TabAdapter adapter)
     */
    @Override
    public void onEnable() {
        instance = this;
        
        this.edge = new Edge(this, new TabLayout());
    }

    @Override
    public void onDisable() {
        this.edge.getService().destroy();
    }
    
    public static ExamplePlugin getInstance() {
        return instance;
    }

    public Edge getEdge() {
        return this.edge;
    }
}

Contact

You can contact me on discord via my tag or server:

Selling & Using

You're free to use this for anything, including using it for your own projects. However, if you want to sell it, leave credits and a link to this repository.

About

Tablist API for 1.7x-1.8x Spigot servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%