Skip to content
This repository was archived by the owner on Jul 25, 2019. It is now read-only.

Commit

Permalink
Dont tab complete biomes in the wrong argument slots
Browse files Browse the repository at this point in the history
  • Loading branch information
VXLBot committed Apr 29, 2018
1 parent 8c5b6ac commit ac0bfbb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/java/prospector/traverse/commands/CommandFindBiome.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CommandFindBiome extends CommandBase {
Expand Down Expand Up @@ -74,13 +75,17 @@ public String getUsage(ICommandSender sender) {

@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos targetPos) {
List<String> strings = new ArrayList<>();
for (Biome b : ForgeRegistries.BIOMES.getValues()) {
String s = b.getRegistryName().toString();
if (s.toLowerCase().contains(args[0].toLowerCase()))
strings.add(s);
if(args.length==1) {
List<String> strings = new ArrayList<>();
for (Biome b : ForgeRegistries.BIOMES.getValues()) {
String s = b.getRegistryName().toString();
if (s.toLowerCase().contains(args[0].toLowerCase()))
strings.add(s);
}

return strings;
}
return strings;
return Collections.emptyList();
}

@Override
Expand Down

0 comments on commit ac0bfbb

Please sign in to comment.