Code Monkey home page Code Monkey logo

edge's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.