/** * Attempt to register all entries from {@link #enumInstanceMap} to {@link ForgeRegistries}. * @see ForgeRegistries */ public void register() { enumInstanceMap.forEach((instanceClass, enumMap) -> { if (IForgeRegistryEntry.class.isAssignableFrom(instanceClass)) enumMap.values().stream().map(o -> (IForgeRegistryEntry<? extends IForgeRegistryEntry<?>>) o) // .map(o -> new RegisterHandler(o)) .forEach(o -> { // TODO RegisterManager.getInstance().putRegister(o); if (o instanceof Item) { ForgeRegistries.ITEMS.register((Item) o); if (o instanceof OreDictated) Arrays.stream(((OreDictated) o).getOreDictNames()).forEach(s -> OreDictionary.registerOre(s, (Item) o)); } else if (o instanceof Block) { ForgeRegistries.BLOCKS.register((Block) o); if (o instanceof OreDictated) Arrays.stream(((OreDictated) o).getOreDictNames()).forEach(s -> OreDictionary.registerOre(s, (Block) o)); } }); else if (Fluid.class.isAssignableFrom(instanceClass)) enumMap.values().stream().map(o -> (Fluid) o).forEach(fluid -> { FluidRegistry.registerFluid(fluid); FluidRegistry.addBucketForFluid(fluid); }); }); }
@Override public boolean matches(ItemStack subject) { List<ItemStack> inputs = getOres(); boolean useOreStackMeta = (meta == null); Item subjectItem = subject.getItem(); int subjectMeta = subject.getItemDamage(); for (ItemStack oreStack : inputs) { Item oreItem = oreStack.getItem(); if (oreItem == null) continue; // ignore invalid int metaRequired = useOreStackMeta ? oreStack.getItemDamage() : meta; if (subjectItem == oreItem && (subjectMeta == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) { return true; } } return false; }
public ContainerSmelter(InventoryPlayer playerInventory, TileEntitySmelter smelter) { for(String ore : OreDictionary.getOreNames()) if(ore.toLowerCase().contains("ore")) ores.addAll(OreDictionary.getOres(ore)); this.addSlotToContainer(new SlotSmelterInput(ores, smelter.getInventory(), 0, 56, 17)); this.addSlotToContainer(new SlotPanOutput(playerInventory.player, smelter.getInventory(), 1, 116, 35)); this.addSlotToContainer(new SlotPanOutput(playerInventory.player, smelter.getInventory(), 2, 140, 39)); for (int i = 0; i < 3; ++i) for (int j = 0; j < 9; ++j) this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); for (int k = 0; k < 9; ++k) this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); }
@Override public boolean isItemValid(ItemStack stack) { if(!stack.isEmpty()) { boolean flag = false; int[] ids = OreDictionary.getOreIDs(stack); for(int id: ids) if(OreDictionary.getOreName(id).contains("food")){ flag = true; break; } if(stack.getItem() instanceof ItemFood || flag) { if(!FurnaceRecipes.instance().getSmeltingResult(stack).isEmpty()) { return true; } } } return false; }
@Override public boolean isItemValid(ItemStack stack) { if(!stack.isEmpty()) { if(stack.getItem() instanceof ItemBlock) { for(ItemStack ore : ores) if(OreDictionary.itemMatches(ore, stack, false)) { return true; } } else { ItemStack result = FurnaceRecipes.instance().getSmeltingResult(getStack()); if (result.getItem().equals(Items.field_191525_da)) { return true; } } } return false; }
/** * Gets recipe input without the chars for the shape. */ Object[] getRecipeInput() { Object[] result = new Object[getRecipeWidth() * getRecipeHeight()]; for (int row = 0; row < shape.length; row++) { for (int col = 0; col < shape[0].length(); col++) { RecipeInput input = items.get(shape[row].charAt(col)); int index = col + row * shape[0].length(); if (input != null) { result[index] = input.isOreClass() ? OreDictionary.getOres(input.getOreClass().getOreName()) : input.getStack().getItemStack(); } else { result[index] = ItemStack.EMPTY; } } } return result; }
public static ArrayList<Block> getBlocksFromString(String blockName) { ArrayList<Block> blocks = new ArrayList<>(); if(!HarshenUtils.toArray(Blocks.AIR, null).contains(Block.getBlockFromName(blockName))) blocks.add(Block.getBlockFromName(blockName)); for(ItemStack oreStack : OreDictionary.getOres(blockName)) if(oreStack.getItem() instanceof ItemBlock) blocks.add(((ItemBlock)oreStack.getItem()).getBlock()); ArrayList<Block> finalBlocks = new ArrayList<>(); for(Block b : blocks) { NonNullList<ItemStack> items = NonNullList.create(); b.getSubBlocks(CreativeTabs.SEARCH, items); for(ItemStack stack : items) if(!stack.isEmpty()) finalBlocks.add(Block.getBlockFromItem(stack.getItem())); else finalBlocks.add(b); } return finalBlocks; }
/** * Used to create a list of stacks, from oreDictionary * @param oreDictName A list of OreDictionary value you want to use */ public HarshenStack(String... oreDictNames) { for(String oreDictName : oreDictNames) { NonNullList<ItemStack> stackList = OreDictionary.getOres(oreDictName); if(stackList.isEmpty()) new IllegalArgumentException("Oredictionary vaule " + oreDictName + " doesnt exist").printStackTrace(System.out); else for(ItemStack stack : stackList) if(stack.getMetadata() == OreDictionary.WILDCARD_VALUE) { NonNullList<ItemStack> innerStacklist = NonNullList.create(); stack.getItem().getSubItems(CreativeTabs.SEARCH, innerStacklist); for(ItemStack wildStack : innerStacklist) this.stackList.add(stack.copy()); } else this.stackList.add(stack); } }
@Override public void register(@Nonnull IModRegistry registry) { blacklist = registry.getJeiHelpers().getIngredientBlacklist(); blacklistItem(new ItemStack(ModItems.DANK_NULL_HOLDER, 1, OreDictionary.WILDCARD_VALUE)); List<ItemStack> dankNulls = new ArrayList<ItemStack>(); dankNulls.addAll(Arrays.asList(new ItemStack(ModItems.DANK_NULL, 1, 0), new ItemStack(ModItems.DANK_NULL, 1, 1), new ItemStack(ModItems.DANK_NULL, 1, 2), new ItemStack(ModItems.DANK_NULL, 1, 3), new ItemStack(ModItems.DANK_NULL, 1, 4), new ItemStack(ModItems.DANK_NULL, 1, 5))); registry.addIngredientInfo(dankNulls, ItemStack.class, "jei.danknull.desc"); registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 0), ItemStack.class, "jei.danknull.desc0"); registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 1), ItemStack.class, "jei.danknull.desc1"); registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 2), ItemStack.class, "jei.danknull.desc2"); registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 3), ItemStack.class, "jei.danknull.desc3"); registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 4), ItemStack.class, "jei.danknull.desc4"); registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 5), ItemStack.class, "jei.danknull.desc5"); registry.addIngredientInfo(new ItemStack(ModBlocks.DANKNULL_DOCK), ItemStack.class, "jei.danknull_dock.desc"); }
private static ItemStack parseItemStack(String itemString) { Matcher matcher = itemRegex.matcher(itemString); if (!matcher.matches()) { ToolBelt.logger.warn("Could not parse item " + itemString); return ItemStack.EMPTY; } Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(matcher.group("item"))); if (item == null) { ToolBelt.logger.warn("Could not parse item " + itemString); return ItemStack.EMPTY; } String anyString = matcher.group("meta"); String metaString = matcher.group("meta"); int meta = Strings.isNullOrEmpty(anyString) ? (Strings.isNullOrEmpty(metaString) ? 0 : Integer.parseInt(metaString)) : OreDictionary.WILDCARD_VALUE; return new ItemStack(item, 1, meta); }
public static boolean isItemStackAllowed(final ItemStack stack) { if (stack.getCount() <= 0) return true; if (whiteList.stream().anyMatch((s) -> OreDictionary.itemMatches(s, stack, false))) return true; if (blackList.stream().anyMatch((s) -> OreDictionary.itemMatches(s, stack, false))) return false; if (stack.getItem() instanceof ItemToolBelt) return false; if (stack.getMaxStackSize() != 1) return false; return true; }
/** * Method invoked by FML before any other mods are loaded. */ public static void initialize() { FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion()); OreDictionary.getOreName(0); UsernameCache.load(); // Load before all the mods, so MC owns the MC fluids FluidRegistry.validateFluidRegistry(); ForgeHooks.initTools(); //For all the normal CrashReport classes to be defined. We're in MC's classloader so this should all be fine new CrashReport("ThisIsFake", new Exception("Not real")); }
@Load public void loadLiqueurs() { ForgeRegistries.ITEMS.getKeys().stream().filter(s -> s.getResourcePath().contains("liqueur")).map(ForgeRegistries.ITEMS::getValue).forEach(liqueur -> { for (LiqueurType liqueurType : LiqueurTypes.values()) { if (liqueurType == LiqueurTypes.NORMAL) continue; ItemLiqueur typedLiqueur = new ItemLiqueur(MathHelper.floor(liqueurType.getHealModifier() * ((ItemFood) liqueur).getHealAmount(new ItemStack(liqueur)))); typedLiqueur.setLiqueurType(liqueurType); typedLiqueur.setRegistryName(liqueur.getRegistryName().getResourceDomain(), liqueurType.getUnlocalizedName() + "_" + liqueur.getRegistryName().getResourcePath()); typedLiqueur.setUnlocalizedName(liqueur.getUnlocalizedName()); ForgeRegistries.ITEMS.register(typedLiqueur); OreDictionary.registerOre("listAll" + StringUtils.capitalize(liqueurType.getUnlocalizedName()) + "liqueur", typedLiqueur); OreDictionary.registerOre("listAllliqueur", typedLiqueur); OreDictionary.registerOre("listAllfoods", typedLiqueur); cachedLiqueurs.add(typedLiqueur); } }); }
public CachedPatternRecipe(EnumBannerPattern pattern, String[] grid, List<Object> inputs) { this.pattern = pattern; for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) { char c = grid[y].charAt(x); if (c != ' ') { Object input = inputs.get(inputs.indexOf(c) + 1); if (input instanceof String) input = OreDictionary.getOres((String) input); PositionedStack stack = new PositionedStack(input, 25 + x * 18, 6 + y * 18); stack.setMaxSize(1); ingredients.add(stack); } } }
@EventHandler public void init(FMLInitializationEvent event) { NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); ModRecipes.init(); proxy.registerEvents(); proxy.registerEntities(); proxy.registerRenderers(); if (ModEntityList.hasEntitiesWithEggs()) { ModEntityList.entity_egg = new ItemEntityEgg(); GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg"); OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg); } isTinkersConstructLoaded = Loader.isModLoaded("TConstruct"); }
public List<ItemStack> getItemStacks() { if (isOreDictionary) { return OreDictionary.getOres(itemName, false); } Item item = RegistryUtil.getItemFromRegistry(itemName); if (item == null) return Collections.emptyList(); List<ItemStack> single = new ArrayList<>(); ItemStack stack = new ItemStack(item, stackSize, getDamage()); stack.setTagCompound(getNbt()); single.add(stack); return single; }
public static boolean stackMatchesRecipeInput(ItemStack stack, RecipeInput input, boolean checkCount) { if (input.isItemStack()) { ItemStack inputStack = input.getStack().getItemStack(); if (OreDictionary.itemMatches(inputStack, stack, false) && (!checkCount || inputStack.getCount() <= stack.getCount())) return true; } else { if (OreDictionary.containsMatch(false, OreDictionary.getOres(input.getOreClass().getOreName()), stack)) return true; } return false; }
/** * Returns a string representation of the item which can also be used in scripts */ @SuppressWarnings("rawtypes") public static String getStackDescription(Object object) { if(object instanceof IIngredient) { return getStackDescription((IIngredient) object); } else if(object instanceof ItemStack) { return toIItemStack((ItemStack) object).toString(); } else if(object instanceof FluidStack) { return getStackDescription((FluidStack) object); } else if(object instanceof Block) { return toIItemStack(new ItemStack((Block) object, 1, 0)).toString(); } else if(object instanceof String) { // Check if string specifies an oredict entry List<ItemStack> ores = OreDictionary.getOres((String) object); if(!ores.isEmpty()) { return "<ore:" + (String) object + ">"; } else { return "\"" + (String) object + "\""; } } else if(object instanceof List) { return getListDescription((List) object); } else if(object instanceof Object[]) { return getListDescription(Arrays.asList((Object[]) object)); } else if(object != null) { return "\"" + object.toString() + "\""; } else if(object instanceof Ingredient && !((Ingredient) object).apply(ItemStack.EMPTY) && ((Ingredient) object).getMatchingStacks().length > 0) { return getStackDescription(((Ingredient) object).getMatchingStacks()[0]); } else { return "null"; } }
@Override public void registerOreDictNames() { Stream.of(ExPOreDict.blockLog).forEach(s -> { OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); AtomicInteger i = new AtomicInteger(1); ExPBlockProperties.TREE_TYPE.getAllowedValues().stream().map(EnumTreeType::getName).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndAdd(3)))); }); }
@Override public void registerOreDictNames() { Stream.of(ExPOreDict.blockSand).forEach(s -> { OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); AtomicInteger i = new AtomicInteger(0); Stream.of(ExPOreDict.rockNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement()))); }); }
/** Set the ores that can repair this sword */ public SwordCustomRepair addRepairOres(String... repair) { for(String name : repair) { List<ItemStack> stacks = OreDictionary.getOres(name); repairStacks.join(stacks); } return this; }
/** * Check if the stack is a valid item for this slot. Always true beside for * the armor slots. */ @Override public boolean isItemValid(@Nonnull ItemStack stack) { if (itemAllowed != null) { Item item = stack.isEmpty() ? null : stack.getItem(); return item == itemAllowed; } else { int[] ids = OreDictionary.getOreIDs(stack); for (int id : ids) { if (id == oreDictEntry) return true; if (dye && TileEntityPlasticMixer.getDyeIndex(stack) >= 0) return true; } return false; } }
public static boolean isSameOreDictStack(ItemStack stack1, ItemStack stack2) { int[] oredictIds = OreDictionary.getOreIDs(stack1); for (int oredictId : oredictIds) { List<ItemStack> oreDictStacks = OreDictionary.getOres(OreDictionary.getOreName(oredictId)); for (ItemStack oreDictStack : oreDictStacks) { if (OreDictionary.itemMatches(oreDictStack, stack2, false)) { return true; } } } return false; }
public static boolean areItemStacksEqualIgnoreSize(ItemStack template, ItemStack tested) { if (template == null)//STACKNULL { return tested == null; } else if (tested == null)//STACKNULL { return false; } return template.getItem() == tested.getItem() && (template.getMetadata() == tested.getMetadata() || template.getMetadata() == OreDictionary.WILDCARD_VALUE); }
public static void addOreDictEntries() { OreDictionary.registerOre(Names.INGOT_IRON_COMPRESSED, Itemss.INGOT_IRON_COMPRESSED); OreDictionary.registerOre(Names.BLOCK_IRON_COMPRESSED, Blockss.COMPRESSED_IRON); for(int i = 0; i < ItemPlastic.ORE_NAMES.length; i++){ OreDictionary.registerOre(ItemPlastic.ORE_NAMES[i], new ItemStack(Itemss.PLASTIC, 1, i)); } }
public static boolean matchesOreName(String oreName, ItemStack stack) { if (!OreDictionary.doesOreNameExist(oreName)) return false; NonNullList<ItemStack> oreItems = OreDictionary.getOres(oreName); for(ItemStack oreItem : oreItems) { if (OreDictionary.itemMatches(stack, oreItem, false)) return true; } return false; }
protected boolean worksWith(final Block referenceBlock, final int referenceMetadata) { for (ItemStack stack : blocks) { if (stack != null && stack.getItem() instanceof ItemBlock) { final ItemBlock item = (ItemBlock) stack.getItem(); final Block supportedBlock = item.getBlock(); final int supportedMetadata = item.getMetadata(stack.getItemDamage()); if (referenceBlock == supportedBlock && (referenceMetadata == supportedMetadata || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) { return true; } } } return false; }
private List<ItemStack> getOres() { if (ores != null) return ores; // cache the ore list by making use of the fact that forge always uses the same list, // unless it's EMPTY_LIST, which should never happen. List<ItemStack> ret = OreDictionary.getOres(input); if (ret != OreDictionary.EMPTY_LIST) ores = ret; return ret; }
@ZenMethod public static void add(IItemStack output, ILiquidStack liquid, @NotNull IItemStack stamp, @Optional IItemStack input) { ItemStack stack = InputHelper.toStack(input); ItemStack stampStack = InputHelper.toStack(stamp); //This is pointless but also the easiest way. ItemStampingRecipe recipe = new ItemStampingRecipe(stack,InputHelper.toFluid(liquid), EnumStampType.getType(stampStack),InputHelper.toStack(output),stack.getMetadata() != OreDictionary.WILDCARD_VALUE,stack.hasTagCompound()); CraftTweakerAPI.apply(new Add(recipe)); }
@Override public void registerOreDictNames() { Stream.of(ExPOreDict.blockGrass).forEach(s -> { OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); AtomicInteger i = new AtomicInteger(0); Stream.of(ExPOreDict.soilNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement()))); }); }
@Load public void registerFoods() { for (Field field : FCRFoods.class.getFields()) { field.setAccessible(true); try { RegFood anno = field.getDeclaredAnnotation(RegFood.class); if (anno == null) { Object food = field.get(null); if (food instanceof ItemPorridge) registerPorridge((ItemPorridge) food); else if (food instanceof ItemSoup) registerSoup((ItemSoup) food); else if (food instanceof ItemNoodles) registerNoodles((ItemNoodles) food); else if (food instanceof ItemLiqueur) registerLiqueur((ItemLiqueur) food); continue; } ItemPFood item = (ItemPFood) field.get(null); if (ArrayUtils.isNotEmpty(anno.modifier())) item.setProperties(anno.modifier()); if (anno.amount() == Integer.MIN_VALUE) item.calcHealAmount(); else item.setHealAmount(anno.amount()); ForgeRegistries.ITEMS.register(item.setRegistryName(FoodCraftReloaded.MODID, NameBuilder.buildRegistryName(anno.name())).setUnlocalizedName(NameBuilder.buildUnlocalizedName(anno.name()))); 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); } } }
public static NonNullList<ItemStack> getRealOredictedItems(String oredit) { NonNullList<ItemStack> stacks = NonNullList.create(); for (ItemStack ore : OreDictionary.getOres(oredit)) { if (ore.getMetadata() == OreDictionary.WILDCARD_VALUE && ore.getItem().getCreativeTab() != null) ore.getItem().getSubItems(ore.getItem().getCreativeTab(), stacks); else { stacks.add(ore); break; } } return stacks; }
public static void registerItems(IForgeRegistry<Item> itemRegistry) { (tinyDryRubber = new IFCustomItem("tinydryrubber")).register(itemRegistry); (dryRubber = new IFCustomItem("dryrubber")).register(itemRegistry); RecipeUtils.addShapelessRecipe(new ItemStack(dryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber)); (plastic = new IFCustomItem("plastic")).register(itemRegistry); OreDictionary.registerOre("itemRubber", plastic); GameRegistry.addSmelting(dryRubber, new ItemStack(plastic), 0); (fertilizer = new IFCustomItem("fertilizer")).register(itemRegistry); (meatFeederItem = new MeatFeederItem()).register(itemRegistry); (mobImprisonmentToolItem = new MobImprisonmentToolItem()).register(itemRegistry); (laserLensItem = new LaserLensItem(false)).register(itemRegistry); (laserLensItem_inverted = new LaserLensItem(true)).register(itemRegistry); (strawItem = new ItemStraw()).register(itemRegistry); (pinkSlime = new IFCustomItem("pink_slime")).register(itemRegistry); (bookManualItem = new BookManualItem()).register(itemRegistry); (adultFilterAddomItem = new AdultFilterAddonItem()).registerItem(itemRegistry); (rangeAddonItem = new RangeAddonItem()).registerItem(itemRegistry); (energyFieldAddon = new EnergyFieldAddon()).registerItem(itemRegistry); (leafShearingAddonItem = new LeafShearingAddonItem()).registerItem(itemRegistry); meatFeederItem.createRecipe(); mobImprisonmentToolItem.createRecipe(); laserLensItem.createRecipe(); laserLensItem_inverted.createRecipe(); adultFilterAddomItem.createRecipe(); rangeAddonItem.createRecipe(); energyFieldAddon.createRecipe(); bookManualItem.createRecipe(); leafShearingAddonItem.createRecipe(); }
public static final void commonInit() { OreDictionary.registerOre("gearStone", ModItems.itemStoneGear); OreDictionary.registerOre("gearIron", ModItems.itemIronGear); OreDictionary.registerOre("gearTin", ModItems.itemTinGear); OreDictionary.registerOre("gearCopper", ModItems.itemCopperGear); OreDictionary.registerOre("gearGold", ModItems.itemGoldGear); OreDictionary.registerOre("gearDiamond", ModItems.itemDiamondGear); LogUtils.info("Registered ore dictionary materials."); }
public static List<String> getOreNames(ItemStack stack) { List<String> res = new ArrayList<>(); for (int id : OreDictionary.getOreIDs(stack)) { res.add(OreDictionary.getOreName(id)); } return res; }
@Override public List<OreDictionaryEntry> getOreEntries(ItemStack itemStack) { int[] ids = OreDictionary.getOreIDs(CraftItemStack.asNMSCopy(itemStack)); ImmutableList.Builder<OreDictionaryEntry> builder = ImmutableList.builder(); for (int id : ids) { builder.add(OreDictionaryEntry.valueOf(id)); } return builder.build(); }
public static final boolean matches(String template, ItemStack item) { boolean templatePresent = template!=null && !template.isEmpty(); boolean itemPresent = item!=null && !item.isEmpty(); if (!templatePresent && itemPresent) return false; // Empty != NonEmpty if ( templatePresent && !itemPresent) return false; // NonEmpty != Empty if (!templatePresent && !itemPresent) return true; // Empty == Empty if (!OreDictionary.doesOreNameExist(template)) return false; NonNullList<ItemStack> ores = OreDictionary.getOres(template); return OreDictionary.containsMatch(false, ores, item); }
@Override public List<ItemStack> getDefinitions(OreDictionaryEntry entry) { @SuppressWarnings("deprecation") List<net.minecraft.item.ItemStack> items = OreDictionary.getOres(entry.getId()); ImmutableList.Builder<ItemStack> builder = ImmutableList.builder(); for (net.minecraft.item.ItemStack nmsItem : items) { builder.add(CraftItemStack.asCraftMirror(nmsItem)); } return builder.build(); }
@Override public void registerOreDictNames() { Stream.of(ExPOreDict.itemSeeds).forEach(s -> { OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); AtomicInteger i = new AtomicInteger(0); Stream.of(ExPOreDict.cropNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement()))); }); }