当前位置: 首页>>代码示例>>Java>>正文


Java类net.minecraftforge.oredict.OreDictionary代码示例

以下是Javanet.minecraftforge.oredict.OreDictionary的代码示例。类OreDictionary属于net.minecraftforge.oredict包,如果您正苦于以下问题:Java OreDictionary类的具体用法?Java OreDictionary怎么用?Java OreDictionary使用的例子?那么恭喜您, 这里整理的类代码示例例程将为您提供帮助。

本文一共展示了OreDictionary的39个开源代码实例,这些例子默认根据受欢迎程度排序。您可以为喜欢的代码打CALL点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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");
}
 
开发者ID:jm-organization,项目:connor41-etfuturum2,完整代码来源:EtFuturum.java


示例2: register

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/**
     * 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);
                });
        });
    }
 
开发者ID:LasmGratel,项目:FoodCraft-Reloaded,完整代码来源:EnumLoader.java


示例3: matches

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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;
}
 
开发者ID:Herobone,项目:HeroUtils,完整代码来源:RecipeInputOreDict.java


示例4: ContainerSmelter

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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));
	}
 
开发者ID:ArtixAllMighty,项目:ExSartagine,完整代码来源:ContainerSmelter.java


示例5: isItemValid

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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;
}
 
开发者ID:ArtixAllMighty,项目:ExSartagine,完整代码来源:SlotPanInput.java


示例6: isItemValid

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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;
}
 
开发者ID:ArtixAllMighty,项目:ExSartagine,完整代码来源:SlotSmelterInput.java


示例7: getRecipeInput

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:cubex2,项目:customstuff4,完整代码来源:ShapedRecipe.java


示例8: getBlocksFromString

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:kenijey,项目:harshencastle,完整代码来源:HarshenUtils.java


示例9: HarshenStack

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/**
 * 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);
	}
}
 
开发者ID:kenijey,项目:harshencastle,完整代码来源:HarshenStack.java


示例10: register

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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");

}
 
开发者ID:p455w0rd,项目:DankNull,完整代码来源:JEI.java


示例11: parseItemStack

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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);
}
 
开发者ID:gigaherz,项目:ToolBelt,完整代码来源:Config.java


示例12: isItemStackAllowed

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:gigaherz,项目:ToolBelt,完整代码来源:Config.java


示例13: initialize

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/**
 * 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"));
}
 
开发者ID:F1r3w477,项目:CustomWorldGen,完整代码来源:MinecraftForge.java


示例14: loadLiqueurs

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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);
        }
    });
}
 
开发者ID:LasmGratel,项目:FoodCraft-Reloaded,完整代码来源:LiqueurLoader.java


示例15: CachedPatternRecipe

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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);
			}
		}
}
 
开发者ID:jm-organization,项目:connor41-etfuturum2,完整代码来源:BannerPatternHandler.java


示例16: getItemStacks

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:einsteinsci,项目:BetterBeginningsReborn,完整代码来源:JsonLoadedItemStack.java


示例17: stackMatchesRecipeInput

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:cubex2,项目:customstuff4,完整代码来源:ItemHelper.java


示例18: getStackDescription

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/**
 * 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";
    }
}
 
开发者ID:TeamPneumatic,项目:pnc-repressurized,完整代码来源:Helper.java


示例19: registerOreDictNames

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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))));
	});
}
 
开发者ID:V0idWa1k3r,项目:ExPetrum,完整代码来源:BlockLog.java


示例20: registerOreDictNames

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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())));
	});
}
 
开发者ID:V0idWa1k3r,项目:ExPetrum,完整代码来源:BlockSand.java


示例21: addRepairOres

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/** 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;
}
 
开发者ID:sblectric,项目:AdvancedCombat,完整代码来源:SwordCustomRepair.java


示例22: isItemValid

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
/**
 * 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;
    }
}
 
开发者ID:TeamPneumatic,项目:pnc-repressurized,完整代码来源:SlotItemSpecific.java


示例23: isSameOreDictStack

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:TeamPneumatic,项目:pnc-repressurized,完整代码来源:PneumaticCraftUtils.java


示例24: areItemStacksEqualIgnoreSize

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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);
   }
 
开发者ID:einsteinsci,项目:BetterBeginningsReborn,完整代码来源:Util.java


示例25: addOreDictEntries

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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));
    }
}
 
开发者ID:TeamPneumatic,项目:pnc-repressurized,完整代码来源:OreDictionaryHelper.java


示例26: matchesOreName

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:elytra,项目:Thermionics,完整代码来源:ToolHelper.java


示例27: worksWith

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:Herobone,项目:HeroUtils,完整代码来源:DriverSidedBlock.java


示例28: getOres

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:Herobone,项目:HeroUtils,完整代码来源:RecipeInputOreDict.java


示例29: add

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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));
}
 
开发者ID:DaedalusGame,项目:Soot,完整代码来源:Stamper.java


示例30: registerOreDictNames

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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())));
	});
}
 
开发者ID:V0idWa1k3r,项目:ExPetrum,完整代码来源:BlockGrass.java


示例31: registerFoods

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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);
        }
    }
}
 
开发者ID:LasmGratel,项目:FoodCraft-Reloaded,完整代码来源:PropertiedFoodLoader.java


示例32: getRealOredictedItems

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:Buuz135,项目:Industrial-Foregoing,完整代码来源:RecipeHandlers.java


示例33: registerItems

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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();
}
 
开发者ID:Buuz135,项目:Industrial-Foregoing,完整代码来源:ItemRegistry.java


示例34: commonInit

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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.");
}
 
开发者ID:cjburkey01,项目:MiningWells,完整代码来源:ModOreDictionary.java


示例35: getOreNames

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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;
}
 
开发者ID:einsteinsci,项目:BetterBeginningsReborn,完整代码来源:RegistryUtil.java


示例36: getOreEntries

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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();
}
 
开发者ID:UraniumMC,项目:Uranium,完整代码来源:OreDictionaryInterface.java


示例37: matches

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
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);
}
 
开发者ID:elytra,项目:Thermionics,完整代码来源:OreItems.java


示例38: getDefinitions

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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();
}
 
开发者ID:UraniumMC,项目:Uranium,完整代码来源:OreDictionaryInterface.java


示例39: registerOreDictNames

import net.minecraftforge.oredict.OreDictionary; //导入依赖的package包/类
@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())));
	});
}
 
开发者ID:V0idWa1k3r,项目:ExPetrum,完整代码来源:ItemSeeds.java



注:本文示例均筛选自Github等开源项目,代码版权请参考对应项目的License;未经允许,请勿转载。