@@ -0,0 +1,3637 @@
+/*%0A * This file is part of Sponge, licensed under the MIT License (MIT).%0A *%0A * Copyright (c) SpongePowered %3Chttps://www.spongepowered.org%3E%0A * Copyright (c) contributors%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0Apackage org.spongepowered.test;%0A%0Aimport org.spongepowered.api.Sponge;%0Aimport org.spongepowered.api.command.CommandResult;%0Aimport org.spongepowered.api.command.spec.CommandSpec;%0Aimport org.spongepowered.api.event.Listener;%0Aimport org.spongepowered.api.event.entity.ConstructEntityEvent;%0Aimport org.spongepowered.api.event.entity.SpawnEntityEvent;%0Aimport org.spongepowered.api.event.game.state.GameInitializationEvent;%0Aimport org.spongepowered.api.plugin.Plugin;%0Aimport org.spongepowered.api.text.Text;%0Aimport org.spongepowered.api.text.format.TextColors;%0A%0Aimport java.util.stream.Collectors;%0A%0A@Plugin(id = %22witherspawntest%22, name = %22Wither Spawn Test%22, description = %22Log Wither Skele Spawn and generation%22, version = %220.0.0%22)%0Apublic class WitherSpawnTest %7B%0A%0A    private final SpawnListener listener = new SpawnListener();%0A    private boolean enabled = false;%0A%0A    @Listener%0A    public void onInit(GameInitializationEvent event) %7B%0A        Sponge.getCommandManager().register(this,%0A                CommandSpec.builder().executor((src, args) -%3E %7B%0A                    this.enabled = !this.enabled;%0A                    src.sendMessage(Text.of(%22Enabled: %22, this.enabled));%0A                    if (this.enabled) %7B%0A                        Sponge.getEventManager().registerListeners(this, this.listener);%0A                    %7D else %7B%0A                        Sponge.getEventManager().unregisterListeners(this.listener);%0A                    %7D%0A                    return CommandResult.success();%0A                %7D).build(),%0A                %22toggle-spawn-logging%22%0A        );%0A    %7D%0A%0A    public static class SpawnListener %7B%0A        @Listener%0A        public void onSpawn(SpawnEntityEvent event) %7B%0A            final String entities = event.getEntities().stream()%0A                    .map(entity -%3E entity.getType().getId())%0A                    .collect(Collectors.joining(%22, %22));%0A            Sponge.getServer().getBroadcastChannel().send(%0A                    Text.of(TextColors.GREEN, %22Spawning: %22, entities, %22 %22, TextColors.WHITE, event.getCause())%0A            );%0A        %7D%0A%0A        @Listener%0A        public void onConstruct(ConstructEntityEvent.Post event) %7B%0A            final String entity = event.getTargetType().getId();%0A            Sponge.getServer().getBroadcastChannel().send(%0A                    Text.of(TextColors.RED, %22Constructing: %22, TextColors.WHITE, entity)%0A            );%0A        %7D%0A    %7D%0A%7D%0A

Add test plugin WitherSpawnTest (#1599)