All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.forthecrown.grenadier.annotations.compiler.ContextFactory Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
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