mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fix formatting
(cherry picked from commit 4e36073e6e2dc3aeba087d605cef79fc4a8a9779)
This commit is contained in:
parent
b204507a82
commit
bfebbd0095
@ -7,7 +7,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scoreboard.DisplaySlot;
|
import org.bukkit.scoreboard.DisplaySlot;
|
||||||
import org.bukkit.scoreboard.Objective;
|
import org.bukkit.scoreboard.Objective;
|
||||||
@ -81,14 +80,16 @@ public class ScoreboardManager {
|
|||||||
skillLabelBuilder.put(type, colors.get(i) + type.getName());
|
skillLabelBuilder.put(type, colors.get(i) + type.getName());
|
||||||
|
|
||||||
if (type.getAbility() != null) {
|
if (type.getAbility() != null) {
|
||||||
abilityLabelBuilder.put(type.getAbility(),colors.get(i) + type.getAbility().getName());
|
abilityLabelBuilder.put(type.getAbility(), colors.get(i) + type.getAbility().getName());
|
||||||
|
|
||||||
if (type == SkillType.MINING) {
|
if (type == SkillType.MINING) {
|
||||||
abilityLabelBuilder.put(AbilityType.BLAST_MINING, colors.get(i) + AbilityType.BLAST_MINING.getName());
|
abilityLabelBuilder.put(AbilityType.BLAST_MINING, colors.get(i) + AbilityType.BLAST_MINING.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++i == colors.size()) i = 0;
|
if (++i == colors.size()) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -335,7 +336,7 @@ public class ScoreboardManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets or creates the power level objective on the main scoreboard.
|
* Gets or creates the power level objective on the main scoreboard.
|
||||||
* <p>
|
* <p/>
|
||||||
* If power levels are disabled, the objective is deleted and null is
|
* If power levels are disabled, the objective is deleted and null is
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
|
@ -28,7 +28,6 @@ import com.gmail.nossr50.util.scoreboards.ScoreboardManager.SidebarType;
|
|||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
|
|
||||||
public class ScoreboardWrapper {
|
public class ScoreboardWrapper {
|
||||||
|
|
||||||
// Initialization variables
|
// Initialization variables
|
||||||
public final String playerName;
|
public final String playerName;
|
||||||
private final Scoreboard scoreboard;
|
private final Scoreboard scoreboard;
|
||||||
@ -69,6 +68,7 @@ public class ScoreboardWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BukkitTask updateTask = null;
|
public BukkitTask updateTask = null;
|
||||||
|
|
||||||
private class ScoreboardQuickUpdate extends BukkitRunnable {
|
private class ScoreboardQuickUpdate extends BukkitRunnable {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -78,6 +78,7 @@ public class ScoreboardWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BukkitTask revertTask = null;
|
public BukkitTask revertTask = null;
|
||||||
|
|
||||||
private class ScoreboardChangeTask extends BukkitRunnable {
|
private class ScoreboardChangeTask extends BukkitRunnable {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -87,6 +88,7 @@ public class ScoreboardWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BukkitTask cooldownTask = null;
|
public BukkitTask cooldownTask = null;
|
||||||
|
|
||||||
private class ScoreboardCooldownTask extends BukkitRunnable {
|
private class ScoreboardCooldownTask extends BukkitRunnable {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -121,7 +123,8 @@ public class ScoreboardWrapper {
|
|||||||
try {
|
try {
|
||||||
cooldownTask.cancel();
|
cooldownTask.cancel();
|
||||||
}
|
}
|
||||||
catch (Throwable ignored) {}
|
catch (Throwable ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
cooldownTask = null;
|
cooldownTask = null;
|
||||||
}
|
}
|
||||||
@ -381,7 +384,8 @@ public class ScoreboardWrapper {
|
|||||||
try {
|
try {
|
||||||
updateTask.cancel();
|
updateTask.cancel();
|
||||||
}
|
}
|
||||||
catch (Throwable ignored) {} // catch NullPointerException and IllegalStateException and any Error; don't care
|
catch (Throwable ignored) {
|
||||||
|
} // catch NullPointerException and IllegalStateException and any Error; don't care
|
||||||
|
|
||||||
updateTask = null;
|
updateTask = null;
|
||||||
|
|
||||||
@ -493,8 +497,9 @@ public class ScoreboardWrapper {
|
|||||||
for (SkillType skill : SkillType.values()) { // Include child skills, but not in power level
|
for (SkillType skill : SkillType.values()) { // Include child skills, but not in power level
|
||||||
int level = newProfile.getSkillLevel(skill);
|
int level = newProfile.getSkillLevel(skill);
|
||||||
|
|
||||||
if (!skill.isChildSkill())
|
if (!skill.isChildSkill()) {
|
||||||
powerLevel += level;
|
powerLevel += level;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Verify that this is what we want - calculated in power level but not displayed
|
// TODO: Verify that this is what we want - calculated in power level but not displayed
|
||||||
if (!skill.getPermissions(player)) {
|
if (!skill.getPermissions(player)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user