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

项目: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());
}
项目:CrystalMod    文件:BlockPipe.java   
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
    StateMapperBase ignoreState = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) {
            return ModelPipeBaked.BAKED_MODEL;
        }
    };
    ModelLoader.setCustomStateMapper(this, ignoreState);
    ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(getRegistryName(), "inventory");
    //for(PipeType type : PipeType.values())
    // Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(this), type.getMeta(), itemModelResourceLocation);
    for(PipeType type : PipeType.values())
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), itemModelResourceLocation);
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new TileEntityPipeRenderer());
}
项目:Aether-Legacy    文件:BlockRendering.java   
public static void registerBlockWithStateMapper(Block block)
{
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBlockWithStateMapper(block, new StateMapperBase() 
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state)
        {
            return new ModelResourceLocation(state.getBlock().getRegistryName(), "normal");
        }

    });

    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), new ItemMeshDefinition() 
    {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack) 
        {
            return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
        }
    });
}
项目:Qbar    文件:ClientProxy.java   
public static final void registerFluidsClient()
{
    final ModelResourceLocation fluidSteamLocation = new ModelResourceLocation(QBarConstants.MODID + ":" +
            "blockfluidsteam",
            "steam");
    ModelLoader.setCustomStateMapper(QBarFluids.blockFluidSteam, new StateMapperBase()
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(final IBlockState state)
        {
            return fluidSteamLocation;
        }
    });

    ModelBakery.registerItemVariants(Item.getItemFromBlock(QBarFluids.blockFluidSteam), fluidSteamLocation);
    ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(QBarFluids.blockFluidSteam),
            stack -> fluidSteamLocation);
}
项目:Mekfarm    文件:LiquidXPFluid.java   
@SideOnly(Side.CLIENT)
public void registerRenderer() {
    IFluidBlock block = BlocksRegistry.liquidXpBlock;
    Item item = Item.getItemFromBlock((Block)block);
    assert (item == Items.AIR);

    ModelBakery.registerItemVariants(item);

    ModelResourceLocation modelResourceLocation = new ModelResourceLocation(MekfarmMod.MODID + ":fluids", this.getName());

    ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack) {
            return modelResourceLocation;
        }
    });

    ModelLoader.setCustomStateMapper((Block) block, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return modelResourceLocation;
        }
    });
}
项目:Mekfarm    文件:SewageFluid.java   
@SideOnly(Side.CLIENT)
public void registerRenderer() {
    IFluidBlock block = BlocksRegistry.sewageBlock;
    Item item = Item.getItemFromBlock((Block)block);
    assert (item == Items.AIR);

    ModelBakery.registerItemVariants(item);

    ModelResourceLocation modelResourceLocation = new ModelResourceLocation(MekfarmMod.MODID + ":fluids", this.getName());

    ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack) {
            return modelResourceLocation;
        }
    });

    ModelLoader.setCustomStateMapper((Block) block, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return modelResourceLocation;
        }
    });
}
项目:Malgra    文件:ClientProxy.java   
public void registerFluidModel(Block  block) {
    Item item = Item.getItemFromBlock(block);

    ModelBakery.registerItemVariants(item);

    final ModelResourceLocation loc = new ModelResourceLocation(Reference.MODID + ":fluid", "liquidmalgra");

    ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack) {
            return loc;
        }
    });

    ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return loc;
        }
    });
}
项目:BaseGems    文件:ClientProxy.java   
@Override
public void preInit(FMLPreInitializationEvent event) {
    super.preInit(event);
    for (final String name : Fluids.getFluidBlockRegistry().keySet()) {
        final Block block = Fluids.getFluidBlockByName(name);
        final Item item = Item.getItemFromBlock(block);
        if (!item.getRegistryName().getResourceDomain().equals(BaseGems.MODID))
            continue;
        final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(item.getRegistryName().getResourceDomain() + ":" + name, "fluid");
        ModelBakery.registerItemVariants(item);
        ModelLoader.setCustomMeshDefinition(item, stack -> fluidModelLocation);
        ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
            @Override
            protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
                return fluidModelLocation;
            }
        });
    }
}
项目:InfinityLib    文件:BlockRendererRegistry.java   
@SideOnly(Side.CLIENT)
public void registerCustomBlockRenderer(ICustomRenderedBlock customRenderedBlock) {
    if (customRenderedBlock == null || !(customRenderedBlock instanceof BlockBase)) {
        return;
    }
    //set custom state mapper
    StateMapperBase stateMapper = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return customRenderedBlock.getBlockModelResourceLocation();
        }
    };
    ModelLoader.setCustomStateMapper((BlockBase) customRenderedBlock, stateMapper);
    //register renderers
    if (customRenderedBlock instanceof ICustomRenderedBlockWithTile) {
        registerTileRenderer((ICustomRenderedBlockWithTile) customRenderedBlock);
    } else {
        registerBlockRenderer(customRenderedBlock);
    }
}
项目:Minestrappolation-4    文件:MFluid.java   
@SideOnly(Side.CLIENT)
public static void buildRenderFor(Block block, String name)
{
    final ModelResourceLocation fluidLocation = new ModelResourceLocation(MReference.MODID + ":" + name, "fluid");
    Item fluid = Item.getItemFromBlock(block);
    ModelBakery.addVariantName(fluid);
    ModelLoader.setCustomMeshDefinition(fluid, new ItemMeshDefinition()
    {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack)
        {
            return fluidLocation;
        }
    });
    ModelLoader.setCustomStateMapper(block, new StateMapperBase()
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state)
        {
            return fluidLocation;
        }
    });
}
项目:BaseMetals    文件:Fluids.java   
@SideOnly(Side.CLIENT)
public static void bakeModels(String modID){
    for(Fluid fluid : fluidBlocks.keySet()){
        BlockFluidBase block = fluidBlocks.get(fluid);
        Item item = Item.getItemFromBlock(block);
        final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(
                modID.toLowerCase() + ":" + fluidBlockNames.get(block), "fluid");
           ModelBakery.registerItemVariants(item);
        ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition()
        {
            public ModelResourceLocation getModelLocation(ItemStack stack)
            {
                return fluidModelLocation;
            }
        });
        ModelLoader.setCustomStateMapper(block, new StateMapperBase()
        {
            protected ModelResourceLocation getModelResourceLocation(IBlockState state)
            {
                return fluidModelLocation;
            }
        });
    }
}
项目:AbyssalCraft    文件:AbyssalCraftClientEventHooks.java   
private void registerFluidModel(Block fluidBlock, String name) {
    Item item = Item.getItemFromBlock(fluidBlock);

    ModelBakery.registerItemVariants(item);

    final ModelResourceLocation modelResourceLocation = new ModelResourceLocation("abyssalcraft:fluid", name);

    ModelLoader.setCustomMeshDefinition(item, stack -> modelResourceLocation);

    ModelLoader.setCustomStateMapper(fluidBlock, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState p_178132_1_) {
            return modelResourceLocation;
        }
    });
}
项目:harshencastle    文件:ClientProxy.java   
@Override
public void registerFluidBlockRendering(Block block, String name) 
{       
    final ModelResourceLocation fluidLocation = new ModelResourceLocation(HarshenCastle.MODID.toLowerCase() + ":fluids", name);

    ModelLoader.setCustomStateMapper(block, new StateMapperBase()
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state)
        {

            return fluidLocation;
        }
    });
}
项目:BetterThanWeagles    文件:ModFluids.java   
@SideOnly(Side.CLIENT)
public static void initModels()
{
    Item item = Item.getItemFromBlock(ModBlocks.liquid_butter);

    ModelBakery.registerItemVariants(item);
    ModelResourceLocation location = new ModelResourceLocation("btweagles:fluid", "liquid_butter");
    ModelLoader.setCustomMeshDefinition(item, stack -> location);
    ModelLoader.setCustomStateMapper(ModBlocks.liquid_butter, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return location;
        }
    });
}
项目:CharcoalPit    文件:BlocksRegistry.java   
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event){
    StateMapperBase mapper=new StateMapperBase() {

        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return new ModelResourceLocation(new ResourceLocation(Constants.MODID, "creosote"), "creosote");
        }
    };
    if(FluidsRegistry.BlockCreosote!=null)
        ModelLoader.setCustomStateMapper(FluidsRegistry.BlockCreosote, mapper);
}
项目:PurificatiMagicae    文件:BlockMagibench.java   
@Override
@SideOnly(Side.CLIENT)
public void setupModels()
{
    StateMapperBase st = new StateMapperBase()
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state)
        {
            MagibenchRegistry.Tier t = PurMag.INSTANCE.getMagibenchRegistry().getTier(state.getValue(TIER));
            return new ModelResourceLocation(t.getSmartModel(), "normal");
        }
    };
    ModelLoader.setCustomStateMapper(this, st);
}
项目:FoodCraft-Reloaded    文件:EnumLoader.java   
@SideOnly(Side.CLIENT)
protected void registerFluidRender(BlockFluidBase blockFluid, String blockStateName) {
    final String location = FoodCraftReloaded.MODID + ":" + blockStateName;
    final Item itemFluid = Item.getItemFromBlock(blockFluid);
    ModelLoader.setCustomMeshDefinition(itemFluid, stack -> new ModelResourceLocation(location, "fluid"));
    ModelLoader.setCustomStateMapper(blockFluid, new StateMapperBase() {
        @Nonnull
        @Override
        protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state) {
            return new ModelResourceLocation(location, "fluid");
        }
    });
}
项目:Gravestone-mod-Extended    文件:ClientProxy.java   
@Override
public void registerFluidRenderers(ModelResourceLocation modelResourceLocation) {
    ModelLoader.setCustomStateMapper(GSBlock.TOXIC_WATER, new StateMapperBase() {
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return modelResourceLocation;
        }
    });
}
项目:MMDLib-old    文件:MMDLibRegistry.java   
@SideOnly(Side.CLIENT)
public static void registerStateMapper(Block block) {
    if (!(block instanceof IBlockStateMap)) return;
    ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
        @Override
        @Nonnull
        protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state) {
            return new ModelResourceLocation(((IBlockStateMap) block).getResourceLocation(state), ((IBlockStateMap) block).getVarient(state));
        }
    });
}
项目:LightningCraft    文件:LCFluids.java   
/** Make sure to set up the rendering info */
@SideOnly(Side.CLIENT)
public static void registerRendering() {
    for(Fluid fluid : fluidBlocks.keySet()) {
        BlockFluidBase block = fluidBlocks.get(fluid);
        final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(
                RefStrings.MODID + ":" + fluidBlockNames.get(block), "fluid");
        ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
            @Override
            protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
                return fluidModelLocation;
            }
        });
    }
}
项目:AquaMunda    文件:BlockFreshWater.java   
@SideOnly(Side.CLIENT)
public void initModel() {
    ModelResourceLocation fluidLocation = new ModelResourceLocation(getRegistryName(), "fluid");

    StateMapperBase customState = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) {
            return fluidLocation;
        }
    };
    ModelLoader.setCustomStateMapper(this, customState);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
项目:AquaMunda    文件:TankBlock.java   
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
    StateMapperBase ignoreState = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) {
            return TankBakedModel.BAKED_TANK;
        }
    };
    ModelLoader.setCustomStateMapper(this, ignoreState);
    ClientRegistry.bindTileEntitySpecialRenderer(TankTE.class, new TankTESR());
}
项目:Nuclear-Foundation    文件:BlockGlowOre.java   
public void initModel(){
    final ModelResourceLocation mrl = new ModelResourceLocation(Constants.MODID+":GlowOre_" + Type);
       StateMapperBase ignoreState = new StateMapperBase() {
           @Override
           protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) {
               return mrl;
           }
       };
       ModelLoader.setCustomStateMapper(this, ignoreState);
       ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(Constants.MODID+Type,"inventory"));
}
项目:GearSwapper1.8    文件:GearSwapperBlock.java   
@SideOnly(Side.CLIENT)
public void registerModel(Block block) {
    nameToMimicingBlock.put(MIMIC_PREFIX + blockName, block);

    ModelLoader.setCustomStateMapper(this, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return new ModelResourceLocation(MIMIC_PREFIX + blockName);
        }
    });
}
项目:Cyclic    文件:BlockFluidMilk.java   
@SideOnly(Side.CLIENT)
@Override
public void initModel() {
  Block block = FluidsRegistry.block_milk;
  Item item = Item.getItemFromBlock(block);
  ModelBakery.registerItemVariants(item);
  final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(Const.MODID + ":fluid", stack.getFluid().getName());
  ModelLoader.setCustomModelResourceLocation(item, 0, modelResourceLocation);
  ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
    @Override
    protected ModelResourceLocation getModelResourceLocation(IBlockState bs) {
      return modelResourceLocation;
    }
  });
}
项目:Cyclic    文件:BlockFluidPoison.java   
@SideOnly(Side.CLIENT)
@Override
public void initModel() {
  Block block = FluidsRegistry.block_poison;
  Item item = Item.getItemFromBlock(block);
  ModelBakery.registerItemVariants(item);
  final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(Const.MODID + ":fluid", stack.getFluid().getName());
  ModelLoader.setCustomModelResourceLocation(item, 0, modelResourceLocation);
  ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
    @Override
    protected ModelResourceLocation getModelResourceLocation(IBlockState bs) {
      return modelResourceLocation;
    }
  });
}
项目:Cyclic    文件:BlockFluidExp.java   
@SideOnly(Side.CLIENT)
@Override
public void initModel() {
  Block block = FluidsRegistry.block_exp;
  Item item = Item.getItemFromBlock(block);
  ModelBakery.registerItemVariants(item);
  final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(Const.MODID + ":fluid", stack.getFluid().getName());
  ModelLoader.setCustomModelResourceLocation(item, 0, modelResourceLocation);
  ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
    @Override
    protected ModelResourceLocation getModelResourceLocation(IBlockState bs) {
      return modelResourceLocation;
    }
  });
}
项目:Runes-of-Wizardry    文件:ClientProxy.java   
@Override
public void registerDustStateMapper(ADustStorageBlock dustBlock){
    RunesOfWizardry.log().info("Creating StateMapper for "+dustBlock.getName());
    StateMapperBase mapper = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) {
            ModelResourceLocation loc =new ModelResourceLocation(References.texture_path+"dust_storage");
            //System.err.println(loc.toString());
            return loc;
        }
    };
    ModelLoader.setCustomStateMapper(dustBlock.getInstance(), mapper);
}
项目:PowerAdvantageAPI    文件:Blocks.java   
/**
 * Adds fluid block models to the game and applies them to the fluid blocks
 */
@SideOnly(Side.CLIENT)
public static void bakeModels(){
    String modID = PowerAdvantage.MODID;
    for(Map.Entry<String,Block> e : allBlocks.entrySet()){
        Block b = e.getValue();
        String name = e.getKey();
        if(b instanceof BlockFluidBase){
            BlockFluidBase block = (BlockFluidBase)b;
            Fluid fluid = block.getFluid();
            Item item = Item.getItemFromBlock(block);
            final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(
                    modID.toLowerCase() + ":" + name, "fluid");
            ModelBakery.registerItemVariants(item);
            ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition()
            {
                public ModelResourceLocation getModelLocation(ItemStack stack)
                {
                    return fluidModelLocation;
                }
            });
            ModelLoader.setCustomStateMapper(block, new StateMapperBase()
            {
                protected ModelResourceLocation getModelResourceLocation(IBlockState state)
                {
                    return fluidModelLocation;
                }
            });
        }
    }
}
项目: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");
        }
    };
}
项目:TechReborn3    文件:TechRebornClient.java   
private static void registerFluid(BlockFluidClassic fluid) {
    final ModelResourceLocation location = new ModelResourceLocation(TRConstants.MOD_ID + ":fluids", fluid.getFluid().getName().toLowerCase());
    ModelLoader.setCustomStateMapper(fluid, new StateMapperBase() {
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return location; }
    });
}
项目:Malgra    文件:ClientProxy.java   
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event) {

    ModelBakery.registerItemVariants(Items.liquidMalgraItem);
    ModelLoader.setCustomMeshDefinition(Items.liquidMalgraItem, is -> new ModelResourceLocation(Reference.MODID.toLowerCase() + ":liquidmalgrablock", "liquidmalgra"));

    registerRender(Items.magicDust);
    registerRender(Items.manaInjector);
    registerRender(Items.manaInjectorEmpty);
    registerRender(Items.extractor, 0, "extractor_base");
    registerRender(Items.extractor, 1, "extractor_container_tiny");
    registerRender(Items.extractor, 2, "extractor_container_small");
    registerRender(Items.extractor, 3, "extractor_container_medium");
    registerRender(Items.extractor, 4, "extractor_container_large");
    registerRender(Items.extractor, 5, "extractor_container_huge");
    registerRender(Items.extractor, 6, "extractor_tip_flint");
    registerRender(Items.extractor, 7, "extractor_tip_iron");
    registerRender(Items.extractor, 8, "extractor_tip_quartz");
    registerRender(Items.extractor, 9, "extractor_tip_diamond");
    registerRender(Items.extractor, 10, "extractor_tip_malgrum");
    registerRender(Items.tinyContainer, 0, "extractor_container_tiny");
    registerRender(Items.smallContainer, 0, "extractor_container_small");
    registerRender(Items.mediumContainer, 0, "extractor_container_medium");
    registerRender(Items.largeContainer, 0, "extractor_container_large");
    registerRender(Items.hugeContainer, 0, "extractor_container_huge");
    registerRender(Items.flintExtractorTip, 0, "extractor_tip_flint");
    registerRender(Items.ironExtractorTip, 0, "extractor_tip_iron");
    registerRender(Items.quartzExtractorTip, 0, "extractor_tip_quartz");
    registerRender(Items.diamondExtractorTip, 0, "extractor_tip_diamond");
    registerRender(Items.malgrumExtractorTip, 0, "extractor_tip_malgrum");
    registerRender(Items.dimensionTool);
    registerRender(Items.malgraPickaxe);
    registerRender(Items.malgraSword);

    //Blocks
    registerRender(Item.getItemFromBlock(Blocks.manaCraftingTable));
    registerRender(Item.getItemFromBlock(Blocks.specialBlock));
    registerRender(Item.getItemFromBlock(Blocks.researchStoneBrick));

    ModelLoader.setCustomStateMapper(Blocks.liquidMalgraBlock, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return new ModelResourceLocation(Reference.MODID.toLowerCase() + ":liquidmalgrablock", "liquidmalgra");
        }
    });
}
项目:geomastery    文件:ClientProxy.java   
@Override
public void preInit() {

    Geomastery.LOG.info("Registering client event handler");
    MinecraftForge.EVENT_BUS.register(new ClientEvents());

    Geomastery.LOG.info("Registering entity renderers");
    entity(EntitySpearWood.class, RenderSpearFactory.SPEAR_WOOD);
    entity(EntitySpearFlint.class, RenderSpearFactory.SPEAR_FLINT);
    entity(EntitySpearCopper.class, RenderSpearFactory.SPEAR_COPPER);
    entity(EntitySpearBronze.class, RenderSpearFactory.SPEAR_BRONZE);
    entity(EntitySpearSteel.class, RenderSpearFactory.SPEAR_STEEL);
    entity(EntityArrowWood.class, RenderArrowFactory.ARROW_WOOD);
    entity(EntityArrowFlint.class, RenderArrowFactory.ARROW_FLINT);
    entity(EntityArrowCopper.class, RenderArrowFactory.ARROW_COPPER);
    entity(EntityArrowBronze.class, RenderArrowFactory.ARROW_BRONZE);
    entity(EntityArrowSteel.class, RenderArrowFactory.ARROW_STEEL);
    entity(FallingTreeBlock.Leaves.class, RenderFallingTreeBlock::new);
    entity(FallingTreeBlock.Trunk.class, RenderFallingTreeBlock::new);

    Geomastery.LOG.info("Registering tileentity renderers");
    ClientRegistry.bindTileEntitySpecialRenderer(TEStorage.Box.class, new RenderBox());
    ClientRegistry.bindTileEntitySpecialRenderer(TEStorage.Chest.class, new RenderChest());

    Geomastery.LOG.info("Registering tar state mapper and model loader");
    BlockFluidBase tarBlock = GeoBlocks.tar;
    ResourceLocation tarRegistry = tarBlock.getRegistryName();
    ModelResourceLocation tarLoc = new ModelResourceLocation(tarRegistry.getResourceDomain() + ":fluid#" + tarRegistry.getResourcePath());

    Item tarItem = Item.getItemFromBlock(tarBlock);
    ModelBakery.registerItemVariants(tarItem);
    ModelLoader.setCustomMeshDefinition(tarItem, stack -> tarLoc);
    ModelLoader.setCustomStateMapper(tarBlock, new StateMapperBase() {

        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {

            return tarLoc;
        }
    });
}
项目:TFC2    文件:ClientProxy.java   
private void setupBlockMeshes() 
{
    OBJLoader.INSTANCE.addDomain(Reference.ModID);

    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.LooseRocks), 0, new ModelResourceLocation(Reference.ModID + ":loose_rock", "inventory"));

    Item anvilItem = Item.getItemFromBlock(TFCBlocks.Anvil);
    ModelLoader.setCustomModelResourceLocation(anvilItem, 0, new ModelResourceLocation(Reference.ModID + ":anvil"));
    //Change the StateMapper for this block so that it will point to a different file for a specific Property
    StateMapperBase ignoreState = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) 
        {
            if(iBlockState.getValue(BlockLeaves2.META_PROPERTY) == WoodType.Palm)
                return new ModelResourceLocation("tfc2:leaves_palm");
            else return new ModelResourceLocation("tfc2:leaves2");

        }
    };
    ModelLoader.setCustomStateMapper(TFCBlocks.Leaves2, ignoreState);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Dirt), "Dirt/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Grass), "Grass/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Stone), "Stone/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Rubble), "Rubble/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Sand), "Sand/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Gravel), "Gravel/", Global.STONE_ALL, 0, 16);
    //registerVariantModel(Item.getItemFromBlock(TFCBlocks.LooseRocks), "LooseRocks/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Planks), "Wood/Planks/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Sapling), "Wood/Saplings/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.LogVertical), "Wood/Logs/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Leaves), "Wood/Leaves/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Planks2), "Wood/Planks/", WoodType.getNamesArray(), 16, 19);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Sapling2), "Wood/Saplings/", WoodType.getNamesArray(), 16, 19);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.LogVertical2), "Wood/Logs/", WoodType.getNamesArray(), 16, 19);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Leaves2), "Wood/Leaves/", WoodType.getNamesArray(), 16, 18);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.Leaves2), 18, new ModelResourceLocation(Reference.ModID + ":leaves_palm", "inventory"));
    //registerVariantModel(Item.getItemFromBlock(TFCBlocks.Ore), "Ore/", OreType.getNamesArray(), 0, 13);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.StoneBrick), "StoneBrick/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.StoneSmooth), "StoneSmooth/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.SupportBeam), "Wood/SupportBeams/", WoodType.getNamesArray(), 0, 8);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.SupportBeam2), "Wood/SupportBeams/", WoodType.getNamesArray(), 8, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.SupportBeam3), "Wood/SupportBeams/", WoodType.getNamesArray(), 16, 19);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.TorchOn),0,new ModelResourceLocation(Reference.ModID + ":torch_on", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.TorchOff),0,new ModelResourceLocation(Reference.ModID + ":torch_off", "inventory"));
    for(Block b : TFCBlocks.stairsList)
    {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b),0,new ModelResourceLocation(Reference.ModID + ":Wood/Stairs/"+Core.getUnlocalized(b.getUnlocalizedName()), "inventory"));
    }
    RegistryItemQueue.getInstance().registerMeshes();
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.Thatch), 0, new ModelResourceLocation(Reference.ModID + ":thatch", "inventory"));
}
项目:TFC2    文件:ClientProxy.java   
private void setupBlockMeshes() 
{
    OBJLoader.INSTANCE.addDomain(Reference.ModID);

    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.LooseRocks), 0, new ModelResourceLocation(Reference.ModID + ":loose_rock", "inventory"));

    Item anvilItem = Item.getItemFromBlock(TFCBlocks.Anvil);
    ModelLoader.setCustomModelResourceLocation(anvilItem, 0, new ModelResourceLocation(Reference.ModID + ":anvil"));
    //Change the StateMapper for this block so that it will point to a different file for a specific Property
    StateMapperBase ignoreState = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) 
        {
            if(iBlockState.getValue(BlockLeaves2.META_PROPERTY) == WoodType.Palm)
                return new ModelResourceLocation("tfc2:leaves_palm");
            else return new ModelResourceLocation("tfc2:leaves2");

        }
    };
    ModelLoader.setCustomStateMapper(TFCBlocks.Leaves2, ignoreState);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Dirt), "Dirt/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Grass), "Grass/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Stone), "Stone/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Rubble), "Rubble/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Sand), "Sand/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Gravel), "Gravel/", Global.STONE_ALL, 0, 16);
    //registerVariantModel(Item.getItemFromBlock(TFCBlocks.LooseRocks), "LooseRocks/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Planks), "Wood/Planks/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Sapling), "Wood/Saplings/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.LogVertical), "Wood/Logs/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Leaves), "Wood/Leaves/", WoodType.getNamesArray(), 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Planks2), "Wood/Planks/", WoodType.getNamesArray(), 16, 19);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Sapling2), "Wood/Saplings/", WoodType.getNamesArray(), 16, 19);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.LogVertical2), "Wood/Logs/", WoodType.getNamesArray(), 16, 19);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.Leaves2), "Wood/Leaves/", WoodType.getNamesArray(), 16, 18);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.Leaves2), 18, new ModelResourceLocation(Reference.ModID + ":leaves_palm", "inventory"));
    //registerVariantModel(Item.getItemFromBlock(TFCBlocks.Ore), "Ore/", OreType.getNamesArray(), 0, 13);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.StoneBrick), "StoneBrick/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.StoneSmooth), "StoneSmooth/", Global.STONE_ALL, 0, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.SupportBeam), "Wood/SupportBeams/", WoodType.getNamesArray(), 0, 8);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.SupportBeam2), "Wood/SupportBeams/", WoodType.getNamesArray(), 8, 16);
    registerVariantModel(Item.getItemFromBlock(TFCBlocks.SupportBeam3), "Wood/SupportBeams/", WoodType.getNamesArray(), 16, 19);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.TorchOn),0,new ModelResourceLocation(Reference.ModID + ":torch_on", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.TorchOff),0,new ModelResourceLocation(Reference.ModID + ":torch_off", "inventory"));
    for(Block b : TFCBlocks.stairsList)
    {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b),0,new ModelResourceLocation(Reference.ModID + ":Wood/Stairs/"+Core.getUnlocalized(b.getUnlocalizedName()), "inventory"));
    }
    RegistryItemQueue.getInstance().registerMeshes();
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(TFCBlocks.Thatch), 0, new ModelResourceLocation(Reference.ModID + ":thatch", "inventory"));
}
项目:FlowstoneEnergy    文件:ClientProxy.java   
private void initModelsBlocks() {

    // Machines
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machineBox),0, new ModelResourceLocation("flowstoneenergy:block/machine_box", "inventory"));

    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machines), 0, machinesItemLocation);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machines), 1, machinesItemLocation);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machines), 2, machinesItemLocation);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machines), 3, machinesItemLocation);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machines), 4, machinesItemLocation);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.machines), 5, machinesItemLocation);

    ModelLoader.setCustomStateMapper(BlockRegistry.machines, new StateMapperBase() {

        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return machinesBlockLocation;
        }
    });

    // Pipes
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.itemPipe),0, new ModelResourceLocation("flowstoneenergy:item_pipe", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.fluidPipe),0, new ModelResourceLocation("flowstoneenergy:fluid_pipe", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.powerPipe),0, new ModelResourceLocation("flowstoneenergy:power_pipe", "inventory"));

    // Ores
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.blockOres),EnumOreTypes.COPPER.getMeta(), new ModelResourceLocation("flowstoneenergy:ores", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.blockOres),EnumOreTypes.TIN.getMeta(), new ModelResourceLocation("flowstoneenergy:ore_tin", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.blockOres),EnumOreTypes.LEAD.getMeta(), new ModelResourceLocation("flowstoneenergy:ore_lead", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.blockOres),EnumOreTypes.SILVER.getMeta(), new ModelResourceLocation("flowstoneenergy:ore_silver", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.blockOres),EnumOreTypes.NICKEL.getMeta(), new ModelResourceLocation("flowstoneenergy:ore_nickle", "inventory"));

    // IngotStorage
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.COPPER.getMeta(), new ModelResourceLocation("flowstoneenergy:ingot_storage", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.TIN.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/tin", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.LEAD.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/lead", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.SILVER.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/silver", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.ENDER.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/ender", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.NICKEL.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/nickel", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.INVAR.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/invar", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.ingotStorage),EnumIngotStorage.ELECTRUM.getMeta(), new ModelResourceLocation("flowstoneenergy:ingotstorage/electrum", "inventory"));

    // Aplite
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.aplite),EnumApliteTypes.ORE.getMeta(), new ModelResourceLocation("flowstoneenergy:aplite", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.aplite),EnumApliteTypes.COBBLE.getMeta(), new ModelResourceLocation("flowstoneenergy:aplite/cobble", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.aplite),EnumApliteTypes.BRICK.getMeta(), new ModelResourceLocation("flowstoneenergy:aplite/brick", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.aplite),EnumApliteTypes.SMALL_BRICK.getMeta(), new ModelResourceLocation("flowstoneenergy:aplite/small_brick", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.aplite),EnumApliteTypes.CHISELED.getMeta(), new ModelResourceLocation("flowstoneenergy:aplite/chiseled", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.aplite),EnumApliteTypes.BLOCK.getMeta(), new ModelResourceLocation("flowstoneenergy:aplite/block", "inventory"));

    // upgrades
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.upgrades),EnumUpgradeType.SPEED.getMeta(), new ModelResourceLocation("flowstoneenergy:upgrades", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.upgrades),EnumUpgradeType.ITEM_CAPACITY.getMeta(), new ModelResourceLocation("flowstoneenergy:upgrades/item_capacity", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.upgrades),EnumUpgradeType.ENERGY_CAPACITY.getMeta(), new ModelResourceLocation("flowstoneenergy:upgrades/energy_capacity", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.upgrades),EnumUpgradeType.ENERGY_EFFICIENCY.getMeta(), new ModelResourceLocation("flowstoneenergy:upgrades/energy_efficiency", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.upgrades),EnumUpgradeType.PROCESS_AMOUNT.getMeta(), new ModelResourceLocation("flowstoneenergy:upgrades/process_amount", "inventory"));
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockRegistry.upgrades),EnumUpgradeType.CREATIVE.getMeta(), new ModelResourceLocation("flowstoneenergy:upgrades/creative", "inventory"));

}