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


Java ColorizerFoliage类代码示例

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


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

示例1: colorMultiplier

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() == this)
    {
        BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType)iblockstate.getValue(VARIANT);

        if (blockplanks$enumtype == BlockPlanks.EnumType.SPRUCE)
        {
            return ColorizerFoliage.getFoliageColorPine();
        }

        if (blockplanks$enumtype == BlockPlanks.EnumType.BIRCH)
        {
            return ColorizerFoliage.getFoliageColorBirch();
        }
    }

    return super.colorMultiplier(worldIn, pos, renderPass);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:BlockOldLeaf.java

示例2: setBlockBiomeTint

import net.minecraft.world.ColorizerFoliage; //导入依赖的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

示例3: genBiomeColours

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
private static void genBiomeColours(BlockColours bc) {
	// generate array of foliage, grass, and water colour multipliers
	// for each biome.

	for (Object oBiome : Biome.REGISTRY) {
		Biome biome = (Biome) oBiome;

		if (biome != null) {
			double temp = MathHelper.clamp(biome.getTemperature(), 0.0F, 1.0F);
			double rain = MathHelper.clamp(biome.getRainfall(), 0.0F, 1.0F);
			int grasscolor = ColorizerGrass.getGrassColor(temp, rain);
			int foliagecolor = ColorizerFoliage.getFoliageColor(temp, rain);
			int watercolor = biome.getWaterColorMultiplier();

			bc.setBiomeData(biome.getBiomeName(), watercolor & 0xffffff, grasscolor & 0xffffff, foliagecolor & 0xffffff);
		}
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:19,代码来源:BlockColourGen.java

示例4: init

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@Override
public void init()
{

    Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(
            new IBlockColor()
            {
                public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex)
                {
                    if (world != null && pos != null)
                        return BiomeColorHelper.getFoliageColorAtPos(world, pos);
                    else
                        return ColorizerFoliage.getFoliageColorBasic();
                }
            }, NaturalTrees.branchOak, NaturalTrees.branchBirch,
            NaturalTrees.branchSpruce, NaturalTrees.branchJungle,
            NaturalTrees.branchDarkOak, NaturalTrees.branchAcacia);
}
 
开发者ID:gigaherz,项目名称:NaturalTrees,代码行数:19,代码来源:ClientProxy.java

示例5: func_71920_b

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public int func_71920_b(IBlockAccess p_71920_1_, int p_71920_2_, int p_71920_3_, int p_71920_4_) {
   int var5 = p_71920_1_.func_72805_g(p_71920_2_, p_71920_3_, p_71920_4_);
   if((var5 & 3) == 1) {
      return ColorizerFoliage.func_77466_a();
   } else if((var5 & 3) == 2) {
      return ColorizerFoliage.func_77469_b();
   } else {
      int var6 = 0;
      int var7 = 0;
      int var8 = 0;

      for(int var9 = -1; var9 <= 1; ++var9) {
         for(int var10 = -1; var10 <= 1; ++var10) {
            int var11 = p_71920_1_.func_72807_a(p_71920_2_ + var10, p_71920_4_ + var9).func_76726_l();
            var6 += (var11 & 16711680) >> 16;
            var7 += (var11 & '\uff00') >> 8;
            var8 += var11 & 255;
         }
      }

      return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255;
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:BlockLeaves.java

示例6: getRenderColor

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
public int getRenderColor(IBlockState state)
{
    if (state.getBlock() != this)
    {
        return super.getRenderColor(state);
    }
    else
    {
        BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType)state.getValue(VARIANT);
        return blockplanks$enumtype == BlockPlanks.EnumType.SPRUCE ? ColorizerFoliage.getFoliageColorPine() : (blockplanks$enumtype == BlockPlanks.EnumType.BIRCH ? ColorizerFoliage.getFoliageColorBirch() : super.getRenderColor(state));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:BlockOldLeaf.java

示例7: onResourceManagerReload

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
public void onResourceManagerReload(IResourceManager resourceManager)
{
    try
    {
        ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(resourceManager, LOC_FOLIAGE_PNG));
    }
    catch (IOException var3)
    {
        ;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:FoliageColorReloadListener.java

示例8: getFoliageColorAtPos

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public int getFoliageColorAtPos(BlockPos pos)
{
    double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F);
    double d1 = (double)MathHelper.clamp_float(this.getRainfall(), 0.0F, 1.0F);
    return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:Biome.java

示例9: getRenderColor

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public int getRenderColor(IBlockState state)
{
    switch (variant)
    {
        case BIRCH:
            return ColorizerFoliage.getFoliageColorBirch();
        case SPRUCE:
            return ColorizerFoliage.getFoliageColorPine();
    }
    return ColorizerFoliage.getFoliageColorBasic();
}
 
开发者ID:gigaherz,项目名称:NaturalTrees,代码行数:13,代码来源:BlockBranch.java

示例10: getBiomeFoliageColor

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
/**
 * Provides the basic foliage color based on the biome temperature and rainfall
 */
public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_)
{
    double var4 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F);
    double var6 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
    return ColorizerFoliage.getFoliageColor(var4, var6);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:BiomeGenBase.java

示例11: onResourceManagerReload

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
public void onResourceManagerReload(IResourceManager par1ResourceManager)
{
    try
    {
        ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130079_a));
    }
    catch (IOException var3)
    {
        ;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:12,代码来源:FoliageColorReloadListener.java

示例12: getBlockColor

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public int getBlockColor()
{
    double d0 = 0.5D;
    double d1 = 1.0D;
    return ColorizerFoliage.getFoliageColor(d0, d1);
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:8,代码来源:BlockLeavesMF.java

示例13: getRenderColor

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@SideOnly(Side.CLIENT)

    /**
     * Returns the color this block should be rendered. Used by leaves.
     */
    public int getRenderColor(int meta)
    {
        return (meta & 3) == 1 ? ColorizerFoliage.getFoliageColorBasic() : ((meta & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic());
    }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:10,代码来源:BlockLeavesMF.java

示例14: colorMultiplier

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
@SideOnly(Side.CLIENT)

    /**
     * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
     * when first determining what to render.
     */
    public int colorMultiplier(IBlockAccess world, int x, int y, int z)
    {
        int l = world.getBlockMetadata(x, y, z);

        if ((l & 3) == 1)
        {
            return ColorizerFoliage.getFoliageColorPine();
        }
        else if ((l & 3) == 2)
        {
            return ColorizerFoliage.getFoliageColorBirch();
        }
        else
        {
            int i1 = 0;
            int j1 = 0;
            int k1 = 0;

            for (int l1 = -1; l1 <= 1; ++l1)
            {
                for (int i2 = -1; i2 <= 1; ++i2)
                {
                    int j2 = world.getBiomeGenForCoords(x + i2, z + l1).getBiomeFoliageColor();
                    i1 += (j2 & 16711680) >> 16;
                    j1 += (j2 & 65280) >> 8;
                    k1 += j2 & 255;
                }
            }

            return (i1 / 9 & 255) << 16 | (j1 / 9 & 255) << 8 | k1 / 9 & 255;
        }
    }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:39,代码来源:BlockLeavesMF.java

示例15: colorMultiplier

import net.minecraft.world.ColorizerFoliage; //导入依赖的package包/类
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
    int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);

    if ((l & 3) == 1)
    {
        return ColorizerFoliage.getFoliageColorPine();
    }
    else if ((l & 3) == 2)
    {
        return ColorizerFoliage.getFoliageColorBirch();
    }
    else
    {
        int i1 = 0;
        int j1 = 0;
        int k1 = 0;

        for (int l1 = -1; l1 <= 1; ++l1)
        {
            for (int i2 = -1; i2 <= 1; ++i2)
            {
                int j2 = par1IBlockAccess.getBiomeGenForCoords(par2 + i2, par4 + l1).getBiomeFoliageColor();
                i1 += (j2 & 16711680) >> 16;
                j1 += (j2 & 65280) >> 8;
                k1 += j2 & 255;
            }
        }

        return (i1 / 9 & 255) << 16 | (j1 / 9 & 255) << 8 | k1 / 9 & 255;
    }
}
 
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:33,代码来源:BlockFCraftLeaves.java


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