mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 04:26:42 +00:00
Fix //expand, improve //help
This commit is contained in:
@ -27,6 +27,8 @@ import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import org.enginehub.piston.Command;
|
||||
import org.enginehub.piston.exception.CommandException;
|
||||
import org.enginehub.piston.inject.InjectedValueAccess;
|
||||
import org.enginehub.piston.inject.Key;
|
||||
import org.enginehub.piston.part.SubCommandPart;
|
||||
|
||||
import java.util.Comparator;
|
||||
@ -120,6 +122,12 @@ public class CommandUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T requireIV(Key<T> type, String name, InjectedValueAccess injectedValueAccess) {
|
||||
return injectedValueAccess.injectedValue(type).orElseThrow(() ->
|
||||
new IllegalStateException("No injected value for " + name + " (type " + type + ")")
|
||||
);
|
||||
}
|
||||
|
||||
private CommandUtil() {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user