mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Update Piston to fix bugs
Closes #1292 via Piston fixes. (cherry picked from commit dc56b602c0367fbd24f954de2b8be4e864add59f)
This commit is contained in:
@ -111,7 +111,7 @@ public abstract class AbstractDirectionConverter<D> implements ArgumentConverter
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(String input) {
|
||||
public List<String> getSuggestions(String input, InjectedValueAccess context) {
|
||||
return limitByPrefix(suggestions.stream(), input);
|
||||
}
|
||||
|
||||
|
@ -70,9 +70,10 @@ public class CommaSeparatedValuesConverter<T> implements ArgumentConverter<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(String input) {
|
||||
public List<String> getSuggestions(String input, InjectedValueAccess context) {
|
||||
String lastInput = Iterables.getLast(COMMA.split(input), "");
|
||||
return delegate.getSuggestions(lastInput);
|
||||
assert lastInput != null;
|
||||
return delegate.getSuggestions(lastInput, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +55,7 @@ public class EntityRemoverConverter implements ArgumentConverter<EntityRemover>
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(String input) {
|
||||
public List<String> getSuggestions(String input, InjectedValueAccess context) {
|
||||
return limitByPrefix(suggestions.stream(), input);
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class FactoryConverter<T> implements ArgumentConverter<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(String input) {
|
||||
public List<String> getSuggestions(String input, InjectedValueAccess context) {
|
||||
return factoryExtractor.apply(worldEdit).getSuggestions(input);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,8 @@ public final class RegistryConverter<V extends Keyed> implements ArgumentConvert
|
||||
: SuccessfulConversion.fromSingle(result);
|
||||
}
|
||||
|
||||
public List<String> getSuggestions(String input) {
|
||||
@Override
|
||||
public List<String> getSuggestions(String input, InjectedValueAccess context) {
|
||||
return SuggestionHelper.getRegistrySuggestions(registry, input).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class WorldConverter implements ArgumentConverter<World> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(String input) {
|
||||
public List<String> getSuggestions(String input, InjectedValueAccess context) {
|
||||
return getWorlds()
|
||||
.map(World::getId)
|
||||
.filter(world -> world.startsWith(input))
|
||||
|
Reference in New Issue
Block a user