Null check /npc bossbar
This commit is contained in:
parent
25f341ef63
commit
19c07ff1f5
|
@ -40,11 +40,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -42,11 +42,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -44,11 +44,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -48,11 +48,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -61,11 +61,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -100,11 +100,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -100,11 +100,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
|
@ -136,11 +136,15 @@ public class Commands {
|
|||
BossBarTrait trait = npc.getOrAddTrait(BossBarTrait.class);
|
||||
if (args.hasValueFlag("style")) {
|
||||
BarStyle style = Util.matchEnum(BarStyle.values(), args.getFlag("style"));
|
||||
trait.setStyle(style);
|
||||
if (style != null) {
|
||||
trait.setStyle(style);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("color")) {
|
||||
BarColor color = Util.matchEnum(BarColor.values(), args.getFlag("color"));
|
||||
trait.setColor(color);
|
||||
if (color != null) {
|
||||
trait.setColor(color);
|
||||
}
|
||||
}
|
||||
if (args.hasValueFlag("title")) {
|
||||
trait.setTitle(Colorizer.parseColors(args.getFlag("title")));
|
||||
|
|
Loading…
Reference in New Issue