Search in sources :

Example 26 with PluginContainer

use of org.spongepowered.api.plugin.PluginContainer in project LanternServer by LanternPowered.

the class LanternKey method registerEvent.

@Override
public <E extends DataHolder> void registerEvent(Class<E> holderFilter, EventListener<ChangeDataHolderEvent.ValueChange> listener) {
    checkNotNull(holderFilter, "holderFilter");
    checkNotNull(listener, "listener");
    final KeyEventListener keyEventListener = new KeyEventListener(listener, holderFilter::isInstance, this);
    final PluginContainer plugin = CauseStack.current().first(PluginContainer.class).get();
    final RegisteredListener<ChangeDataHolderEvent.ValueChange> registeredListener = Lantern.getGame().getEventManager().register(plugin, valueChangeEventTypeToken, Order.DEFAULT, keyEventListener);
    this.listeners.add(registeredListener);
}
Also used : PluginContainer(org.spongepowered.api.plugin.PluginContainer)

Example 27 with PluginContainer

use of org.spongepowered.api.plugin.PluginContainer in project LanternServer by LanternPowered.

the class GeneratorTypeRegistryModule method postInit.

/**
 * Post initialize the {@link GeneratorType}s. All the default world generators
 * here be selected by scanning for 'default-world-gen.json' files.
 */
@CustomCatalogRegistration
@DelayedRegistration(RegistrationPhase.POST_INIT)
public void postInit() {
    final Multimap<String, DefaultEntry> entries = HashMultimap.create();
    final Gson gson = new Gson();
    // Scan every plugin
    for (PluginContainer pluginContainer : Sponge.getPluginManager().getPlugins()) {
        final Optional<Asset> optAsset = pluginContainer.getAsset("default-world-gen.json");
        if (optAsset.isPresent()) {
            try {
                final InputStream is = optAsset.get().getUrl().openStream();
                try (BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
                    final JsonObject json = gson.fromJson(reader, JsonObject.class);
                    for (Map.Entry<String, JsonElement> entry : json.entrySet()) {
                        entries.put(entry.getKey(), new DefaultEntry(pluginContainer, entry.getValue().getAsString()));
                    }
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    for (Map.Entry<String, Collection<DefaultEntry>> entry : entries.asMap().entrySet()) {
        final String id = entry.getKey();
        if (!getById(id).map(type -> type instanceof DelegateGeneratorType).orElse(false)) {
            Lantern.getLogger().warn("The plugin(s) ({}) attempted to map an unknown id: {}", Arrays.toString(entry.getValue().stream().map(e -> e.pluginContainer.getId()).toArray()), id);
            continue;
        }
        final List<DefaultEntry> possibleEntries = new ArrayList<>();
        for (DefaultEntry entry1 : entry.getValue()) {
            final Optional<GeneratorType> generatorType = getById(entry1.type);
            if (generatorType.isPresent()) {
                possibleEntries.add(entry1);
            } else {
                Lantern.getLogger().warn("The plugin {} attempted to map a missing generator type {} for {}", entry1.pluginContainer.getId(), entry1.type, id);
            }
        }
        if (!possibleEntries.isEmpty()) {
            final DefaultEntry defaultEntry = possibleEntries.get(0);
            if (possibleEntries.size() > 1) {
                Lantern.getLogger().warn("Multiple plugins are mapping {}: {}", id, Arrays.toString(entry.getValue().stream().map(e -> "\n" + e.pluginContainer.getId() + ": " + e.type).toArray()));
                Lantern.getLogger().warn("The first one will be used.");
            }
            ((DelegateGeneratorType) getById(id).get()).setGeneratorType(getById(defaultEntry.type).get());
            Lantern.getLogger().warn("Successfully registered a generator type mapping: {} from {} for {}", defaultEntry.type, defaultEntry.pluginContainer.getId(), id);
        }
    }
}
Also used : JsonObject(com.google.gson.JsonObject) Arrays(java.util.Arrays) FlatTheEndGeneratorType(org.lanternpowered.server.world.gen.flat.FlatTheEndGeneratorType) Multimap(com.google.common.collect.Multimap) ArrayList(java.util.ArrayList) JsonElement(com.google.gson.JsonElement) HashMultimap(com.google.common.collect.HashMultimap) FlatOverworldGeneratorType(org.lanternpowered.server.world.gen.flat.FlatOverworldGeneratorType) CustomCatalogRegistration(org.spongepowered.api.registry.util.CustomCatalogRegistration) TheVoidGeneratorType(org.lanternpowered.server.world.gen.thevoid.TheVoidGeneratorType) Gson(com.google.gson.Gson) Map(java.util.Map) BlockRegistryModule(org.lanternpowered.server.game.registry.type.block.BlockRegistryModule) RegistrationDependency(org.spongepowered.api.registry.util.RegistrationDependency) PluginContainer(org.spongepowered.api.plugin.PluginContainer) FlatNetherGeneratorType(org.lanternpowered.server.world.gen.flat.FlatNetherGeneratorType) GeneratorTypes(org.spongepowered.api.world.GeneratorTypes) DebugGeneratorType(org.lanternpowered.server.world.gen.debug.DebugGeneratorType) GeneratorType(org.spongepowered.api.world.GeneratorType) Collection(java.util.Collection) RegistrationPhase(org.spongepowered.api.registry.RegistrationPhase) Sponge(org.spongepowered.api.Sponge) IOException(java.io.IOException) InputStreamReader(java.io.InputStreamReader) DelegateGeneratorType(org.lanternpowered.server.world.gen.DelegateGeneratorType) List(java.util.List) DelayedRegistration(org.spongepowered.api.registry.util.DelayedRegistration) Lantern(org.lanternpowered.server.game.Lantern) BlockStateRegistryModule(org.lanternpowered.server.game.registry.type.block.BlockStateRegistryModule) Optional(java.util.Optional) BufferedReader(java.io.BufferedReader) AdditionalPluginCatalogRegistryModule(org.lanternpowered.server.game.registry.AdditionalPluginCatalogRegistryModule) Asset(org.spongepowered.api.asset.Asset) InputStream(java.io.InputStream) PluginContainer(org.spongepowered.api.plugin.PluginContainer) InputStreamReader(java.io.InputStreamReader) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) Gson(com.google.gson.Gson) JsonObject(com.google.gson.JsonObject) IOException(java.io.IOException) FlatTheEndGeneratorType(org.lanternpowered.server.world.gen.flat.FlatTheEndGeneratorType) FlatOverworldGeneratorType(org.lanternpowered.server.world.gen.flat.FlatOverworldGeneratorType) TheVoidGeneratorType(org.lanternpowered.server.world.gen.thevoid.TheVoidGeneratorType) FlatNetherGeneratorType(org.lanternpowered.server.world.gen.flat.FlatNetherGeneratorType) DebugGeneratorType(org.lanternpowered.server.world.gen.debug.DebugGeneratorType) GeneratorType(org.spongepowered.api.world.GeneratorType) DelegateGeneratorType(org.lanternpowered.server.world.gen.DelegateGeneratorType) JsonElement(com.google.gson.JsonElement) BufferedReader(java.io.BufferedReader) Asset(org.spongepowered.api.asset.Asset) Collection(java.util.Collection) Map(java.util.Map) DelegateGeneratorType(org.lanternpowered.server.world.gen.DelegateGeneratorType) CustomCatalogRegistration(org.spongepowered.api.registry.util.CustomCatalogRegistration) DelayedRegistration(org.spongepowered.api.registry.util.DelayedRegistration)

Example 28 with PluginContainer

use of org.spongepowered.api.plugin.PluginContainer in project LanternServer by LanternPowered.

the class QueryHandler method handleFullStats.

private void handleFullStats(ChannelHandlerContext ctx, DatagramPacket packet, int sessionId) {
    final LanternGame game = this.queryServer.getGame();
    final LanternServer server = game.getServer();
    final Platform platform = game.getPlatform();
    final PluginContainer api = platform.getContainer(Platform.Component.API);
    final PluginContainer impl = platform.getContainer(Platform.Component.IMPLEMENTATION);
    final PluginContainer mc = platform.getContainer(Platform.Component.GAME);
    final StringBuilder plugins = new StringBuilder().append(impl.getName()).append(" ").append(impl.getVersion()).append(" on ").append(api.getName()).append(" ").append(api.getVersion());
    if (this.showPlugins) {
        final List<PluginContainer> containers = new ArrayList<>(game.getPluginManager().getPlugins());
        containers.remove(api);
        containers.remove(impl);
        containers.remove(mc);
        char delim = ':';
        for (PluginContainer plugin : containers) {
            plugins.append(delim).append(' ').append(plugin.getName());
            delim = ';';
        }
    }
    final List<String> playerNames = server.getOnlinePlayers().stream().map(CommandSource::getName).collect(Collectors.toList());
    final Cause cause = Cause.of(EventContext.empty(), new SimpleRemoteConnection((InetSocketAddress) ctx.channel().remoteAddress(), null));
    final QueryServerEvent.Full event = SpongeEventFactory.createQueryServerEventFull(cause, (InetSocketAddress) ctx.channel().localAddress(), new HashMap<>(), "MINECRAFT", "SMP", getWorldName(), server.getMotd().toPlain(), playerNames, plugins.toString(), mc.getVersion().orElse("unknown"), server.getMaxPlayers(), Integer.MAX_VALUE, playerNames.size(), 0);
    final InetSocketAddress address = event.getAddress();
    final Map<String, Object> data = new LinkedHashMap<>();
    data.put("hostname", event.getMotd());
    data.put("gametype", event.getGameType());
    data.put("game_id", event.getGameId());
    data.put("version", event.getVersion());
    data.put("plugins", event.getPlugins());
    data.put("map", event.getMap());
    data.put("numplayers", event.getPlayerCount());
    data.put("maxplayers", event.getMaxPlayerCount());
    data.put("hostport", address.getPort());
    data.put("hostip", address.getHostString());
    event.getCustomValuesMap().entrySet().stream().filter(entry -> !data.containsKey(entry.getKey())).forEach(entry -> data.put(entry.getKey(), entry.getValue()));
    final ByteBuf buf = ctx.alloc().buffer();
    buf.writeByte(ACTION_STATS);
    buf.writeInt(sessionId);
    // constant: splitnum\x00\x80\x00
    buf.writeBytes(new byte[] { 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 });
    for (Entry<String, Object> e : data.entrySet()) {
        writeString(buf, e.getKey());
        writeString(buf, String.valueOf(e.getValue()));
    }
    buf.writeByte(0);
    // constant: \x01player_\x00\x00
    buf.writeBytes(new byte[] { 0x01, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x72, 0x5F, 0x00, 0x00 });
    for (Player player : game.getServer().getOnlinePlayers()) {
        writeString(buf, player.getName());
    }
    buf.writeByte(0);
    ctx.write(new DatagramPacket(buf, packet.sender()));
}
Also used : HashMap(java.util.HashMap) Platform(org.spongepowered.api.Platform) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ByteBuf(io.netty.buffer.ByteBuf) Map(java.util.Map) DatagramPacket(io.netty.channel.socket.DatagramPacket) PluginContainer(org.spongepowered.api.plugin.PluginContainer) SimpleRemoteConnection(org.lanternpowered.server.network.SimpleRemoteConnection) LanternServer(org.lanternpowered.server.LanternServer) CommandSource(org.spongepowered.api.command.CommandSource) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) Collection(java.util.Collection) Sponge(org.spongepowered.api.Sponge) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) LanternGame(org.lanternpowered.server.game.LanternGame) StandardCharsets(java.nio.charset.StandardCharsets) Cause(org.spongepowered.api.event.cause.Cause) List(java.util.List) QueryServerEvent(org.spongepowered.api.event.server.query.QueryServerEvent) SimpleChannelInboundHandler(io.netty.channel.SimpleChannelInboundHandler) World(org.spongepowered.api.world.World) Entry(java.util.Map.Entry) Player(org.spongepowered.api.entity.living.player.Player) EventContext(org.spongepowered.api.event.cause.EventContext) Player(org.spongepowered.api.entity.living.player.Player) PluginContainer(org.spongepowered.api.plugin.PluginContainer) Platform(org.spongepowered.api.Platform) SimpleRemoteConnection(org.lanternpowered.server.network.SimpleRemoteConnection) InetSocketAddress(java.net.InetSocketAddress) ArrayList(java.util.ArrayList) QueryServerEvent(org.spongepowered.api.event.server.query.QueryServerEvent) ByteBuf(io.netty.buffer.ByteBuf) LanternGame(org.lanternpowered.server.game.LanternGame) LinkedHashMap(java.util.LinkedHashMap) LanternServer(org.lanternpowered.server.LanternServer) Cause(org.spongepowered.api.event.cause.Cause) DatagramPacket(io.netty.channel.socket.DatagramPacket)

Example 29 with PluginContainer

use of org.spongepowered.api.plugin.PluginContainer in project LanternServer by LanternPowered.

the class CommandHelp method completeSpec.

@Override
public void completeSpec(PluginContainer pluginContainer, CommandSpec.Builder specBuilder) {
    final Comparator<CommandMapping> comparator = Comparator.comparing(CommandMapping::getPrimaryAlias);
    specBuilder.arguments(GenericArguments.optional(new CommandElement(Text.of("command")) {

        @Nullable
        @Override
        protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException {
            return args.next();
        }

        @Override
        public List<String> complete(CommandSource src, CommandArgs args, CommandContext context) {
            final String nextArg = args.nextIfPresent().orElse("");
            return Lantern.getGame().getCommandManager().getAliases().stream().filter(new StartsWithPredicate(nextArg)).collect(Collectors.toList());
        }
    })).description(Text.of("View a list of all commands")).extendedDescription(Text.of("View a list of all commands. Hover over\n" + " a command to view its description. Click\n" + " a command to insert it into your chat bar.")).executor((src, args) -> {
        Optional<String> command = args.getOne("command");
        if (command.isPresent()) {
            Optional<? extends CommandMapping> mapping = Sponge.getCommandManager().get(command.get());
            if (mapping.isPresent()) {
                CommandCallable callable = mapping.get().getCallable();
                Optional<? extends Text> desc;
                // command name in the usage message
                if (callable instanceof CommandSpec) {
                    Text.Builder builder = Text.builder();
                    callable.getShortDescription(src).ifPresent(des -> builder.append(des, Text.NEW_LINE));
                    builder.append(t("commands.generic.usage", t("/%s %s", command.get(), callable.getUsage(src))));
                    Text extendedDescription;
                    try {
                        // TODO: Why is there no method :(
                        extendedDescription = (Text) extendedDescriptionField.get(callable);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }
                    if (extendedDescription != null) {
                        builder.append(Text.NEW_LINE, extendedDescription);
                    }
                    src.sendMessage(builder.build());
                } else if ((desc = callable.getHelp(src)).isPresent()) {
                    src.sendMessage(desc.get());
                } else {
                    src.sendMessage(t("commands.generic.usage", t("/%s %s", command.get(), callable.getUsage(src))));
                }
                return CommandResult.success();
            }
            throw new CommandException(Text.of("No such command: ", command.get()));
        }
        Lantern.getGame().getScheduler().submitAsyncTask(() -> {
            TreeSet<CommandMapping> commands = new TreeSet<>(comparator);
            commands.addAll(Collections2.filter(Sponge.getCommandManager().getAll().values(), input -> input.getCallable().testPermission(src)));
            final Text title = Text.builder("Available commands:").color(TextColors.DARK_GREEN).build();
            final List<Text> lines = commands.stream().map(c -> getDescription(src, c)).collect(Collectors.toList());
            // Console sources cannot see/use the pagination
            if (!(src instanceof ConsoleSource)) {
                Sponge.getGame().getServiceManager().provide(PaginationService.class).get().builder().title(title).padding(Text.of(TextColors.DARK_GREEN, "=")).contents(lines).sendTo(src);
            } else {
                src.sendMessage(title);
                src.sendMessages(lines);
            }
            return null;
        });
        return CommandResult.success();
    });
}
Also used : ConsoleSource(org.spongepowered.api.command.source.ConsoleSource) CommandCallable(org.spongepowered.api.command.CommandCallable) CommandMapping(org.spongepowered.api.command.CommandMapping) Collections2(com.google.common.collect.Collections2) ArgumentParseException(org.spongepowered.api.command.args.ArgumentParseException) CommandArgs(org.spongepowered.api.command.args.CommandArgs) GenericArguments(org.spongepowered.api.command.args.GenericArguments) TreeSet(java.util.TreeSet) PaginationList(org.spongepowered.api.service.pagination.PaginationList) CommandContext(org.spongepowered.api.command.args.CommandContext) Text(org.spongepowered.api.text.Text) StartsWithPredicate(org.spongepowered.api.util.StartsWithPredicate) PluginContainer(org.spongepowered.api.plugin.PluginContainer) TextColors(org.spongepowered.api.text.format.TextColors) Nullable(javax.annotation.Nullable) CommandResult(org.spongepowered.api.command.CommandResult) TextActions(org.spongepowered.api.text.action.TextActions) TranslationHelper.t(org.lanternpowered.server.text.translation.TranslationHelper.t) CommandSource(org.spongepowered.api.command.CommandSource) TextStyles(org.spongepowered.api.text.format.TextStyles) Collection(java.util.Collection) Sponge(org.spongepowered.api.Sponge) PaginationService(org.spongepowered.api.service.pagination.PaginationService) Field(java.lang.reflect.Field) CommandElement(org.spongepowered.api.command.args.CommandElement) Collectors(java.util.stream.Collectors) CommandSpec(org.spongepowered.api.command.spec.CommandSpec) CommandException(org.spongepowered.api.command.CommandException) List(java.util.List) Lantern(org.lanternpowered.server.game.Lantern) Optional(java.util.Optional) Comparator(java.util.Comparator) CommandContext(org.spongepowered.api.command.args.CommandContext) ArgumentParseException(org.spongepowered.api.command.args.ArgumentParseException) StartsWithPredicate(org.spongepowered.api.util.StartsWithPredicate) CommandCallable(org.spongepowered.api.command.CommandCallable) CommandSpec(org.spongepowered.api.command.spec.CommandSpec) TreeSet(java.util.TreeSet) CommandMapping(org.spongepowered.api.command.CommandMapping) PaginationList(org.spongepowered.api.service.pagination.PaginationList) List(java.util.List) CommandArgs(org.spongepowered.api.command.args.CommandArgs) Text(org.spongepowered.api.text.Text) CommandException(org.spongepowered.api.command.CommandException) CommandSource(org.spongepowered.api.command.CommandSource) CommandElement(org.spongepowered.api.command.args.CommandElement) ConsoleSource(org.spongepowered.api.command.source.ConsoleSource) Nullable(javax.annotation.Nullable)

Example 30 with PluginContainer

use of org.spongepowered.api.plugin.PluginContainer in project LanternServer by LanternPowered.

the class CommandParticle method completeSpec.

@Override
public void completeSpec(PluginContainer pluginContainer, CommandSpec.Builder specBuilder) {
    specBuilder.arguments(new PatternMatchingCommandElement(Text.of("type")) {

        @Override
        protected Iterable<String> getChoices(CommandSource source) {
            return Sponge.getGame().getRegistry().getAllOf(ParticleType.class).stream().filter(type -> ((LanternParticleType) type).getInternalType().isPresent()).map(CatalogType::getId).collect(Collectors.toList());
        }

        @Override
        protected Object getValue(String choice) throws IllegalArgumentException {
            final Optional<ParticleType> ret = Sponge.getGame().getRegistry().getType(ParticleType.class, choice);
            if (!ret.isPresent() || !((LanternParticleType) ret.get()).getInternalType().isPresent()) {
                throw new IllegalArgumentException("Invalid input " + choice + " was found");
            }
            return ret.get();
        }
    }, GenericArguments2.targetedVector3d(Text.of("position")), // The default value should be 0 for x, y and z
    GenericArguments2.vector3d(Text.of("offset"), Vector3d.ZERO), GenericArguments2.doubleNum(Text.of("speed"), 1.0), GenericArguments.optional(GenericArguments2.integer(Text.of("count"), 1)), GenericArguments.optional(new CommandElement(Text.of("mode")) {

        @Nullable
        @Override
        protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException {
            return args.next();
        }

        @Override
        public List<String> complete(CommandSource src, CommandArgs args, CommandContext context) {
            Optional<String> arg = args.nextIfPresent();
            if (arg.isPresent()) {
                return Stream.of("normal", "force").filter(new StartsWithPredicate(arg.get())).collect(Collectors.toList());
            }
            return Collections.emptyList();
        }
    }), GenericArguments.optional(GenericArguments.player(Text.of("player"))), GenericArguments.optional(new CommandElement(Text.of("params")) {

        @Nullable
        @Override
        protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException {
            List<Integer> params = new ArrayList<>();
            while (args.hasNext()) {
                String arg = args.next();
                try {
                    params.add(Integer.parseInt(arg));
                } catch (NumberFormatException e) {
                    throw args.createError(t("Expected an integer, but input '%s' was not", arg));
                }
            }
            return params.stream().mapToInt(i -> i).toArray();
        }

        @Override
        public List<String> complete(CommandSource src, CommandArgs args, CommandContext context) {
            return Collections.emptyList();
        }
    })).executor((src, args) -> {
        final LanternParticleType particleType = args.<LanternParticleType>getOne("type").get();
        final int particleId = particleType.getInternalType().getAsInt();
        final Vector3f position = args.<Vector3d>getOne("position").get().toFloat();
        final Vector3f offset = args.<Vector3d>getOne("offset").get().toFloat();
        final float speed = args.<Double>getOne("speed").get().floatValue();
        final int count = args.<Integer>getOne("count").orElse(1);
        final boolean longDistance = args.<String>getOne("mode").map(mode -> mode.equalsIgnoreCase("force")).orElse(false);
        final int[] params = args.<int[]>getOne("params").orElse(new int[0]);
        final LanternWorld world = CommandHelper.getWorld(src, args);
        final int dataLength;
        if (particleType == ParticleTypes.BLOCK_CRACK || particleType == ParticleTypes.BLOCK_DUST || particleType == ParticleTypes.FALLING_DUST) {
            dataLength = 1;
        } else if (particleType == ParticleTypes.ITEM_CRACK) {
            dataLength = 2;
        } else {
            dataLength = 0;
        }
        if (params.length != dataLength) {
            throw new CommandException(t("Invalid parameters (%s), length mismatch (got %s, expected %s) for the particle type %s", Arrays.toString(params), params.length, dataLength, particleType.getId()));
        }
        final MessagePlayOutSpawnParticle message = new MessagePlayOutSpawnParticle(particleId, position, offset, speed, count, params, longDistance);
        if (args.hasAny("player")) {
            args.<LanternPlayer>getOne("player").get().getConnection().send(message);
        } else {
            for (LanternPlayer player : world.getRawPlayers()) {
                player.getConnection().send(message);
            }
        }
        src.sendMessage(t("commands.particle.success", particleType.getName(), count));
        return CommandResult.success();
    });
}
Also used : Arrays(java.util.Arrays) MessagePlayOutSpawnParticle(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnParticle) Vector3d(com.flowpowered.math.vector.Vector3d) ArgumentParseException(org.spongepowered.api.command.args.ArgumentParseException) CommandArgs(org.spongepowered.api.command.args.CommandArgs) LanternParticleType(org.lanternpowered.server.effect.particle.LanternParticleType) GenericArguments(org.spongepowered.api.command.args.GenericArguments) ArrayList(java.util.ArrayList) ParticleType(org.spongepowered.api.effect.particle.ParticleType) CommandContext(org.spongepowered.api.command.args.CommandContext) Text(org.spongepowered.api.text.Text) ParticleTypes(org.spongepowered.api.effect.particle.ParticleTypes) StartsWithPredicate(org.spongepowered.api.util.StartsWithPredicate) GenericArguments2(org.lanternpowered.server.command.element.GenericArguments2) LanternWorld(org.lanternpowered.server.world.LanternWorld) PluginContainer(org.spongepowered.api.plugin.PluginContainer) Nullable(javax.annotation.Nullable) CommandResult(org.spongepowered.api.command.CommandResult) TranslationHelper.t(org.lanternpowered.server.text.translation.TranslationHelper.t) CommandSource(org.spongepowered.api.command.CommandSource) CatalogType(org.spongepowered.api.CatalogType) Sponge(org.spongepowered.api.Sponge) CommandElement(org.spongepowered.api.command.args.CommandElement) Collectors(java.util.stream.Collectors) CommandSpec(org.spongepowered.api.command.spec.CommandSpec) CommandException(org.spongepowered.api.command.CommandException) List(java.util.List) Stream(java.util.stream.Stream) Vector3f(com.flowpowered.math.vector.Vector3f) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer) Optional(java.util.Optional) PatternMatchingCommandElement(org.spongepowered.api.command.args.PatternMatchingCommandElement) Collections(java.util.Collections) CommandContext(org.spongepowered.api.command.args.CommandContext) LanternParticleType(org.lanternpowered.server.effect.particle.LanternParticleType) ParticleType(org.spongepowered.api.effect.particle.ParticleType) ArgumentParseException(org.spongepowered.api.command.args.ArgumentParseException) LanternWorld(org.lanternpowered.server.world.LanternWorld) StartsWithPredicate(org.spongepowered.api.util.StartsWithPredicate) ArrayList(java.util.ArrayList) List(java.util.List) CommandArgs(org.spongepowered.api.command.args.CommandArgs) Optional(java.util.Optional) MessagePlayOutSpawnParticle(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnParticle) CommandException(org.spongepowered.api.command.CommandException) CommandSource(org.spongepowered.api.command.CommandSource) Vector3d(com.flowpowered.math.vector.Vector3d) PatternMatchingCommandElement(org.spongepowered.api.command.args.PatternMatchingCommandElement) Vector3f(com.flowpowered.math.vector.Vector3f) LanternParticleType(org.lanternpowered.server.effect.particle.LanternParticleType) CommandElement(org.spongepowered.api.command.args.CommandElement) PatternMatchingCommandElement(org.spongepowered.api.command.args.PatternMatchingCommandElement) Nullable(javax.annotation.Nullable) LanternPlayer(org.lanternpowered.server.entity.living.player.LanternPlayer)

Aggregations

PluginContainer (org.spongepowered.api.plugin.PluginContainer)75 Text (org.spongepowered.api.text.Text)15 CommandResult (org.spongepowered.api.command.CommandResult)13 GenericArguments (org.spongepowered.api.command.args.GenericArguments)13 CommandSpec (org.spongepowered.api.command.spec.CommandSpec)13 List (java.util.List)12 TranslationHelper.t (org.lanternpowered.server.text.translation.TranslationHelper.t)11 CommandException (org.spongepowered.api.command.CommandException)11 ArrayList (java.util.ArrayList)10 Optional (java.util.Optional)10 Collectors (java.util.stream.Collectors)9 Sponge (org.spongepowered.api.Sponge)9 Player (org.spongepowered.api.entity.living.player.Player)8 Collection (java.util.Collection)7 Map (java.util.Map)7 Nullable (javax.annotation.Nullable)7 CommandSource (org.spongepowered.api.command.CommandSource)7 GenericArguments2 (org.lanternpowered.server.command.element.GenericArguments2)6 CommandMapping (org.spongepowered.api.command.CommandMapping)6 ArgumentParseException (org.spongepowered.api.command.args.ArgumentParseException)6