Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.bizarrealex.azazel.tab;
- import net.veilmc.hcf.HCF;
- import net.veilmc.hcf.faction.type.Faction;
- import net.veilmc.hcf.faction.type.PlayerFaction;
- import org.bukkit.entity.Player;
- public class TabExecutor implements TabAdapter {
- public TabTemplate getTemplate(Player player) {
- TabTemplate template = new TabTemplate();
- PlayerFaction playerFaction = HCF.getPlugin().getFactionManager().getPlayerFaction(player);
- Faction faction = HCF.getPlugin().getFactionManager().getPlayerFaction(player);
- double rotation = (player.getLocation().getYaw() - 90) % 360;
- String out;
- if (rotation < 0) {
- rotation += 360.0;
- }
- if (0 <= rotation && rotation < 22.5) {
- out = "N";
- } else if (22.5 <= rotation && rotation < 67.5) {
- out = "NE";
- } else if (67.5 <= rotation && rotation < 112.5) {
- out = "E";
- } else if (112.5 <= rotation && rotation < 157.5) {
- out = "SE";
- } else if (157.5 <= rotation && rotation < 202.5) {
- out = "S";
- } else if (202.5 <= rotation && rotation < 247.5) {
- out = "SW";
- } else if (247.5 <= rotation && rotation < 292.5) {
- out = "W";
- } else if (292.5 <= rotation && rotation < 337.5) {
- out = "NW";
- } else if (337.5 <= rotation && rotation < 360.0) {
- out = "N";
- } else {
- out = null;
- }
- // Left
- template.left(0, "§6Home");
- /*if (playerFaction.getHome() == null || HCF.getInstance().getFactionManager().getPlayerFaction(player) == null){
- template.left(1, "§cNot Set");
- } else {
- template.left(1, "§7" + playerFaction.getHome().getBlockX() + "§7, " + playerFaction.getHome().getBlockZ());
- }
- template.left(3, "§6Faction Info");
- template.left(4, "§7DTR: " + playerFaction.getDtrColour() + JavaUtil.format(playerFaction.getDeathsUntilRaidable()));
- template.left(5, "§7Online: " + playerFaction.getOnlineMembers().size() + "§7/" + playerFaction.getMembers().size());
- template.left(6, " ");
- template.left(7, "§6Player Info");
- template.left(8, "§7Kills: &a" + player.getStatistic(Statistic.PLAYER_KILLS));
- template.left(9, "§7Deaths: §c" + player.getStatistic(Statistic.DEATHS));
- template.left(11, "§6Your Location");
- if (HCF.getInstance().getFactionManager().getFactionAt(player.getLocation()) != null) {
- template.left(12, ChatColor.translateAlternateColorCodes('&', HCF.getInstance().getFactionManager().getFactionAt(player.getLocation()).getName()));
- }
- template.left(13, "§7(" + player.getLocation().getBlockX() + ", " + player.getLocation().getBlockZ() + ")" + " [" + out + "]");
- // Middle
- template.middle(0, "&f&lMine&6Honey.net");
- if (HCF.getInstance().getFactionManager().getPlayerFaction(player) != null){
- if (playerFaction.getLeader().getName() == null) {
- template.middle(2, "&cYou are not in a faction");
- } else {
- }
- }
- template.middle(2, "Leader: " + playerFaction.getLeader().getName());
- template.middle(3, "");*/
- return template;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement