package com.elmakers.mine.bukkit.spell.builtin;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.map.MapView;

import com.elmakers.mine.bukkit.api.spell.SpellResult;
import com.elmakers.mine.bukkit.spell.TargetingSpell;

public class MapSpell extends TargetingSpell
{
	@SuppressWarnings("deprecation")
	@Override
	public SpellResult onCast(ConfigurationSection parameters) 
	{
		World world = getWorld();
		MapView newMap = Bukkit.createMap(world);
		ItemStack newMapItem = new ItemStack(Material.MAP, 1, newMap.getId());
		world.dropItemNaturally(getLocation(), newMapItem);
		return SpellResult.CAST;
	}
}

@@ -68,16 +68,44 @@
 Bukkit;%0A
+import org.bukkit.Location;%0A
 import o
@@ -124,16 +124,16 @@
 terial;%0A
-
 import o
@@ -199,24 +199,57 @@
 ionSection;%0A
+import org.bukkit.entity.Player;%0A
 import org.b
@@ -275,16 +275,84 @@
 mStack;%0A
+import org.bukkit.map.MapCanvas;%0Aimport org.bukkit.map.MapRenderer;%0A
 import o
@@ -669,16 +669,16 @@
 orld();%0A
-
 %09%09MapVie
@@ -713,16 +713,397 @@
 world);%0A
+%09%09Location location = getLocation();%0A%09%09newMap.setCenterX(location.getBlockX());%0A%09%09newMap.setCenterZ(location.getBlockZ());%0A%0A%09%09MapView.Scale scale = newMap.getScale();%0A%09%09String scaleType = parameters.getString(%22scale%22);%0A%09%09if (scaleType != null) %7B%0A%09%09%09try %7B%0A%09%09%09%09scale = MapView.Scale.valueOf(scaleType.toUpperCase());%0A%09%09%09%7D catch (Exception ex) %7B%0A%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09newMap.setScale(scale);%0A%0A
 %09%09ItemSt

Add scale parameter to Map spell