{
String line1 = event.getLines()[0];
String line2 = event.getLines()[1];
if (line1.equalsIgnoreCase("[challenge]"))
{
Map map = Current.Maps.get(line2.toLowerCase());
if (map != null)
{
Location chestLoc = event.getBlock().getLocation();
chestLoc.setY(chestLoc.getBlockY() - 1);
Block chest = event.getBlock().getWorld().getBlockAt(chestLoc);
if (chest.getTypeId() == 54)
{
if (PermissionsManager.hasPermission(event.getPlayer(), "challengemaps.admin"))
{
MapEntrance me = new MapEntrance();
me.setMap(map);
me.setSignLocation(event.getBlock().getLocation());
me.setChestLocation(chestLoc);
Current.MapEntrances.put(me.getSignLocation(), me);
Current.MapEntrances.put(me.getChestLocation(), me);
event.setLine(0, "[Challenge]");
event.setLine(1, map.getMapName());
event.setLine(2, ""); // high score
event.setLine(3, ""); // high score player
event.getPlayer().sendMessage("Map Entrance Successfully Created.");
MapEntranceData.SaveMapEntrances();