use of mezz.jei.api.registration.ISubtypeRegistration in project TinkersConstruct by SlimeKnights.
the class JEIPlugin method registerItemSubtypes.
@Override
public void registerItemSubtypes(ISubtypeRegistration registry) {
// retexturable blocks
IIngredientSubtypeInterpreter<ItemStack> tables = (stack, context) -> {
if (context == UidContext.Ingredient) {
return RetexturedBlockItem.getTextureName(stack);
}
return IIngredientSubtypeInterpreter.NONE;
};
registry.registerSubtypeInterpreter(TinkerTables.craftingStation.asItem(), tables);
registry.registerSubtypeInterpreter(TinkerTables.partBuilder.asItem(), tables);
registry.registerSubtypeInterpreter(TinkerTables.tinkerStation.asItem(), tables);
registry.registerSubtypeInterpreter(TinkerTables.tinkersAnvil.asItem(), tables);
registry.registerSubtypeInterpreter(TinkerTables.scorchedAnvil.asItem(), tables);
IIngredientSubtypeInterpreter<ItemStack> toolPartInterpreter = (stack, context) -> {
MaterialVariantId materialId = IMaterialItem.getMaterialFromStack(stack);
if (materialId.equals(IMaterial.UNKNOWN_ID)) {
return IIngredientSubtypeInterpreter.NONE;
}
return materialId.getId().toString();
};
// parts
for (Item item : TinkerTags.Items.TOOL_PARTS.getValues()) {
registry.registerSubtypeInterpreter(item, toolPartInterpreter);
}
// tools
Item slimeskull = TinkerTools.slimesuit.get(ArmorSlotType.HELMET);
registry.registerSubtypeInterpreter(slimeskull, ToolSubtypeInterpreter.ALWAYS);
for (Item item : TinkerTags.Items.MULTIPART_TOOL.getValues()) {
if (item != slimeskull) {
registry.registerSubtypeInterpreter(item, ToolSubtypeInterpreter.INGREDIENT);
}
}
registry.registerSubtypeInterpreter(TinkerSmeltery.copperCan.get(), (stack, context) -> CopperCanItem.getSubtype(stack));
registry.registerSubtypeInterpreter(TinkerModifiers.creativeSlotItem.get(), (stack, context) -> {
SlotType slotType = CreativeSlotItem.getSlot(stack);
return slotType != null ? slotType.getName() : "";
});
}
use of mezz.jei.api.registration.ISubtypeRegistration in project Botania by VazkiiMods.
the class JEIBotaniaPlugin method registerItemSubtypes.
@Override
public void registerItemSubtypes(@Nonnull ISubtypeRegistration registry) {
IIngredientSubtypeInterpreter<ItemStack> interpreter = (stack, ctx) -> ItemBrewBase.getSubtype(stack);
registry.registerSubtypeInterpreter(ModItems.brewVial, interpreter);
registry.registerSubtypeInterpreter(ModItems.brewFlask, interpreter);
registry.registerSubtypeInterpreter(ModItems.incenseStick, interpreter);
registry.registerSubtypeInterpreter(ModItems.bloodPendant, interpreter);
registry.registerSubtypeInterpreter(ModItems.flightTiara, (stack, ctx) -> String.valueOf(ItemFlightTiara.getVariant(stack)));
registry.registerSubtypeInterpreter(ModItems.lexicon, (stack, ctx) -> String.valueOf(ItemNBTHelper.getBoolean(stack, ItemLexicon.TAG_ELVEN_UNLOCK, false)));
registry.registerSubtypeInterpreter(ModItems.laputaShard, (stack, ctx) -> String.valueOf(ItemLaputaShard.getShardLevel(stack)));
registry.registerSubtypeInterpreter(ModItems.terraPick, (stack, ctx) -> {
if (ctx == UidContext.Recipe) {
return String.valueOf(ItemTerraPick.isTipped(stack));
}
return String.valueOf(ItemTerraPick.getLevel(stack)) + ItemTerraPick.isTipped(stack);
});
registry.registerSubtypeInterpreter(ModItems.manaTablet, (stack, ctx) -> String.valueOf(((IManaItem) ModItems.manaTablet).getMana(stack)) + ItemManaTablet.isStackCreative(stack));
for (Item item : new Item[] { ModItems.manaRing, ModItems.manaRingGreater }) {
registry.registerSubtypeInterpreter(item, (stack, ctx) -> String.valueOf(((IManaItem) item).getMana(stack)));
}
}
use of mezz.jei.api.registration.ISubtypeRegistration in project SophisticatedBackpacks by P3pp3rF1y.
the class SBPPlugin method registerItemSubtypes.
@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
ISubtypeInterpreter backpackNbtInterpreter = itemStack -> itemStack.getCapability(CapabilityBackpackWrapper.getCapabilityInstance()).map(wrapper -> "{clothColor:" + wrapper.getClothColor() + ",borderColor:" + wrapper.getBorderColor() + "}").orElse("");
registration.registerSubtypeInterpreter(ModItems.BACKPACK.get(), backpackNbtInterpreter);
registration.registerSubtypeInterpreter(ModItems.IRON_BACKPACK.get(), backpackNbtInterpreter);
registration.registerSubtypeInterpreter(ModItems.GOLD_BACKPACK.get(), backpackNbtInterpreter);
registration.registerSubtypeInterpreter(ModItems.DIAMOND_BACKPACK.get(), backpackNbtInterpreter);
registration.registerSubtypeInterpreter(ModItems.NETHERITE_BACKPACK.get(), backpackNbtInterpreter);
}
use of mezz.jei.api.registration.ISubtypeRegistration in project Ceramics by KnightMiner.
the class JEIPlugin method registerItemSubtypes.
@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
ISubtypeInterpreter bucketInterpreter = BaseClayBucketItem::getSubtype;
registration.registerSubtypeInterpreter(Registration.CLAY_BUCKET.get(), bucketInterpreter);
registration.registerSubtypeInterpreter(Registration.CRACKED_CLAY_BUCKET.get(), bucketInterpreter);
// separate different states of crackable clay
ISubtypeInterpreter crackableClay = stack -> CrackableBlockItem.getCracks(stack) > 0 ? "cracked" : "";
registration.registerSubtypeInterpreter(Registration.TERRACOTTA_CISTERN.asItem(), crackableClay);
Registration.COLORED_CISTERN.forEach(block -> registration.registerSubtypeInterpreter(block.asItem(), crackableClay));
registration.registerSubtypeInterpreter(Registration.TERRACOTTA_FAUCET.asItem(), crackableClay);
registration.registerSubtypeInterpreter(Registration.TERRACOTTA_CHANNEL.asItem(), crackableClay);
}
Aggregations