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


Java Block.REGISTRY属性代码示例

本文整理汇总了Java中net.minecraft.block.Block.REGISTRY属性的典型用法代码示例。如果您正苦于以下问题:Java Block.REGISTRY属性的具体用法?Java Block.REGISTRY怎么用?Java Block.REGISTRY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.block.Block的用法示例。


在下文中一共展示了Block.REGISTRY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initMiningStats

private static void initMiningStats()
{
    for (Block block : Block.REGISTRY)
    {
        Item item = Item.getItemFromBlock(block);

        if (item != Items.field_190931_a)
        {
            int i = Block.getIdFromBlock(block);
            String s = getItemName(item);

            if (s != null && block.getEnableStats())
            {
                BLOCKS_STATS[i] = (new StatCrafting("stat.mineBlock.", s, new TextComponentTranslation("stat.mineBlock", new Object[] {(new ItemStack(block)).getTextComponent()}), item)).registerStat();
                MINE_BLOCK_STATS.add((StatCrafting)BLOCKS_STATS[i]);
            }
        }
    }

    replaceAllSimilarBlocks(BLOCKS_STATS);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:StatList.java

示例2: loadBlocks

protected void loadBlocks()
{
    BlockStateMapper blockstatemapper = this.blockModelShapes.getBlockStateMapper();

    for (Block block : Block.REGISTRY)
    {
        for (final ResourceLocation resourcelocation : blockstatemapper.getBlockstateLocations(block))
        {
            try
            {
                loadBlock(blockstatemapper, block, resourcelocation);
            }
            catch (Exception exception)
            {
                LOGGER.warn((String)("Unable to load definition " + resourcelocation), (Throwable)exception);
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:ModelBakery.java

示例3: registerModels

/**
 * Register all Item and Block models from the registry.
 */
public static void registerModels() {
	for (Block block : Block.REGISTRY) {
		if (block instanceof IModelRegister)
			((IModelRegister) block).registerModel();
	}

	for (Item item : Item.REGISTRY) {
		if (item instanceof IModelRegister)
			((IModelRegister) item).registerModel();
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:14,代码来源:ModelHandler.java

示例4: registerModels

public static void registerModels() {
	for(Block block : Block.REGISTRY) {
		if(block instanceof IModel)
			((IModel) block).registerModel();
	}

	for(Item item : Item.REGISTRY) {
		if(item instanceof IModel)
			((IModel) item).registerModel();
	}
	Solar.LOG.info("[BAKING CHOCOLATE COOKIES!]");
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:12,代码来源:ModelHandler.java

示例5: putAllStateModelLocations

public Map<IBlockState, ModelResourceLocation> putAllStateModelLocations()
{
    Map<IBlockState, ModelResourceLocation> map = Maps.<IBlockState, ModelResourceLocation>newIdentityHashMap();

    for (Block block : Block.REGISTRY)
    {
        map.putAll(this.getVariants(block));
    }

    return map;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:BlockStateMapper.java

示例6: loadBlocks

private void loadBlocks()
{
    BlockStateMapper blockstatemapper = this.blockModelShapes.getBlockStateMapper();

    for (Block block : Block.REGISTRY)
    {
        for (final ResourceLocation resourcelocation : blockstatemapper.getBlockstateLocations(block))
        {
            try
            {
                ModelBlockDefinition modelblockdefinition = this.getModelBlockDefinition(resourcelocation);
                Map<IBlockState, ModelResourceLocation> map = blockstatemapper.getVariants(block);

                if (modelblockdefinition.hasMultipartData())
                {
                    Collection<ModelResourceLocation> collection = Sets.newHashSet(map.values());
                    modelblockdefinition.getMultipartData().setStateContainer(block.getBlockState());
                    Collection<ModelResourceLocation> collection1 = (Collection)this.multipartVariantMap.get(modelblockdefinition);

                    if (collection1 == null)
                    {
                        collection1 = Lists.<ModelResourceLocation>newArrayList();
                        this.multipartVariantMap.put(modelblockdefinition, collection1);
                    }

                    collection1.addAll(Lists.newArrayList(Iterables.filter(collection, new Predicate<ModelResourceLocation>()
                    {
                        public boolean apply(@Nullable ModelResourceLocation p_apply_1_)
                        {
                            return resourcelocation.equals(p_apply_1_);
                        }
                    })));
                }

                for (Entry<IBlockState, ModelResourceLocation> entry : map.entrySet())
                {
                    ModelResourceLocation modelresourcelocation = (ModelResourceLocation)entry.getValue();

                    if (resourcelocation.equals(modelresourcelocation))
                    {
                        try
                        {
                            this.variants.put(modelresourcelocation, modelblockdefinition.getVariant(modelresourcelocation.getVariant()));
                        }
                        catch (RuntimeException var12)
                        {
                            if (!modelblockdefinition.hasMultipartData())
                            {
                                LOGGER.warn("Unable to load variant: {} from {}", new Object[] {modelresourcelocation.getVariant(), modelresourcelocation});
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                LOGGER.warn("Unable to load definition {}", new Object[] {resourcelocation, exception});
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:61,代码来源:ModelBakery.java


注:本文中的net.minecraft.block.Block.REGISTRY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。