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


Java BlockColors类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.color.BlockColors的典型用法代码示例。如果您正苦于以下问题:Java BlockColors类的具体用法?Java BlockColors怎么用?Java BlockColors使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BlockColors类属于net.minecraft.client.renderer.color包,在下文中一共展示了BlockColors类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBlockBiomeTint

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@Override
public void setBlockBiomeTint(Block block, IntFunction<BlockTint> tintTypeForSubtype)
{
    if (!(block instanceof CSBlock))
        return;

    BlockColors blockColors = Minecraft.getMinecraft().getBlockColors();
    CSBlock csBlock = (CSBlock) block;
    blockColors.registerBlockColorHandler(
            (state, worldIn, pos, tintIndex) -> {
                if (worldIn == null || pos == null)
                    return ColorizerFoliage.getFoliageColorBasic();

                return tintTypeForSubtype.apply(csBlock.getSubtype(state)).getMultiplier(worldIn, pos);

                /*if (tintType == BiomeTintType.FOLIAGE)
                    return BiomeColorHelper.getFoliageColorAtPos(worldIn, pos);
                if (tintType == BiomeTintType.GRASS)
                    return BiomeColorHelper.getGrassColorAtPos(worldIn, pos);
                if (tintType == BiomeTintType.WATER)
                    return BiomeColorHelper.getWaterColorAtPos(worldIn, pos);

                return -1;*/
            }, block);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:26,代码来源:ClientProxy.java

示例2: init

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@Override
public void init() {
    BlockColors blockColors = Minecraft.getMinecraft().getBlockColors();
    ItemColors itemColors = Minecraft.getMinecraft().getItemColors();

    for (IBlockColored block : COLOR_BLOCKS) {
        blockColors.registerBlockColorHandler(block::getColorMultiplier,(Block)block);
    }

    for (IItemColored item : COLOR_ITEMS) {
        itemColors.registerItemColorHandler(item::getColorFromItemstack,(Item)item);
    }

    registerTESRs();
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:16,代码来源:ClientProxy.java

示例3: BlockModelRenderer

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
public BlockModelRenderer(BlockColors blockColorsIn)
{
    this.blockColors = blockColorsIn;

    if (Reflector.ForgeModContainer_forgeLightPipelineEnabled.exists())
    {
        Reflector.setFieldValue(Reflector.ForgeModContainer_forgeLightPipelineEnabled, Boolean.valueOf(false));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:BlockModelRenderer.java

示例4: registerBlockColourHandlers

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
/**
     * Register the {@link IBlockColor} handlers.
     *
     * @param blockColors The BlockColors instance
     */
    private static void registerBlockColourHandlers(final BlockColors blockColors) {
        // Use the grass colour of the biome or the default grass colour
//		final IBlockColor grassColourHandler = (state, blockAccess, pos, tintIndex) -> {
//			if (blockAccess != null && pos != null) {
//				return BiomeColorHelper.getGrassColorAtPos(blockAccess, pos);
//			}
//
//			return ColorizerGrass.getGrassColor(0.5D, 1.0D);
//		};
//
//		blockColors.registerBlockColorHandler(grassColourHandler, ModBlocks.WATER_GRASS);
    }
 
开发者ID:droidicus,项目名称:AquaRegia,代码行数:18,代码来源:ModColourManager.java

示例5: registerItemColourHandlers

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
/**
     * Register the {@link IItemColor} handlers
     *
     * @param blockColors The BlockColors instance
     * @param itemColors  The ItemColors instance
     */
    private static void registerItemColourHandlers(final BlockColors blockColors, final ItemColors itemColors) {
        // Use the Block's colour handler for an ItemBlock
//		final IItemColor itemBlockColourHandler = (stack, tintIndex) -> {
//			@SuppressWarnings("deprecation")
//			final IBlockState state = ((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata());
//			return blockColors.colorMultiplier(state, null, null, tintIndex);
//		};
//
//		itemColors.registerItemColorHandler(itemBlockColourHandler, ModBlocks.WATER_GRASS);
    }
 
开发者ID:droidicus,项目名称:AquaRegia,代码行数:17,代码来源:ModColourManager.java

示例6: registerBlocks

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@Override
public void registerBlocks() {
    super.registerBlocks();

    ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new AltarRenderer());

    BlockColors bc = Minecraft.getMinecraft().getBlockColors();
    bc.registerBlockColorHandler(ExoContent.CHALK, ExoContent.CHALK);
}
 
开发者ID:ExoMagica,项目名称:ExoMagica,代码行数:10,代码来源:ClientProxy.java

示例7: registerBlockColor

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
private static <T extends Block & IColorBlock> void registerBlockColor() {
	BlockColors colors = Minecraft.getMinecraft().getBlockColors();
	for (T t : (List<T>) block_color) {
		IBlockColor color = t.getBlockColor();
		if (color != null) {
			colors.registerBlockColorHandler(color, t);
			AlchemyInitHook.push_event(t);
		}
	}
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:11,代码来源:AlchemyColorLoader.java

示例8: registerRendering

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void registerRendering() {
	RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
	BlockColors colors = Minecraft.getMinecraft().getBlockColors();
	ItemColors icolors = Minecraft.getMinecraft().getItemColors();
	for(Block block : blocks) {
		renderItem.getItemModelMesher().register(Item.getItemFromBlock(block), 0, 
				new ModelResourceLocation(RefStrings.MODID + ":" + block.getUnlocalizedName().substring(5), "inventory"));
		colors.registerBlockColorHandler(new EverythingBlockColor(), block);
		icolors.registerItemColorHandler(new EverythingItemColor(), block);
	}
}
 
开发者ID:sblectric,项目名称:EverythingBlocks,代码行数:13,代码来源:EBBlocks.java

示例9: Init

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@Override
public void Init() {
	final BlockColors blockcolors = Minecraft.getMinecraft().getBlockColors();
	blockcolors.registerBlockColorHandler(new IBlockColor() {
		public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) {
			return worldIn != null && pos != null ? BiomeColorHelper.getGrassColorAtPos(worldIn, pos) : ColorizerGrass.getGrassColor(0.5D, 1.0D);
		}
	}, ModBlocks.machinemowedgrass);
}
 
开发者ID:TechStack,项目名称:TechStack-s-HeavyMachineryMod,代码行数:10,代码来源:ClientProxy.java

示例10: registerColors

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@Override
public void registerColors(){
	ItemColors items = Minecraft.getMinecraft().getItemColors();
	BlockColors blocks = Minecraft.getMinecraft().getBlockColors();
	items.registerItemColorHandler(new DustPouchItemColor(), WizardryRegistry.dust_pouch);
	registerDustColors(items);
	registerDustBlockColors(blocks,items);
}
 
开发者ID:Xilef11,项目名称:Runes-of-Wizardry,代码行数:9,代码来源:ClientProxy.java

示例11: registerDustBlockColors

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
private static void registerDustBlockColors(BlockColors bcols, ItemColors icols){
	for(IDustStorageBlock block: DustRegistry.getAllBlocks()){
		if(block.getInstance() instanceof ADustStorageBlock){
			bcols.registerBlockColorHandler(DustStorageBlockColor.instance(), block.getInstance());
			icols.registerItemColorHandler(DustStorageItemBlockColor.instance(),Item.getItemFromBlock(block.getInstance()));
		}
	}
}
 
开发者ID:Xilef11,项目名称:Runes-of-Wizardry,代码行数:9,代码来源:ClientProxy.java

示例12: registerBlockHandler

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
@SubscribeEvent
public static void registerBlockHandler(ColorHandlerEvent.Block evt) {
	final BlockColors blockColors = evt.getBlockColors();

	if (OpenBlocks.Blocks.canvas != null) {
		blockColors.registerBlockColorHandler(new BlockCanvas.InnerBlockColorHandler(blockColors), OpenBlocks.Blocks.canvas);
	}

	if (OpenBlocks.Blocks.paintMixer != null) {
		blockColors.registerBlockColorHandler(new BlockPaintMixer.BlockColorHandler(), OpenBlocks.Blocks.paintMixer);
	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:13,代码来源:BlockColorHandlerRegistration.java

示例13: getBlockColors

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
public BlockColors getBlockColors()
{
    return this.blockColors;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:Minecraft.java

示例14: BlockFluidRenderer

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
public BlockFluidRenderer(BlockColors blockColorsIn)
{
    this.blockColors = blockColorsIn;
    this.initAtlasSprites();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:BlockFluidRenderer.java

示例15: BlockRendererDispatcher

import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_)
{
    this.blockModelShapes = p_i46577_1_;
    this.blockModelRenderer = new BlockModelRenderer(p_i46577_2_);
    this.fluidRenderer = new BlockFluidRenderer(p_i46577_2_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:BlockRendererDispatcher.java


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