[FREE] Poseidon - Tablist Library (1.8 and Up)

Status
This thread has been locked.

ceezuns

Premium
Feedback score
0
Posts
5
Reactions
2
Resources
0
Hey folks,

Me again! I made a API for modifying the tablist for my personal SMP server, and thought it might be useful for someone else as well!

You can find it here:

https://www.github.com/ceezuns/Poseidon

Here's the README if you want a quick look:

Poseidon
Modifying the tablist made easy!
Requirements
  • Java 8 or Greater
  • ProtocolLib 4.5.0
  • Spigot (1.8 or Greater)
Usage
Main Class
Java:
import org.bukkit.plugin.java.JavaPlugin;

public final class PoseidonPlugin extends JavaPlugin {

    private static PoseidonPlugin instance;
    private Poseidon poseidon;
    private PoseidonTablistTask task;

    @Override
    public void onEnable() {
        instance = this;
        this.poseidon = new Poseidon(this, 10L);
        this.task = new PoseidonTablistTask();
    }

    @Override
    public void onDisable() {
        this.task.cancel();
        this.poseidon = null;
        instance = null;
    }

    public static PoseidonPlugin getInstance() {
        return instance;
    }

    public Poseidon getPoseidon() {
        return poseidon;
    }
}

Updating The Tablist
Java:
import org.bukkit.scheduler.BukkitRunnable;

public final class PoseidonTablistTask extends BukkitRunnable {

    public PoseidonTablistTask() {
        runTaskTimerAsynchronously(Poseidon.getInstance().getPlugin(), 20L, 20L);
    }

    @Override
    public void run() {
        PoseidonPlugin.getInstance().getPoseidon().getTablistManager().getTablists().values().forEach(tablist -> {
            for (int column = 0; column < 4; column++) {
                for (int row = 0; row < 20; row++) {
                    tablist.getSlot(column, row).setText("Slot: " + column + ", " + row);
                }
            }
        });
    }
}

Result
w4SYJVV.png


Contributing
Have a cool feature that you want to add, or a bug fix? Feel free to open a pull request or an issue!

Upcoming Features
  • Support 1.7.10.
  • Add ability to change skins.
  • Make tablist size configurable.
  • Utility method to clear player tablist.
  • Provide default tablist.
  • Javadocs
Authors
  • Anmol Brar (ceezuns)
License
  • MIT
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

emerge

Feedback score
5
Posts
154
Reactions
45
Resources
0
Just wanted to inform you that your text is white and hence, you need to highlight to read the text
 

thesevenq

Premium
Feedback score
1
Posts
82
Reactions
34
Resources
0
Again it look's cool, only thing i would change is the implementation. You should make a Adapter class so we don't need to use tasks.
 
Status
This thread has been locked.
Top