use of mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter in project ImmersiveEngineering by BluSunrize.
the class JEIHelper method registerItemSubtypes.
@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
//NBT Ignorance
subtypeRegistry.registerNbtInterpreter(Item.getItemFromBlock(IEContent.blockConveyor), new ISubtypeInterpreter() {
@Nullable
@Override
public String getSubtypeInfo(@Nonnull ItemStack itemStack) {
if (itemStack != null && ItemNBTHelper.hasKey(itemStack, "conveyorType"))
return ItemNBTHelper.getString(itemStack, "conveyorType");
return null;
}
});
subtypeRegistry.registerNbtInterpreter(IEContent.itemBullet, new ISubtypeInterpreter() {
@Nullable
@Override
public String getSubtypeInfo(@Nonnull ItemStack itemStack) {
if (itemStack != null && itemStack.getMetadata() == 2 && ItemNBTHelper.hasKey(itemStack, "bullet"))
return ItemNBTHelper.getString(itemStack, "bullet");
return null;
}
});
}
Aggregations