Fix back, migrate config to snbt, implement cooldowns
This commit is contained in:
parent
21c349ef3c
commit
ca869f6d2b
43 changed files with 953 additions and 189 deletions
|
@ -0,0 +1,31 @@
|
|||
package dev.zontreck.essentials.homes;
|
||||
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.suggestion.SuggestionProvider;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.SharedSuggestionProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class HomesSuggestionProvider {
|
||||
public static SuggestionProvider<CommandSourceStack> PROVIDER = (ctx,suggestionsBuilder)->{
|
||||
Homes homes = HomesProvider.getHomesForPlayer(ctx.getSource().getPlayer().getUUID().toString());
|
||||
|
||||
List<String> homesList = new ArrayList<>();
|
||||
|
||||
for(Home home : homes.getList())
|
||||
{
|
||||
homesList.add(home.homeName);
|
||||
}
|
||||
|
||||
|
||||
return SharedSuggestionProvider.suggest((String[]) homesList.toArray(), suggestionsBuilder);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue