// Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/utils/SpawnHelper.java
// public class SpawnHelper {
// 	private final static Logger logger = LoggerFactory.getLogger(SpawnHelper.class);
// 
// 	private Map<Class<? extends Entity>, EntityType> entityClassToTypeMap;
// 
// 	protected void populateNewEntityClassToTypeMap(Map<Class<? extends Entity>, EntityType> map) {
// 		map.put(Human.class, EntityTypes.HUMAN);
// 		map.put(Pig.class, EntityTypes.PIG);
// 	}
// 
// 	// LNE = Log, but Never Exception. Returns Optional instead.
// 	public <T extends Entity> Optional<T> spawnLNE(Class<T> entityClass, Location<World> startingLocation) {
// 		try {
// 			return Optional.of(spawn(entityClass, startingLocation));
// 		} catch (MinecraftHelperException e) {
// 			logger.error(e.getMessage(), e);
// 			return Optional.empty();
// 		}
// 	}
// 
// 	public <T extends Entity> T spawn(Class<T> entityClass, Location<World> location) throws MinecraftHelperException {
// 		EntityType entityType = getEntityType(entityClass);
// 		EntityUniverse entityUniverse = location.getExtent();
// 		Optional<Entity> optionalEntity = entityUniverse.createEntity(entityType, location.getPosition());
// 		if (optionalEntity.isPresent()) {
// 			@SuppressWarnings("unchecked") T newEntity = (T) optionalEntity.get();
// 			boolean isSpawned = entityUniverse.spawnEntity(newEntity, null /* Cause.empty() */);
// 			if (!isSpawned)
// 				throw new MinecraftHelperException("Could not spawn new Entity: " + entityType.getName());
// 			return newEntity;
// 		} else {
// 			throw new MinecraftHelperException("Could not create new Entity: " + entityType.getName());
// 		}
// 	}
// 
// 	protected <T extends Entity> EntityType getEntityType(Class<T> entityClass) throws MinecraftHelperException {
// 		Optional<EntityType> optionalEntityType = getEntityTypeOptional(entityClass);
// 		if (!optionalEntityType.isPresent()) {
// 			throw new MinecraftHelperException("EntityType not found for entityClass: " + entityClass.getName());
// 		}
// 		EntityType entityType = optionalEntityType.get();
// 		// TODO isAssignable..
// 		//		if (!entityType.getEntityClass().equals(entityClass)) {
// 		//			throw new MinecraftHelperException("EntityType " + entityType.getName() + "'s entityClass " + entityType.getEntityClass() + " != " + entityClass);
// 		//		}
// 		return entityType;
// 	}
// 
// 	protected <T extends Entity> Optional<EntityType> getEntityTypeOptional(Class<T> entityClass) {
// 		return Optional.ofNullable(getEntityClassToTypeMap().get(entityClass));
// 	}
// 
// 	protected <T extends Entity> Map<Class<? extends Entity>, EntityType> getEntityClassToTypeMap() {
// 		if (entityClassToTypeMap == null) {
// 			Map<Class<? extends Entity>, EntityType> newEntityClassToTypeMap = new HashMap<>(70);
// 			populateNewEntityClassToTypeMap(newEntityClassToTypeMap);
// 			entityClassToTypeMap = newEntityClassToTypeMap;
// 		}
// 		return entityClassToTypeMap;
// 	}
// 
// }


import java.util.Optional;
import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.command.CommandCallable;
import org.spongepowered.api.command.CommandMapping;
import org.spongepowered.api.config.DefaultConfig;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.game.state.GameStartingServerEvent;
import org.spongepowered.api.event.game.state.GameStoppingServerEvent;
import org.spongepowered.api.event.network.ClientConnectionEvent;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;
import com.google.inject.Inject;
import ch.vorburger.minecraft.utils.SpawnHelper;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.loader.ConfigurationLoader;
package ch.vorburger.minecraft;





// @Plugin(id = "MyFirstSponge", name = "My first Sponge Plug-In", version = "1.0")
public class MyFirstSpongePlugIn {

	@Inject Game game;
	@Inject Logger logger;
	@Inject PluginContainer plugin;

	@DefaultConfig(sharedRoot = true)
	@Inject ConfigurationLoader<CommentedConfigurationNode> configLoader;

	Optional<CommandMapping> commandMapping = Optional.empty();

// Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/utils/SpawnHelper.java
// public class SpawnHelper {
// 	private final static Logger logger = LoggerFactory.getLogger(SpawnHelper.class);
// 
// 	private Map<Class<? extends Entity>, EntityType> entityClassToTypeMap;
// 
// 	protected void populateNewEntityClassToTypeMap(Map<Class<? extends Entity>, EntityType> map) {
// 		map.put(Human.class, EntityTypes.HUMAN);
// 		map.put(Pig.class, EntityTypes.PIG);
// 	}
// 
// 	// LNE = Log, but Never Exception. Returns Optional instead.
// 	public <T extends Entity> Optional<T> spawnLNE(Class<T> entityClass, Location<World> startingLocation) {
// 		try {
// 			return Optional.of(spawn(entityClass, startingLocation));
// 		} catch (MinecraftHelperException e) {
// 			logger.error(e.getMessage(), e);
// 			return Optional.empty();
// 		}
// 	}
// 
// 	public <T extends Entity> T spawn(Class<T> entityClass, Location<World> location) throws MinecraftHelperException {
// 		EntityType entityType = getEntityType(entityClass);
// 		EntityUniverse entityUniverse = location.getExtent();
// 		Optional<Entity> optionalEntity = entityUniverse.createEntity(entityType, location.getPosition());
// 		if (optionalEntity.isPresent()) {
// 			@SuppressWarnings("unchecked") T newEntity = (T) optionalEntity.get();
// 			boolean isSpawned = entityUniverse.spawnEntity(newEntity, null /* Cause.empty() */);
// 			if (!isSpawned)
// 				throw new MinecraftHelperException("Could not spawn new Entity: " + entityType.getName());
// 			return newEntity;
// 		} else {
// 			throw new MinecraftHelperException("Could not create new Entity: " + entityType.getName());
// 		}
// 	}
// 
// 	protected <T extends Entity> EntityType getEntityType(Class<T> entityClass) throws MinecraftHelperException {
// 		Optional<EntityType> optionalEntityType = getEntityTypeOptional(entityClass);
// 		if (!optionalEntityType.isPresent()) {
// 			throw new MinecraftHelperException("EntityType not found for entityClass: " + entityClass.getName());
// 		}
// 		EntityType entityType = optionalEntityType.get();
// 		// TODO isAssignable..
// 		//		if (!entityType.getEntityClass().equals(entityClass)) {
// 		//			throw new MinecraftHelperException("EntityType " + entityType.getName() + "'s entityClass " + entityType.getEntityClass() + " != " + entityClass);
// 		//		}
// 		return entityType;
// 	}
// 
// 	protected <T extends Entity> Optional<EntityType> getEntityTypeOptional(Class<T> entityClass) {
// 		return Optional.ofNullable(getEntityClassToTypeMap().get(entityClass));
// 	}
// 
// 	protected <T extends Entity> Map<Class<? extends Entity>, EntityType> getEntityClassToTypeMap() {
// 		if (entityClassToTypeMap == null) {
// 			Map<Class<? extends Entity>, EntityType> newEntityClassToTypeMap = new HashMap<>(70);
// 			populateNewEntityClassToTypeMap(newEntityClassToTypeMap);
// 			entityClassToTypeMap = newEntityClassToTypeMap;
// 		}
// 		return entityClassToTypeMap;
// 	}
// 
// }


// Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/MyFirstSpongePlugIn.java
import java.util.Optional;
import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.command.CommandCallable;
import org.spongepowered.api.command.CommandMapping;
import org.spongepowered.api.config.DefaultConfig;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.game.state.GameStartingServerEvent;
import org.spongepowered.api.event.game.state.GameStoppingServerEvent;
import org.spongepowered.api.event.network.ClientConnectionEvent;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;
import com.google.inject.Inject;
import ch.vorburger.minecraft.utils.SpawnHelper;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.loader.ConfigurationLoader;

package ch.vorburger.minecraft;





// @Plugin(id = "MyFirstSponge", name = "My first Sponge Plug-In", version = "1.0")
public class MyFirstSpongePlugIn {

	@Inject Game game;
	@Inject Logger logger;
	@Inject PluginContainer plugin;

	@DefaultConfig(sharedRoot = true)
	@Inject ConfigurationLoader<CommentedConfigurationNode> configLoader;

	Optional<CommandMapping> commandMapping = Optional.empty();

	SpawnHelper spawnHelper = new SpawnHelper();