本文整理汇总了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());
}
示例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);
}
}
示例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());
}
}
示例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);
}