package org.pfaa.geologica;

import java.util.List;

import org.pfaa.chemica.item.IndustrialMaterialItem;
import org.pfaa.chemica.processing.Form.Forms;
import org.pfaa.core.catalog.CatalogUtils;
import org.pfaa.core.catalog.ItemCatalog;
import org.pfaa.geologica.processing.Crude;
import org.pfaa.geologica.processing.IndustrialMineral.IndustrialMinerals;
import org.pfaa.geologica.processing.Ore;
import org.pfaa.geologica.processing.OreMineral.Ores;

import com.google.common.base.Predicate;

import net.minecraft.block.material.Material;

public class GeologicaItems implements ItemCatalog {
	private static Predicate<GeoMaterial> EarthyMaterial = new Predicate<GeoMaterial>() {
		public boolean apply(GeoMaterial obj) {
			return obj.getBlockMaterial() == Material.clay || obj.getBlockMaterial() == Material.ground;
		}
	};
	private static Predicate<GeoMaterial> CrudeRock = new Predicate<GeoMaterial>() {
		public boolean apply(GeoMaterial obj) {
			return obj.getComposition() instanceof Crude && obj.getBlockMaterial() == Material.rock;
		}
	};
	private static Predicate<GeoMaterial> OreRock = new Predicate<GeoMaterial>() {
		public boolean apply(GeoMaterial obj) {
			return obj.getComposition() instanceof Ore && obj.getBlockMaterial() == Material.rock;
		}
	};

	public static final IndustrialMaterialItem<GeoMaterial> CRUDE_LUMP = 
			new IndustrialMaterialItem<GeoMaterial>(Forms.LUMP, GeoMaterial.class, CrudeRock);
	public static final IndustrialMaterialItem<GeoMaterial> EARTHY_CLUMP = 
			new IndustrialMaterialItem<GeoMaterial>(Forms.CLUMP, GeoMaterial.class, EarthyMaterial);
	public static final IndustrialMaterialItem<GeoMaterial> ORE_CRUSHED = 
			new IndustrialMaterialItem<GeoMaterial>(Forms.CRUSHED, GeoMaterial.class, OreRock);
	public static final IndustrialMaterialItem<GeoMaterial> ORE_DUST = 
			new IndustrialMaterialItem<GeoMaterial>(Forms.DUST, GeoMaterial.class, OreRock);
	
	public static final IndustrialMaterialItem<Ores> ORE_MINERAL_DUST = 
			new IndustrialMaterialItem<Ores>(Forms.DUST, Ores.class);
	public static final IndustrialMaterialItem<IndustrialMinerals> INDUSTRIAL_MINERAL_DUST = 
			new IndustrialMaterialItem<IndustrialMinerals>(Forms.DUST, IndustrialMinerals.class);
	
	@SuppressWarnings("rawtypes")
	public static List<IndustrialMaterialItem> getIndustrialMaterialItems() {
		return CatalogUtils.getEntries(GeologicaItems.class, IndustrialMaterialItem.class);
	}
}

@@ -1416,32 +1416,356 @@
 ss, CrudeRock);%0A
+%09public static final IndustrialMaterialItem%3CGeoMaterial%3E CRUDE_DUST = %0A%09%09%09new IndustrialMaterialItem%3CGeoMaterial%3E(Forms.DUST, GeoMaterial.class, CrudeRock);%0A%09public static final IndustrialMaterialItem%3CGeoMaterial%3E TINY_CRUDE_DUST = %0A%09%09%09new IndustrialMaterialItem%3CGeoMaterial%3E(Forms.TINY_DUST, GeoMaterial.class, CrudeRock);%0A
 %09public static f
@@ -2064,32 +2064,34 @@
 lass, OreRock);%0A
+%09%0A
 %09public static f
@@ -2118,32 +2118,33 @@
 ialItem%3C
-GeoMaterial%3E ORE
+Ores%3E ORE_MINERAL
 _DUST = 
@@ -2178,64 +2178,180 @@
 tem%3C
-GeoMaterial%3E(Forms.DUST, GeoMaterial.class, OreRock
+Ores%3E(Forms.DUST, Ores.class);%0A%09public static final IndustrialMaterialItem%3COres%3E TINY_ORE_MINERAL_DUST = %0A%09%09%09new IndustrialMaterialItem%3COres%3E(Forms.TINY_DUST, Ores.class
 );%0A
-%09%0A
 %09pub
@@ -2386,33 +2386,54 @@
 aterialItem%3C
-Ores%3E ORE
+IndustrialMinerals%3E INDUSTRIAL
 _MINERAL_DUS
@@ -2467,37 +2467,65 @@
 ialItem%3C
-Ores%3E(Forms.DUST, Ore
+IndustrialMinerals%3E(Forms.DUST, IndustrialMineral
 s.class)
@@ -2582,32 +2582,37 @@
 strialMinerals%3E 
+TINY_
 INDUSTRIAL_MINER
@@ -2670,32 +2670,37 @@
 Minerals%3E(Forms.
+TINY_
 DUST, Industrial

add crude dusts, drop GeoMaterial dusts, add tiny dusts for minerals