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

net.minestom.server.command.ServerSender Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.command;

import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.identity.Identity;
import net.minestom.server.command.builder.CommandContext;
import net.minestom.server.permission.Permission;
import net.minestom.server.tag.TagHandler;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Sender used in {@link CommandManager#executeServerCommand(String)}.
 * 

* Although this class implemented {@link CommandSender} and thus {@link Audience}, no * data can be sent to this sender because it's purpose is to process the data of * {@link CommandContext#getReturnData()}. */ public class ServerSender implements CommandSender { private final Set permissions = Collections.unmodifiableSet(new HashSet<>()); private final TagHandler tagHandler = TagHandler.newHandler(); @NotNull @Override public Set getAllPermissions() { return permissions; } @Override public @NotNull TagHandler tagHandler() { return tagHandler; } @Override public @NotNull Identity identity() { return Identity.nil(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy