mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 03:55:30 +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
|
||||
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);
|
||||
spawnWaitTicks = 5;
|
||||
}
|
||||
if (!hologram.isSpawned())
|
||||
if (hologram == null || !hologram.isSpawned())
|
||||
return;
|
||||
render0(npc, offset);
|
||||
}
|
||||
@ -837,7 +837,7 @@ public class HologramTrait extends Trait {
|
||||
public static class TabCompletions implements CompletionsProvider {
|
||||
@Override
|
||||
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);
|
||||
return IntStream.range(0, ht.getLines().size()).mapToObj(Integer::toString)
|
||||
.collect(Collectors.toList());
|
||||
|
Loading…
Reference in New Issue
Block a user