Plex-FAWE/worldedit-core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
540 B
Java
Raw Normal View History

package com.sk89q.worldedit.command;
2019-07-21 11:39:36 +00:00
import com.sk89q.worldedit.command.argument.Arguments;
import org.enginehub.piston.inject.InjectedValueAccess;
2019-07-21 11:39:36 +00:00
import org.enginehub.piston.inject.Key;
2020-07-14 02:50:59 +00:00
import java.util.Optional;
public class MethodCommands {
2019-07-22 20:58:18 +00:00
public static String getArguments(InjectedValueAccess context) {
if (context == null) {
return null;
}
2019-07-21 11:39:36 +00:00
Optional<Arguments> arguments = context.injectedValue(Key.of(Arguments.class));
return arguments.map(Arguments::get).orElse(null);
}
}