net.forthecrown.grenadier.annotations.compiler.ContextFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grenadier-annotations Show documentation
Show all versions of grenadier-annotations Show documentation
Annotation-based command support for Grenadier
package net.forthecrown.grenadier.annotations.compiler;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import net.forthecrown.grenadier.CommandSource;
import net.forthecrown.grenadier.annotations.ArgumentModifier;
import net.forthecrown.grenadier.annotations.util.ExpandedCommandContext;
@RequiredArgsConstructor
class ContextFactory {
final Map>> modifierMap;
public ExpandedCommandContext create(CommandContext context)
throws CommandSyntaxException
{
ExpandedCommandContext result = new ExpandedCommandContext(context);
result.applyAll(modifierMap);
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy