Java 类net.minecraft.client.renderer.block.statemap.StateMap 实例源码

项目:BetterWithAddons    文件:ClientProxy.java   
public void registerModels()
{
    ItemModels.register();
    //BlockModels.register();

    ModelLoader.setCustomStateMapper(ModBlocks.thorns,new StateMap.Builder().ignore(BlockThorns.FACING).build());
    ModelLoader.setCustomStateMapper(ModBlocks.brine, new BrineStateMapper());
    ModelLoader.setCustomStateMapper(ModBlocks.aqueductWater, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return aqueductWaterLocation;
        }
    });

    RenderingRegistry.registerEntityRenderingHandler(EntityGreatarrow.class, RenderGreatarrow.GREATARROW_RENDER);
    RenderingRegistry.registerEntityRenderingHandler(EntityYa.class, RenderYa.YA_RENDER);
    RenderingRegistry.registerEntityRenderingHandler(EntitySpirit.class, manager -> new RenderSpirit(manager));
    RenderingRegistry.registerEntityRenderingHandler(EntityAncestryBottle.class, manager -> new RenderSnowball<>(manager,ModItems.ancestryBottle,Minecraft.getMinecraft().getRenderItem()));
    RenderingRegistry.registerEntityRenderingHandler(EntityArtifactFrame.class, RenderArtifactFrame.ARTIFACEFRAME_RENDER);
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAlchDragon.class, new RenderAlchDragon());
}
项目:Overlord    文件:Overlord.java   
@SideOnly(Side.CLIENT)
public static void registerItemRenders() {
    rmm(skeleton_maker);
    rmm(baby_skeleton_maker);
    rmm(overlords_seal);
    rmm(overlords_stamp);
    rmm(squad_editor);
    rmm(sans_mask);
    rmm(skinsuit);
    rmm(skinsuit_mummy);
    rmm(warrior_spawner);
    rmm(baby_spawner);
    rmm(converted_spawner);
    rmm(milk_bottle);
    rmm(keychain);
    rmm(keychain_occupied);
    rmm(crown);
    rmm(rallying_horn);
    IStateMapper skeleton_maker_mapper = new StateMap.Builder().ignore(BlockSkeletonMaker.TRIGGERED).build();
    ModelLoader.setCustomStateMapper(skeleton_maker, skeleton_maker_mapper);
    ModelLoader.setCustomStateMapper(baby_skeleton_maker, skeleton_maker_mapper);
}
项目:CommonUtils    文件:ModInitializerClient.java   
private void registerVariantBlocks(ProxyModBase proxy) {
    for (InfoBlock block : proxy.blocks) {
        if (!(block instanceof InfoBlockVariant))
            continue;
        InfoBlockVariant blockVar = (InfoBlockVariant) block;
        List<String> variants = Lists.newArrayList();
        for (Object metalObj : blockVar.getVariantProp().getAllowedValues()) {
            IStringSerializable value = (IStringSerializable) metalObj;
            String name = proxy.getModId() + ":" + value.getName() + blockVar.getVariantSuffix();
            variants.add(name);
        }
        ModelBakery.registerItemVariants(Item.getItemFromBlock(block.getBlock()),
                variants.stream().map(ResourceLocation::new).toArray(ResourceLocation[]::new));

        ModelLoader.setCustomStateMapper(block.getBlock(),
                (new StateMap.Builder()).withName(blockVar.getVariantProp())
                        .withSuffix(blockVar.getVariantSuffix())
                        .build());
    }
}
项目:Tannery    文件:TanneryBlocks.java   
public static void init()
{
    butcherBench = new BlockButchersBench();
    registerBlock(butcherBench);
    GameRegistry.registerTileEntity(TileEntityButchersBench.class, "tileEntityButchersBench");

    gallows = new BlockGallows();
    registerBlockWithCustomItemBlock(gallows, ItemGallows.class);
    GameRegistry.registerTileEntity(TileEntityGallows.class, "tileEntityGallows");

    quebrachoSapling = new BlockSaplingQuebracho();
    registerBlockWithStateBuilder(quebrachoSapling,
            new StateMap.Builder().addPropertiesToIgnore(BlockSaplingQuebracho.TYPE, BlockSaplingQuebracho.STAGE));
    quebrachoLog = new BlockLogQuebracho();
    registerBlockWithStateBuilder(quebrachoLog, new StateMap.Builder().addPropertiesToIgnore(BlockLogQuebracho.VARIANT));
    quebrachoLeaves = new BlockLeavesQuebracho();
    registerBlock(quebrachoLeaves);
}
项目:HomeSweetHome    文件:ClientProxy.java   
@Override
public void registerNonRenderingProperties(Block block) 
{
    if (block instanceof IHSHBlock)
    {
        IHSHBlock hshBlock = (IHSHBlock)block;
        IProperty[] nonRenderingProperties = hshBlock.getNonRenderingProperties();

        if (nonRenderingProperties != null)
        {
            // use a custom state mapper which will ignore the properties specified in the block as being non-rendering
            IStateMapper custom_mapper = (new StateMap.Builder()).ignore(nonRenderingProperties).build();
            ModelLoader.setCustomStateMapper(block, custom_mapper);
        }
    }
}
项目:Production-Line    文件:PLModelRegistry.java   
public static void loadBlockModels() {
    registerBlockModel(PLBlocks.oreIridium);
    registerBlockModel(PLBlocks.airBrakeCasing);
    registerBlockModel(PLBlocks.compressedWaterHyacinth);
    registerBlockModel(PLBlocks.dehydratedWaterHyacinthblock);

    ModelLoader.setCustomStateMapper(PLBlocks.machine, new StateMap.Builder().withName(BlockMachine.PROPERTY_TYPE).build());
    registerBlockModel(PLBlocks.carbonizeFurnace);
    registerBlockModel(PLBlocks.heatDryer);
    registerBlockModel(PLBlocks.evsu);
    registerBlockModel(PLBlocks.cseu);
    registerBlockModel(PLBlocks.parallelSpaceSU);
    registerBlockModel(PLBlocks.advSolar);
    registerBlockModel(PLBlocks.fluidKineticGenerator);
    registerBlockModel(PLBlocks.packager);
}
项目:FloodLights    文件:ClientProxy.java   
@Override
public void preInit() {
    registerBlockModelAsItem(ModBlocks.blockElectricLight, 0 , Names.Blocks.ELECTRIC_FLOODLIGHT);
    registerBlockModelAsItem(ModBlocks.blockCarbonLight, 0 , Names.Blocks.CARBON_FLOODLIGHT);
    registerBlockModelAsItem(ModBlocks.blockUVLight, 0 , Names.Blocks.UV_FLOODLIGHT);
    registerBlockModelAsItem(ModBlocks.blockGrowLight, 0 , Names.Blocks.GROW_LIGHT);
    registerBlockModelAsItem(ModBlocks.blockSmallElectricLight, 0 , Names.Blocks.SMALL_ELECTRIC_FLOODLIGHT,"inventory_strip");
    registerBlockModelAsItem(ModBlocks.blockSmallElectricLight, 1 , Names.Blocks.SMALL_ELECTRIC_FLOODLIGHT,"inventory_square");
    registerItemModel(ModItems.carbonDissolver, 0);
    registerItemModel(ModItems.carbonLantern, 0);
    registerItemModel(ModItems.glowingFilament, 0);
    registerItemModel(ModItems.lightBulb, 0);
    registerItemModel(ModItems.lightDebugTool, 0);
    registerItemModel(ModItems.mantle, 0);
    registerItemModel(ModItems.rawFilament, 0);
    StateMap ignoreColor = new StateMap.Builder().ignore(BlockFLColorableMachine.COLOR).build();
    ModelLoader.setCustomStateMapper(ModBlocks.blockCarbonLight,ignoreColor);
    ModelLoader.setCustomStateMapper(ModBlocks.blockElectricLight,ignoreColor);
    ModelLoader.setCustomStateMapper(ModBlocks.blockUVLight,ignoreColor);
    ModelLoader.setCustomStateMapper(ModBlocks.blockSmallElectricLight, new StateMap.Builder().withName(BlockSmallElectricFloodlight.MODEL).ignore(BlockFLColorableMachine.COLOR).build());
    ModelLoader.setCustomStateMapper(ModBlocks.blockGrowLight, new StateMap.Builder().ignore(BlockFLColorableMachine.COLOR).ignore(BlockFLColorableMachine.FACING).build());
    ModelLoader.setCustomStateMapper(ModBlocks.blockPhantomLight, new StateMap.Builder().ignore(BlockPhantomLight.UPDATE).build());
    ModelLoader.setCustomStateMapper(ModBlocks.blockUVLightBlock, new StateMap.Builder().ignore(BlockPhantomLight.UPDATE).build());
}
项目:GardenStuff    文件:ModBlocks.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerModels (ModelRegistryEvent event) {
    ModelRegistry modelRegistry = Chameleon.instance.modelRegistry;

    modelRegistry.registerItemVariants(stoneMaterial);
    modelRegistry.registerItemVariants(metalMaterial);
    modelRegistry.registerItemVariants(bloomeryFurnace);
    modelRegistry.registerItemVariants(metalFence);
    modelRegistry.registerItemVariants(candelabra);
    modelRegistry.registerItemVariants(candelilla);

    ModelLoader.setCustomStateMapper(metalFence, (new StateMap.Builder()).withName(BlockFence.VARIANT).withSuffix("_wrought_iron_fence").build());
    ModelLoader.setCustomStateMapper(metalLattice, (new StateMap.Builder()).withName(BlockLattice.VARIANT).withSuffix("_lattice").build());
    ModelLoader.setCustomStateMapper(candelabra, (new StateMap.Builder()).withName(BlockCandelabra.VARIANT).withSuffix("_candelabra").build());

    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 0, new ModelResourceLocation("gardenstuff:metal_fence_0", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 1, new ModelResourceLocation("gardenstuff:metal_fence_1", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 2, new ModelResourceLocation("gardenstuff:metal_fence_2", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 3, new ModelResourceLocation("gardenstuff:metal_fence_3", "inventory"));

    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 0, new ModelResourceLocation("gardenstuff:lattice_iron", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 1, new ModelResourceLocation("gardenstuff:lattice_wrought_iron", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 2, new ModelResourceLocation("gardenstuff:lattice_rust", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 3, new ModelResourceLocation("gardenstuff:lattice_aged", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 4, new ModelResourceLocation("gardenstuff:lattice_moss", "inventory"));

    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 0, new ModelResourceLocation("gardenstuff:candelabra_level0", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 1, new ModelResourceLocation("gardenstuff:candelabra_level1", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 2, new ModelResourceLocation("gardenstuff:candelabra_level2", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 3, new ModelResourceLocation("gardenstuff:candelabra_level3", "inventory"));
}
项目:Genesis    文件:GenesisBlocks.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerModels(final ModelRegistryEvent event) {
    for (final Item item : ITEMS) {
        ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
    }
    for (final Block block : BLOCKS) {
        if (block instanceof BlockLeaves) {
            ModelLoader.setCustomStateMapper(block, new StateMap.Builder().ignore(BlockLeaves.CHECK_DECAY, BlockLeaves.DECAYABLE).build());
        }
    }
}
项目:CrystalMod    文件:BlockCrystalLadder.java   
@SideOnly(Side.CLIENT)
  public void initModel(){
    IStateMapper stateMapper = new StateMap.Builder().build();
ModelLoader.setCustomStateMapper(this, stateMapper);
for(WoodType type : WoodType.values()){
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), new ModelResourceLocation(getRegistryName()+"_"+type.getName(), "inventory"));
}
  }
项目:CrystalMod    文件:BlockCustomDoor.java   
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
    IStateMapper stateMapper = new StateMap.Builder().ignore(new IProperty[] {BlockDoor.POWERED}).build();
    ModelLoader.setCustomStateMapper(this, stateMapper);
    ModBlocks.initBasicModel(this);
}
项目:CrystalMod    文件:BlockFancyLadder2.java   
@SideOnly(Side.CLIENT)
  public void initModel(){
    IStateMapper stateMapper = new StateMap.Builder().build();
ModelLoader.setCustomStateMapper(this, stateMapper);
for(FancyLadderType2 type : FancyLadderType2.values()){
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), new ModelResourceLocation(getRegistryName()+"_"+type.getName(), "inventory"));
}
  }
项目:CrystalMod    文件:BlockFancyLadder.java   
@SideOnly(Side.CLIENT)
  public void initModel(){
    IStateMapper stateMapper = new StateMap.Builder().build();
ModelLoader.setCustomStateMapper(this, stateMapper);
for(FancyLadderType type : FancyLadderType.values()){
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), new ModelResourceLocation(getRegistryName()+"_"+type.getName(), "inventory"));
}
  }
项目:CrystalMod    文件:BlockExternalInterface.java   
@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());
   }
项目:CrystalMod    文件:BlockHDDInterface.java   
@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());
   }
项目:DFArtifacts    文件:ModelHandler.java   
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);
    }
}
项目:PackingTape    文件:ClientProxy.java   
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event)
{
    registerItemModel(ModPackingTape.itemTape);
    registerBlockModelAsItem(ModPackingTape.packagedBlock);
    ModelLoader.setCustomStateMapper(ModPackingTape.packagedBlock,(new StateMap.Builder()).ignore(BlockPackaged.UNPACKING).build());
}
项目:Redux    文件:ReduxBlock.java   
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());
    }
}
项目:MoarSigns    文件:ModModelManager.java   
private void registerBlockModels() {
    ModelLoader.setCustomStateMapper(ModBlocks.SIGN_STANDING_WOOD, (new StateMap.Builder()).ignore(new IProperty[]{BlockMoarSignStanding.ROTATION}).build());
    ModelLoader.setCustomStateMapper(ModBlocks.SIGN_STANDING_METAL, (new StateMap.Builder()).ignore(new IProperty[]{BlockMoarSignStanding.ROTATION}).build());
    ModelLoader.setCustomStateMapper(ModBlocks.SIGN_WALL_WOOD, (new StateMap.Builder()).ignore(new IProperty[]{BlockMoarSignWall.ROTATION, BlockMoarSignWall.FACING}).build());
    ModelLoader.setCustomStateMapper(ModBlocks.SIGN_WALL_METAL, (new StateMap.Builder()).ignore(new IProperty[]{BlockMoarSignWall.ROTATION, BlockMoarSignWall.FACING}).build());

    ModBlocks.RegistrationHandler.ITEM_BLOCKS.stream().filter(item -> !itemsRegistered.contains(item)).forEach(this::registerItemModel);
}
项目:enderutilities    文件:ClientProxy.java   
private static void registerItemBlockModels()
{
    registerItemBlockModel(EnderUtilitiesBlocks.ASU, 0, "tier=1");
    registerItemBlockModel(EnderUtilitiesBlocks.BARREL, 0, "creative=false");

    // The Elevators don't have getSubBlocks() overridden, to cut down on JEI item list clutter.
    // And thus registerAllItemBlockModels() can't be used for them.
    for (int i = 0; i < 16; i++)
    {
        registerItemBlockModel(EnderUtilitiesBlocks.ELEVATOR, i, "inventory");
        registerItemBlockModel(EnderUtilitiesBlocks.ELEVATOR_SLAB, i, "inventory");
        registerItemBlockModel(EnderUtilitiesBlocks.ELEVATOR_LAYER, i, "inventory");
    }

    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.ELEVATOR,       (new StateMap.Builder()).ignore(BlockElevator.COLOR).build());
    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.ELEVATOR_SLAB,  (new StateMap.Builder()).ignore(BlockElevator.COLOR).build());
    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.ELEVATOR_LAYER, (new StateMap.Builder()).ignore(BlockElevator.COLOR).build());

    registerAllItemBlockModels(EnderUtilitiesBlocks.ENERGY_BRIDGE, "active=false,facing=north,type=", "");
    registerAllItemBlockModels(EnderUtilitiesBlocks.MACHINE_1, "facing=north,type=", "");
    registerAllItemBlockModels(EnderUtilitiesBlocks.STORAGE_0, "facing=north,type=", "");
    registerAllItemBlockModels(EnderUtilitiesBlocks.MSU, "creative=false,type=", "");

    registerItemBlockModel(EnderUtilitiesBlocks.DRAWBRIDGE, 0, "advanced=false,facing=north");
    registerItemBlockModel(EnderUtilitiesBlocks.DRAWBRIDGE, 1, "advanced=true,facing=north");
    registerItemBlockModel(EnderUtilitiesBlocks.ENDER_FURNACE, 0, "facing=north,mode=off");
    registerItemBlockModel(EnderUtilitiesBlocks.FLOOR, 0, "half=bottom,type=normal");
    registerItemBlockModel(EnderUtilitiesBlocks.FLOOR, 1, "half=bottom,type=cracked");
    registerItemBlockModel(EnderUtilitiesBlocks.INSERTER, 0, "type=normal");
    registerItemBlockModel(EnderUtilitiesBlocks.INSERTER, 1, "type=filtered");
    registerItemBlockModel(EnderUtilitiesBlocks.MOLECULAR_EXCITER, 0, "facing=north,powered=false");
    registerItemBlockModel(EnderUtilitiesBlocks.PHASING, 0, "inverted=false,powered=false");
    registerItemBlockModel(EnderUtilitiesBlocks.PHASING, 1, "inverted=true,powered=true");
    registerItemBlockModel(EnderUtilitiesBlocks.PORTAL_FRAME, 0, "inventory");
    registerItemBlockModel(EnderUtilitiesBlocks.PORTAL_PANEL, 0, "facing=north");
    registerItemBlockModel(EnderUtilitiesBlocks.SOUND_BLOCK, 0, "inventory");
}
项目:CherryPig    文件:ClientProxy.java   
public void registerRenderers(){
    RenderingRegistry.registerEntityRenderingHandler(CPEntityPiggy.class, new IRenderFactory<CPEntityPiggy>() {
        @Override
        public Render<? super CPEntityPiggy> createRenderFor(RenderManager manager)
        {
            return new CPPiggyRender(manager);
        }
    });

    registerItemModel(CPItem.cherryFruit);
    registerItemModel(CPItem.cherryPie);
    registerItemModel(CPItem.cherryPip);

    registerBlockItemModel(CPBlocks.charchoalBlack);
    registerBlockItemModel(CPBlocks.cherryLeaf);
    registerBlockItemModel(CPBlocks.cherrySapling);
    registerBlockItemModel(CPBlocks.cherryLog);
    registerBlockItemModel(CPBlocks.cherryPlanks);
    registerBlockItemModel(CPBlocks.cherryStairs);
    registerBlockItemModel(CPBlocks.flintBlock);

    MinecraftForge.EVENT_BUS.register(new CPEvents());

    //Don't use the CHECK_DECAY or DECAYABLE properties for rendering
    ModelLoader.setCustomStateMapper(CPBlocks.cherryLeaf, new StateMap.Builder().ignore(BlockSapling.STAGE, CHECK_DECAY, DECAYABLE).build());
    ModelLoader.setCustomStateMapper(CPBlocks.cherrySapling, new StateMap.Builder().ignore(BlockSapling.TYPE).build());
}
项目:harshencastle    文件:HarshenBlocks.java   
@SideOnly(Side.CLIENT)
public static void createStateMappers(Block block, IProperty<?>[] toIgnore)
{
    ModelLoader.setCustomStateMapper(block, (new StateMap.Builder().ignore(toIgnore)).build());
}
项目:ItsJustaCharm1.10.2Dead    文件:ModBlockSapling.java   
@SideOnly(Side.CLIENT)
protected void registerRender(Block block) {
    ModelLoader.setCustomStateMapper(block, new StateMap.Builder().ignore(TYPE).build());
}
项目:ItsJustaCharm1.10.2Dead    文件:ModBlockLeaves.java   
@SideOnly(Side.CLIENT)
protected void registerRender(Block block) {
    ModelLoader.setCustomStateMapper(block, new StateMap.Builder().ignore(CHECK_DECAY, DECAYABLE).build());
}
项目:Tannery    文件:TanneryBlocks.java   
private static void registerBlockWithStateBuilder(Block block, StateMap.Builder builder)
{
    ModelLoader.setCustomStateMapper(block, builder.build());
    registerBlock(block);
}
项目:RandomToolKit    文件:ClientProxy.java   
@Override
public void ignoreProperty(Block block, IProperty property) {
    ModelLoader.setCustomStateMapper(block, (new StateMap.Builder()).ignore(property).build());
}
项目:VendingBlock    文件:ClientProxy.java   
private void registerTESRRender(Block block, TileEntitySpecialRenderer renderer, Class<? extends TileEntity> te) {
    ClientRegistry.bindTileEntitySpecialRenderer(te, renderer);
    Item item = Item.getItemFromBlock(block);
    ForgeHooksClient.registerTESRItemStack(item, 0, te);
    ModelLoader.setCustomStateMapper(block, new StateMap.Builder().ignore(BlockVendingStorageAttachment.FACING).build());
}
项目:vintagecraft    文件:ClientProxy.java   
public void ignoreProperties(Block block, IProperty[] properties) {
    BlockModelShapes bms = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes();
    bms.registerBlockWithStateMapper(block, (new StateMap.Builder()).addPropertiesToIgnore(properties).build());
}
项目:ZeroQuest    文件:ClientProxy.java   
public void addStateMapperToIgnore(Block block, IProperty property) {
    ModelLoader.setCustomStateMapper(block, (new StateMap.Builder()).addPropertiesToIgnore(new IProperty[] { property }).build());
}
项目:ZeldaSwordSkills    文件:BlockAncientTablet.java   
@Override
@SideOnly(Side.CLIENT)
public IStateMapper getCustomStateMap() {
    return (new StateMap.Builder()).ignore(VARIANT).build();
}
项目:ZeldaSwordSkills    文件:BlockBombFlower.java   
@Override
@SideOnly(Side.CLIENT)
public IStateMapper getCustomStateMap() {
    return (new StateMap.Builder()).ignore(EXPLODE).build();
}
项目:ZeldaSwordSkills    文件:BlockSecretStone.java   
@Override
@SideOnly(Side.CLIENT)
public IStateMapper getCustomStateMap() {
    return (new StateMap.Builder()).ignore(UNBREAKABLE).build();
}
项目:EnderIO    文件:ClientProxy.java   
@SubscribeEvent
public static void onModelRegistryEvent(@Nonnull ModelRegistryEvent event) {

  // Custom state mappers
  EnderIOGlassesStateMapper.create();
  ColdFireStateMapper.create();
  LeverStateMapper.create();
  final StateMap doorMapper = (new StateMap.Builder()).ignore(new IProperty[] { BlockDoor.POWERED }).build();
  ModelLoader.setCustomStateMapper(ModObject.blockDarkSteelDoor.getBlockNN(), doorMapper);
  ModelLoader.setCustomStateMapper(ModObject.blockPaintedDarkSteelDoor.getBlockNN(), doorMapper);
  ModelLoader.setCustomStateMapper(ModObject.blockPaintedIronDoor.getBlockNN(), doorMapper);
  ModelLoader.setCustomStateMapper(ModObject.blockPaintedWoodenDoor.getBlockNN(), doorMapper);

  // Items of blocks that use smart rendering
  SmartModelAttacher.registerBlockItemModels();

  /*
   * Most blocks register themselves with the SmartModelAttacher which will also handle their items. Those that don't need to implement IHaveRenderers and
   * have their items handled here.
   * 
   * Items that do _not_ belong to a block are handled here by either having the item implement IHaveRenderers or by registering the default renderer.
   */
  for (IModObject mo : ModObjectRegistry.getObjects()) {
    final Block block = mo.getBlock();
    if (block instanceof IHaveRenderers) {
      ((IHaveRenderers) block).registerRenderers(mo);
    } else if (block instanceof IDefaultRenderers) {
      ClientUtil.registerDefaultItemRenderer(mo);
    } else if (block == null || block == Blocks.AIR) {
      final Item item = mo.getItem();
      if (item instanceof IHaveRenderers) {
        ((IHaveRenderers) item).registerRenderers(mo);
      } else if (item != null && item != Items.AIR) {
        ClientUtil.registerRenderer(item, mo.getUnlocalisedName());
      }
    }
    if (block instanceof IHaveTESR) {
      ((IHaveTESR) block).bindTileEntitySpecialRenderer();
    }
  }
}
项目:magistics    文件:IStateMapProvider.java   
StateMap getStateMap();