Skip to content

Commit

Permalink
Null check holograms (although they shouldn't be null in this locatio…
Browse files Browse the repository at this point in the history
…n...)
  • Loading branch information
fullwall committed Jul 10, 2024
1 parent 8571f3e commit ec51df2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public enum ExecutionMode {

@Override
public String toString() {
return name().charAt(0) + name().substring(1).toLowerCase(Locale.US);
return name().charAt(0) + name().substring(1).toLowerCase(Locale.ROOT);
}
}

Expand Down
4 changes: 2 additions & 2 deletions main/src/main/java/net/citizensnpcs/trait/HologramTrait.java
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public void render(NPC npc, Vector3d offset) {
spawnHologram(npc, offset);
spawnWaitTicks = 5;
}
if (!hologram.isSpawned())
if (hologram == null || !hologram.isSpawned())
return;
render0(npc, offset);
}
Expand Down Expand Up @@ -837,7 +837,7 @@ public void updateText(NPC npc, String raw) {
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());
Expand Down

0 comments on commit ec51df2

Please sign in to comment.