use of cc.lasmgratel.foodcraftreloaded.minecraft.common.item.food.ItemPFood in project FoodCraft-Reloaded by LasmGratel.
the class PropertiedFoodLoader method registerOreDict.
@Load(LoaderState.AVAILABLE)
public void registerOreDict() {
for (Field field : FCRFoods.class.getFields()) {
field.setAccessible(true);
try {
RegFood anno = field.getDeclaredAnnotation(RegFood.class);
if (anno == null) {
continue;
}
ItemPFood item = (ItemPFood) field.get(null);
Arrays.asList(anno.oreDict()).forEach(s -> OreDictionary.registerOre(s, item));
OreDictionary.registerOre("listAllfoods", item);
} catch (IllegalAccessException | NullPointerException e) {
FoodCraftReloaded.getLogger().warn("Un-able to register food " + field.toGenericString(), e);
}
}
}
Aggregations