package com.encrox.zombie; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; import org.bukkit.entity.Item; import org.bukkit.inventory.ItemStack; import org.bukkit.util.BlockVector; import org.json.JSONArray; import org.json.JSONObject; import com.encrox.zombie.interactable.Chest; import com.encrox.zombie.interactable.Lever; import com.encrox.zombie.interactable.Powerup; public class Map { private Schematic schematic; private String name; private int players; private BlockVector spawn; private Chest[] chests; private Mob[] mobs; private Powerup[] powerups; private Lever[] levers; public Map(JSONObject descriptor) { this.schematic = new Schematic(new File(Zombie.schematicsDirectory, descriptor.getString("file"))); this.name = descriptor.getString("name"); this.players = descriptor.getInt("players"); JSONArray spawnArray = descriptor.getJSONArray("spawn"); this.spawn = new BlockVector(spawnArray.getInt(0), spawnArray.getInt(1), spawnArray.getInt(2)); JSONArray leversArray = descriptor.getJSONArray("levers"); levers = new Lever[leversArray.length()]; for(int i = 0; i