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

项目: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);
}
项目: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);
        }
    }
}
项目:CustomWorldGen    文件:ModelLoader.java   
/**
 * Internal, do not use.
 */
public static void onRegisterAllBlocks(BlockModelShapes shapes)
{
    for (Entry<RegistryDelegate<Block>, IStateMapper> e : customStateMappers.entrySet())
    {
        shapes.registerBlockWithStateMapper(e.getKey().get(), e.getValue());
    }
}
项目: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"));
}
  }
项目:UsefulNullifiers    文件:ModRenderers.java   
public static void registerBlockRenderer(Block block, IStateMapper mapper,
        int... metadata)
{
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
            .getModelManager().getBlockModelShapes()
            .registerBlockWithStateMapper(block, mapper);
}
项目:ZeldaSwordSkills    文件:BlockDungeonStone.java   
/**
 * Always returns the same base texture, since ISmartModel will handle the actual render state
 */
@Override
@SideOnly(Side.CLIENT)
public IStateMapper getCustomStateMap() {
    return new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return ModelDungeonBlock.resource;
        }
    };
}
项目:ZeldaSwordSkills    文件:BlockPedestal.java   
@Override
@SideOnly(Side.CLIENT)
public IStateMapper getCustomStateMap() {
    // can't use this because meta 8 needs to be remapped to 7:
    // return (new StateMap.Builder()).addPropertiesToIgnore(UNLOCKED).build();
    return new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            String resource = getUnlocalizedName();
            resource = resource.substring(resource.lastIndexOf(".") + 1) + "#" + PENDANTS.getName() + "=";
            int pendants = ((Boolean) state.getValue(UNLOCKED)).booleanValue() ? ALL_PENDANTS : ((Integer) state.getValue(PENDANTS)).intValue();
            return new ModelResourceLocation(ModInfo.ID + ":" + resource + pendants);
        }
    };
}
项目:ZeldaSwordSkills    文件:BlockChestInvisible.java   
@Override
@SideOnly(Side.CLIENT)
public IStateMapper getCustomStateMap() {
    return new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return new ModelResourceLocation(ModInfo.ID + ":chest_invisible");
        }
    };
}
项目:DecompiledMinecraft    文件:BlockModelShapes.java   
public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper)
{
    this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper);
}
项目:BaseClient    文件:BlockModelShapes.java   
public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper)
{
    this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper);
}
项目:BaseClient    文件:BlockModelShapes.java   
public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper)
{
    this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper);
}
项目:Backmemed    文件:BlockModelShapes.java   
public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper)
{
    this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper);
}
项目:CustomWorldGen    文件:ModelLoader.java   
/**
 * Adds a custom IBlockState -> model variant logic.
 */
public static void setCustomStateMapper(Block block, IStateMapper mapper)
{
    customStateMappers.put(block.delegate, mapper);
}
项目:CustomWorldGen    文件:BlockModelShapes.java   
public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper)
{
    this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper);
}
项目:Production-Line    文件:PLModelRegistry.java   
private static void registerBlockStateMapper(Block block, IStateMapper mapper) {
    ModelLoader.setCustomStateMapper(block, mapper);
}
项目:ExpandedRailsMod    文件:BlockModelShapes.java   
public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper)
{
    this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper);
}
项目: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();
}
项目:ZeldaSwordSkills    文件:ICustomStateMapper.java   
/**
 * Return the {@link IStateMapper IStateMapper} to use for {@link net.minecraftforge.client.model.ModelLoader#setCustomStateMapper ModelLoader.setCustomStateMapper}
 */
@SideOnly(Side.CLIENT)
IStateMapper getCustomStateMap();
项目:BlazeLoader    文件:ApiRenderBlock.java   
/**
 * Registers a mapper for the given block that takes a given BlockState and gives back a prebaked model.
 *  
 * @param block     Block for rendering
 * @param mapper    IStateMapper to provide the models
 */
public static void registerBlockModelMapper(Block block, IStateMapper mapper) {
    Minecraft.getMinecraft().modelManager.getBlockModelShapes().registerBlockWithStateMapper(block, mapper);
}
项目:BlazeLoader    文件:ApiRenderBlock.java   
/**
 * Remaps the models from an already registered block onto the given one.
 * 
 * @param original  Original block
 * @param block     Block to assign the models to
 */
public static void swapoutBlockModels(Block original, Block block) {
    BlockModelShapes mapper = Minecraft.getMinecraft().modelManager.getBlockModelShapes();
    mapper.getBlockStateMapper().registerBlockStateMapper(block, (IStateMapper)mapper.getBlockStateMapper().blockStateMap.get(original));
    mapper.reloadModels();
}