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


Java StateMap.Builder方法代码示例

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


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

示例1: initModel

import net.minecraft.client.renderer.block.statemap.StateMap; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
   public void initModel() {
	ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
       StateMap.Builder ignorePower = new StateMap.Builder();
       ModelLoader.setCustomStateMapper(this, ignorePower.build());
   }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:8,代码来源:BlockExternalInterface.java

示例2: registerModel

import net.minecraft.client.renderer.block.statemap.StateMap; //导入方法依赖的package包/类
public static void registerModel(Item item,String[] variants)
{

    if(item instanceof ItemBlock && ((ItemBlock)item).getBlock() instanceof IDFABlock)
    {
        IDFABlock block = (IDFABlock) ((ItemBlock)item).getBlock();
        Class clazz = block.getVariantEnum();

        IProperty[] ignored = block.getIgnoredProperties();
        if(ignored != null  && ignored.length > 0)
        {
            StateMap.Builder builder = new StateMap.Builder();
            for(IProperty p : ignored)
                builder.ignore(p);

            ModelLoader.setCustomStateMapper((Block)block,builder.build());
        }

        if(clazz != null)
        {
            //TODO:register the variants
            return;
        }



    }

    for(int i = 0; i < variants.length; i++)
    {
        String name = LibResources.PREFIX+variants[i];
        ModelResourceLocation loc = new ModelResourceLocation(name,"inventory");
        System.out.println(loc);
        ModelLoader.setCustomModelResourceLocation(item,i,loc);
    }
}
 
开发者ID:Fancysaurus,项目名称:DFArtifacts,代码行数:37,代码来源:ModelHandler.java

示例3: ReduxBlock

import net.minecraft.client.renderer.block.statemap.StateMap; //导入方法依赖的package包/类
public ReduxBlock(Pack parentPack, Block reduxBlock) {
    super(reduxBlock.getMaterial());
    this.pack = parentPack;
    this.reduxBlock = reduxBlock;

    setUnlocalizedName(reduxBlock.getName());
    setCreativeTab(reduxBlock.getCreativeTab());

    IBlockState defaultBlockState = this.blockState.getBaseState().withProperty(SUCCESS_COUNT_META, 0);
    if (reduxBlock.shouldAddFacingProperty())
        defaultBlockState = defaultBlockState.withProperty(FACING, null);
    if (reduxBlock.getCustomProperties() != null) {
        for (Flags<String, Integer> customProperty : reduxBlock.getCustomProperties()) {
            PropertyInteger customIntegerProperty = PropertyInteger.create(customProperty.getKey(), Integer.MIN_VALUE, Integer.MAX_VALUE);
            customBlockProperties.put(customProperty.getKey(), customIntegerProperty);
            defaultBlockState = defaultBlockState.withProperty(customIntegerProperty, customProperty.getValue());
        }
    }
    this.setDefaultState(defaultBlockState);

    if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
        StateMap.Builder stateMapBuilder = (new StateMap.Builder()).addPropertiesToIgnore(SUCCESS_COUNT_META);
        if (reduxBlock.getIgnoredProperties() != null) {
            for (String s : reduxBlock.getIgnoredProperties()) {
                PropertyInteger propertyInteger = customBlockProperties.get(s);
                if (propertyInteger != null) {
                    stateMapBuilder.addPropertiesToIgnore(propertyInteger);
                }
            }
        }
        FMLClientHandler.instance().getClient().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(this, stateMapBuilder.build());
    }
}
 
开发者ID:Quiddity-Modding,项目名称:Redux,代码行数:34,代码来源:ReduxBlock.java

示例4: registerBlockWithStateBuilder

import net.minecraft.client.renderer.block.statemap.StateMap; //导入方法依赖的package包/类
private static void registerBlockWithStateBuilder(Block block, StateMap.Builder builder)
{
	ModelLoader.setCustomStateMapper(block, builder.build());
	registerBlock(block);
}
 
开发者ID:hero887,项目名称:Tannery,代码行数:6,代码来源:TanneryBlocks.java


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