function initPlotFlags() {
	list = list.new();
	list.add(list, initPlotFlag(calcLeftShift(30), "SUB_PLOT_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(29), "FREE_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(28), "CITY_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(27), "EXPLOSION_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(5), "ENTITY_INTERACT_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(4), "BLOCK_INTERACT_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(3), "HIT_AMBIENT_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(2), "BUCKET_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(1), "BREAK_FLAG"));
	list.add(list, initPlotFlag(calcLeftShift(0), "PLACE_FLAG"));
	setScriptVar("all_plot_flags", list);
}

function initPlotFlag(f, f_name) {
	a = array.new(2);
	a[0] = f;
	a[1] = f_name;
	return a;
}

function getAllPlotFlags() {
	return getScriptVar("all_plot_flags");
}

function getFlagLists(plot) {
	flags = plot.getFlags(plot);
	all_flags = getAllPlotFlags();
	flags_true = list.new();
	flags_false = list.new();
	
	iter = iterator(all_flags);
	while(hasNext(iter)) {
		a = next(iter);
		f = a[0];
		if(flags >= f) {
			list.add(flags_true, a);
			flags -= f;
		} else {
			list.add(flags_false, a);
		}
	}
	a = array.new(2);
	a[0] = flags_true;
	a[1] = flags_false;
	return a;
}

function getItemFlags() {
	list = list.new();
	list.add(list, "HIDE_ATTRIBUTES");
	list.add(list, "HIDE_UNBREAKABLE");
	list.add(list, "HIDE_DESTROYS");
	list.add(list, "HIDE_PLACED_ON");
	list.add(list, "HIDE_POTION_EFFECTS");
	list.add(list, "HIDE_DYE");
	list.add(list, "HIDE_ENCHANTS");
	return list;
}

function getRickRollSounds() {
	RickRollSounds = list.new();
	list.add(RickRollSounds, math.pow(2, -6 / 12));//6
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, -1 / 12));//11
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, 3 / 12));//15
	list.add(RickRollSounds, math.pow(2, 3 / 12));//15
	list.add(RickRollSounds, math.pow(2, 1 / 12));//13
	list.add(RickRollSounds, math.pow(2, -6 / 12));//6
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, -1 / 12));//11
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, 1 / 12));//13
	list.add(RickRollSounds, math.pow(2, 1 / 12));//13
	list.add(RickRollSounds, math.pow(2, -1 / 12));//11
	list.add(RickRollSounds, math.pow(2, -2 / 12));//10
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, -6 / 12));//6
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, -1 / 12));//11
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, -1 / 12));//11
	list.add(RickRollSounds, math.pow(2, 1 / 12));//13
	list.add(RickRollSounds, math.pow(2, -2 / 12));//10
	list.add(RickRollSounds, math.pow(2, -4 / 12));//8
	list.add(RickRollSounds, math.pow(2, -6 / 12));//6
	list.add(RickRollSounds, math.pow(2, -6 / 12));//6
	list.add(RickRollSounds, math.pow(2, -6 / 12));//6
	list.add(RickRollSounds, math.pow(2, 1 / 12));//13
	list.add(RickRollSounds, math.pow(2, -1 / 12));//11
	//6,8,11,8,15,15,13,6,8,11,8,13,13,11,10,8,6,8,11,8,11,13,10,8,6,6,6,13,11
	return RickRollSounds;
}

function getRickRollSoundDists() {
	RickRollSoundDists = list.new();
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 12);//6
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 8);//4
	list.add(RickRollSoundDists, 4);//2
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 2);//1
	list.add(RickRollSoundDists, 4);//2
	list.add(RickRollSoundDists, 4);//2
	list.add(RickRollSoundDists, 6);//3
	list.add(RickRollSoundDists, 8);//4
	list.add(RickRollSoundDists, 2);//1
	//2,2,2,2,2,6,6,12,2,2,2,2,6,6,6,2,6,2,2,2,2,8,4,6,2,4,4,6,8
	return RickRollSoundDists;
}

function getBobbyCarSounds() {
	bobbyCarSounds = list.new();
	list.add(bobbyCarSounds, math.pow(2, 4 / 12));
	list.add(bobbyCarSounds, math.pow(2, 2 / 12));
	list.add(bobbyCarSounds, math.pow(2, 1 / 12));
	list.add(bobbyCarSounds, math.pow(2, 4 / 12));
	list.add(bobbyCarSounds, math.pow(2, -3 / 12));
	list.add(bobbyCarSounds, math.pow(2, 1 / 12));
	list.add(bobbyCarSounds, math.pow(2, -1 / 12));
	list.add(bobbyCarSounds, math.pow(2, 2 / 12));
	list.add(bobbyCarSounds, math.pow(2, -4 / 12));
	list.add(bobbyCarSounds, math.pow(2, -1 / 12));
	list.add(bobbyCarSounds, math.pow(2, -3 / 12));
	list.add(bobbyCarSounds, math.pow(2, -1 / 12));
	list.add(bobbyCarSounds, math.pow(2, 1 / 12));
	return bobbyCarSounds;
}

function getBobbyCarSoundDists() {
	bobbyCarSoundDists = list.new();
	list.add(bobbyCarSoundDists, 8);
	list.add(bobbyCarSoundDists, 8);
	list.add(bobbyCarSoundDists, 4);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 4);
	list.add(bobbyCarSoundDists, 6);
	list.add(bobbyCarSoundDists, 6);
	return bobbyCarSoundDists;
}

function getPotionTypes() {
	list = list.new();
	list.add(list, "ABSORPTION");
	list.add(list, "BAD_OMEN");
	list.add(list, "BLINDNESS");
	list.add(list, "CONDUIT_POWER");
	list.add(list, "CONFUSION");
	list.add(list, "DAMAGE_RESISTANCE");
	list.add(list, "DOLPHINS_GRACE");
	list.add(list, "FAST_DIGGING");
	list.add(list, "FIRE_RESISTANCE");
	list.add(list, "GLOWING");
	list.add(list, "HARM");
	list.add(list, "HEAL");
	list.add(list, "HEALTH_BOOST");
	list.add(list, "HERO_OF_THE_VILLAGE");
	list.add(list, "HUNGER");
	list.add(list, "INCREASE_DAMAGE");
	list.add(list, "INVISIBILITY");
	list.add(list, "JUMP");
	list.add(list, "LEVITATION");
	list.add(list, "LUCK");
	list.add(list, "NIGHT_VISION");
	list.add(list, "POISON");
	list.add(list, "REGENERATION");
	list.add(list, "SATURATION");
	list.add(list, "SLOW");
	list.add(list, "SLOW_DIGGING");
	list.add(list, "SLOW_FALLING");
	list.add(list, "SPEED");
	list.add(list, "UNLUCK");
	list.add(list, "WATER_BREATHING");
	list.add(list, "WEAKNESS");
	list.add(list, "WITHER");
	return list;
}