use of cc.lasmgratel.foodcraftreloaded.minecraft.common.item.IMetadatable in project FoodCraft-Reloaded by LasmGratel.
the class ItemLoader method registerRenders.
@Load(side = Side.CLIENT)
public void registerRenders() {
for (Field field : FCRItems.class.getFields()) {
field.setAccessible(true);
RegItem anno = field.getAnnotation(RegItem.class);
try {
if (anno == null)
continue;
Item item = (Item) field.get(null);
if (item instanceof CustomModelMasking && ((CustomModelMasking) item).getModelLocation() != null) {
ModelLoader.setCustomModelResourceLocation(item, 0, ((CustomModelMasking) item).getModelLocation());
}
if (item.getHasSubtypes()) {
if (item instanceof IMetadatable) {
for (int i = 0; i < ((IMetadatable) item).getMaxMetadata(); i++) registerRender(item, i);
}
} else {
registerRender(item, 0);
}
} catch (Exception e) {
FoodCraftReloaded.getLogger().warn("Un-able to register item " + field.toGenericString(), e);
}
}
}
Aggregations