mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-01 15:13:26 +01:00
Null check holograms (although they shouldn't be null in this location...)
This commit is contained in:
parent
8571f3e163
commit
ec51df24b5
@ -510,7 +510,7 @@ public class CommandTrait extends Trait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().charAt(0) + name().substring(1).toLowerCase(Locale.US);
|
return name().charAt(0) + name().substring(1).toLowerCase(Locale.ROOT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,7 +786,7 @@ public class HologramTrait extends Trait {
|
|||||||
spawnHologram(npc, offset);
|
spawnHologram(npc, offset);
|
||||||
spawnWaitTicks = 5;
|
spawnWaitTicks = 5;
|
||||||
}
|
}
|
||||||
if (!hologram.isSpawned())
|
if (hologram == null || !hologram.isSpawned())
|
||||||
return;
|
return;
|
||||||
render0(npc, offset);
|
render0(npc, offset);
|
||||||
}
|
}
|
||||||
@ -837,7 +837,7 @@ public class HologramTrait extends Trait {
|
|||||||
public static class TabCompletions implements CompletionsProvider {
|
public static class TabCompletions implements CompletionsProvider {
|
||||||
@Override
|
@Override
|
||||||
public Collection<String> getCompletions(CommandContext args, CommandSender sender, NPC npc) {
|
public Collection<String> getCompletions(CommandContext args, CommandSender sender, NPC npc) {
|
||||||
if (args.length() > 1 && npc != null && LINE_ARGS.contains(args.getString(1).toLowerCase(Locale.US))) {
|
if (args.length() > 1 && npc != null && LINE_ARGS.contains(args.getString(1).toLowerCase(Locale.ROOT))) {
|
||||||
HologramTrait ht = npc.getOrAddTrait(HologramTrait.class);
|
HologramTrait ht = npc.getOrAddTrait(HologramTrait.class);
|
||||||
return IntStream.range(0, ht.getLines().size()).mapToObj(Integer::toString)
|
return IntStream.range(0, ht.getLines().size()).mapToObj(Integer::toString)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
Loading…
Reference in New Issue
Block a user