<commit_before>package com.ForgeEssentials.permission;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;

import net.minecraft.world.World;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent.Load;

import com.ForgeEssentials.api.data.ClassContainer;
import com.ForgeEssentials.api.permissions.IZoneManager;
import com.ForgeEssentials.api.permissions.Zone;
import com.ForgeEssentials.util.FunctionHelper;
import com.ForgeEssentials.util.AreaSelector.Selection;
import com.ForgeEssentials.util.AreaSelector.WorldArea;
import com.ForgeEssentials.util.AreaSelector.WorldPoint;

import cpw.mods.fml.common.FMLCommonHandler;

public class ZoneHelper implements IZoneManager
{
	// GLOBAL and WORLD zones.
	private Zone	GLOBAL;
	private Zone	SUPER;

	public ZoneHelper()
	{
		GLOBAL = new Zone("_GLOBAL_");
		SUPER = new Zone("_SUPER_");
		worldZoneMap = new ConcurrentHashMap<String, Zone>();
		zoneMap = Collections.synchronizedSortedMap(new TreeMap<String, Zone>());
	}

	protected void loadZones()
	{
		Object[] objs = ModulePermissions.data.loadAllObjects(new ClassContainer(Zone.class));
		Zone temp;
		boolean exists;
		for (Object obj : objs)
		{
			temp = (Zone) obj;
			zoneMap.put(temp.getZoneName(), temp);

			exists = SqlHelper.doesZoneExist(temp.getZoneName());
			if (!exists)
			{
				SqlHelper.createZone(temp.getZoneName());
			}<commit_msg>added some checks to zone loading<commit_after>package com.ForgeEssentials.permission;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;

import net.minecraft.world.World;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent.Load;

import com.ForgeEssentials.api.data.ClassContainer;
import com.ForgeEssentials.api.permissions.IZoneManager;
import com.ForgeEssentials.api.permissions.Zone;
import com.ForgeEssentials.util.FunctionHelper;
import com.ForgeEssentials.util.AreaSelector.Selection;
import com.ForgeEssentials.util.AreaSelector.WorldArea;
import com.ForgeEssentials.util.AreaSelector.WorldPoint;

import cpw.mods.fml.common.FMLCommonHandler;

public class ZoneHelper implements IZoneManager
{
	// GLOBAL and WORLD zones.
	private Zone	GLOBAL;
	private Zone	SUPER;

	public ZoneHelper()
	{
		GLOBAL = new Zone("_GLOBAL_");
		SUPER = new Zone("_SUPER_");
		worldZoneMap = new ConcurrentHashMap<String, Zone>();
		zoneMap = Collections.synchronizedSortedMap(new TreeMap<String, Zone>());
	}

	protected void loadZones()
	{
		Object[] objs = ModulePermissions.data.loadAllObjects(new ClassContainer(Zone.class));
		
		if (objs == null)
			return;
		
		Zone temp;
		boolean exists;
		for (Object obj : objs)
		{
			temp = (Zone) obj;
			
			if (temp == null || temp.getZoneName() == null || temp.getZoneName().isEmpty())
				continue;
			
			zoneMap.put(temp.getZoneName(), temp);

			exists = SqlHelper.doesZoneExist(temp.getZoneName());
			if (!exists)
			{
				SqlHelper.createZone(temp.getZoneName());
			}
{'fraction_non_alphanumeric': 0.11286332714904143, 'fraction_numerical': 0.0, 'mean_word_length': 5.233140655105973, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7487159', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1042, 'n_words': 200}