Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how does it work? #3

Open
necomadev opened this issue Oct 22, 2021 · 1 comment
Open

how does it work? #3

necomadev opened this issue Oct 22, 2021 · 1 comment

Comments

@necomadev
Copy link

I know someone already asked but it hasn't been explained yet so I thought I'd ask again :D

@Enoughsdv
Copy link

Enoughsdv commented Oct 26, 2021

Hello, it is really very easy to use.
Code Example:

import org.bukkit.entity.Player;

import io.github.thatkawaiisam.utils.MessageUtil;
import io.github.thatkawaiisam.nametags.OstentusAdapter;
import io.github.thatkawaiisam.nametags.BufferedNametag;

import java.util.List;
import java.util.ArrayList;

public class NametagAdapter implements OstentusAdapter {
    
    @Override
    public List<BufferedNametag> getPlate(Player player) {
        List<BufferedNametag> list = new ArrayList<>();
        BufferedNametag bufferedNametag = new BufferedNametag("tagGroup",
                MessageUtil.translate("&7Prefix "),
                MessageUtil.translate(" &eSuffix"), true, player);
        
        list.add(bufferedNametag);
        
        return list;
    }

    @Override
    public boolean showHealthBelowName(Player player) {
        return true;
    }

}

// And you register the adapter in your main class:
new Ostentus(this, new NametagAdapter());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants