You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
3.0 KiB
78 lines
3.0 KiB
1 year ago
|
package org.poopki.duckdns.user_db.InfoGUI;
|
||
2 years ago
|
|
||
|
import org.bukkit.Bukkit;
|
||
|
import org.bukkit.ChatColor;
|
||
|
import org.bukkit.entity.Player;
|
||
|
import org.bukkit.scoreboard.*;
|
||
|
import org.poopki.duckdns.user_db.Array.AccountArray;
|
||
|
import org.poopki.duckdns.user_db.Array.FarmArray;
|
||
|
import org.poopki.duckdns.user_db.Array.NationArray;
|
||
|
import org.poopki.duckdns.user_db.Array.SquadArray;
|
||
|
import org.poopki.duckdns.user_db.UserInfoArray;
|
||
|
|
||
|
import java.util.UUID;
|
||
|
|
||
|
public class ScoreboardEvent {
|
||
|
ScoreboardManager manager;
|
||
|
Scoreboard scoreboard;
|
||
|
UUID ZERO_UUID = new UUID(0,0);
|
||
|
private UserInfoArray m_InfoArrayInstance;
|
||
|
private AccountArray m_AccountArray;
|
||
|
private FarmArray m_FarmArray;
|
||
|
private NationArray m_NationArray;
|
||
|
private SquadArray m_SquadArray;
|
||
|
public ScoreboardEvent(UserInfoArray m_UIA, FarmArray FA, NationArray NA, SquadArray SA, AccountArray AA){
|
||
|
m_InfoArrayInstance = m_UIA;
|
||
|
m_AccountArray = AA;
|
||
|
m_FarmArray = FA;
|
||
|
m_NationArray = NA;
|
||
|
m_SquadArray = SA;
|
||
|
}
|
||
|
public void ScoreboardUpdate(Player player){
|
||
|
|
||
|
manager = Bukkit.getScoreboardManager();
|
||
|
scoreboard = manager.getNewScoreboard();
|
||
|
|
||
1 year ago
|
Objective score_obj = scoreboard.registerNewObjective("Scoreboard","dummy");
|
||
2 years ago
|
score_obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||
|
|
||
|
Score score = score_obj.getScore(ChatColor.BLUE + "==-=-=-=-=-=-==");
|
||
|
score.setScore(15);
|
||
|
|
||
|
Score score1 = score_obj.getScore("계좌 잔액: "+m_AccountArray.getAccountInfo(player.getUniqueId())+"원");
|
||
|
score1.setScore(14);
|
||
|
|
||
|
Score score3 = score_obj.getScore(ChatColor.BLUE + "==-=-=-=-=-=-==");
|
||
|
score3.setScore(15);
|
||
|
|
||
|
if(ZERO_UUID.equals(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Farm"))) {
|
||
|
Score score4 = score_obj.getScore("농장 이름: ----");
|
||
|
score4.setScore(14);
|
||
|
}
|
||
|
else{
|
||
|
Score score4 = score_obj.getScore("농장 이름: " + m_FarmArray.GetGroupName(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Farm")));
|
||
|
score4.setScore(14);
|
||
|
}
|
||
|
|
||
|
if(ZERO_UUID.equals(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Nation"))) {
|
||
|
Score score5 = score_obj.getScore("국가 이름: ----");
|
||
|
score5.setScore(13);
|
||
|
}
|
||
|
else{
|
||
|
Score score5 = score_obj.getScore("국가 이름: "+m_NationArray.GetGroupName(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Nation")));
|
||
|
score5.setScore(13);
|
||
|
}
|
||
|
|
||
|
if(ZERO_UUID.equals(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Squad"))) {
|
||
|
Score score6 = score_obj.getScore("분대 이름: ----");
|
||
|
score6.setScore(12);
|
||
|
}
|
||
|
else{
|
||
|
Score score6 = score_obj.getScore("분대 이름: "+m_SquadArray.GetGroupName(m_InfoArrayInstance.getUserGroupUUID(player.getUniqueId(), "Squad")));
|
||
|
score6.setScore(12);
|
||
|
}
|
||
|
|
||
|
player.setScoreboard(scoreboard);
|
||
|
}
|
||
|
}
|