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


Java IBlockColor类代码示例

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


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

示例1: initBlockColors

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
    public void initBlockColors() {
        Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new IBlockColor() {
            @Override
            public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
                if (pos != null && worldIn != null) {
                    TileEntity te = worldIn.getTileEntity(pos);
                    if (te instanceof LightTE) {
                        LightTE tileEntity = (LightTE) te;
                        return 0xff0000;
//                        return tileEntity.getShieldColor();
                    }
                }
                return 0xffffff;
            }
        }, this);
    }
 
开发者ID:romelo333,项目名称:rflux,代码行数:18,代码来源:LightBlock.java

示例2: init

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的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

示例3: registerColoredBlocksAndItems

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void registerColoredBlocksAndItems() {
  NNList<Block> blocklist = new NNList<Block>();
  NNList<Item> itemlist = new NNList<Item>();
  for (RegistrationHolder<?, ?> holder : blocks) {
    Block block = holder.block;
    Item item = Item.getItemFromBlock(block);
    if (block instanceof IPaintable || block instanceof ITintedBlock || block instanceof ITintedItem || item instanceof ITintedItem) {
      blocklist.add(block);
      if (item != Items.AIR) {
        itemlist.add(item);
      }
    } else {
      if (block instanceof IBlockColor) {
        Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((IBlockColor) block, block);
      }
      if (item instanceof IItemColor) {
        Minecraft.getMinecraft().getItemColors().registerItemColorHandler((IItemColor) item, item);
      }
    }
  }

  PaintTintHandler handler = new PaintTintHandler();
  Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(handler, blocklist.toArray(new Block[0]));
  Minecraft.getMinecraft().getItemColors().registerItemColorHandler(handler, itemlist.toArray(new Item[0]));
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:27,代码来源:SmartModelAttacher.java

示例4: getFoliageColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
private static IBlockColor getFoliageColor (final IBlockColor original) {
	return new IBlockColor() {
		
		@Override
		public int colorMultiplier(IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
			return Seasons.enabled ? LeavesGrassUtils.getLeavesColor(state, p_186720_2_, pos, original.colorMultiplier(state, p_186720_2_, pos, tintIndex)) : original.colorMultiplier(state, p_186720_2_, pos, tintIndex);
		}
	};
}
 
开发者ID:EdwinMindcraft,项目名称:SeasonsAPI,代码行数:10,代码来源:LeavesGrassUtils.java

示例5: getGrassColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
private static IBlockColor getGrassColor (final IBlockColor original) {
	return new IBlockColor() {
		
		@Override
		public int colorMultiplier(IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
			return Seasons.enabled ? LeavesGrassUtils.getGrassColor(state, p_186720_2_, pos, original.colorMultiplier(state, p_186720_2_, pos, tintIndex)) : original.colorMultiplier(state, p_186720_2_, pos, tintIndex);
		}
	};
}
 
开发者ID:EdwinMindcraft,项目名称:SeasonsAPI,代码行数:10,代码来源:LeavesGrassUtils.java

示例6: getBlockColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IBlockColor getBlockColor() {
	return new IBlockColor() {
		
		@Override
		public int colorMultiplier(IBlockState state, IBlockAccess access, BlockPos pos, int index) {
			return index == 1 ? color : -1;
		}
		
	};
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:13,代码来源:AlchemyBlockColor.java

示例7: registerBlockColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的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: Init

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的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

示例9: registerBlockColorHandler

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public void registerBlockColorHandler(Block block){
    if (block instanceof IBlockColor){
        IBlockColor iBlockColor = (IBlockColor) block;
        blockColor.registerBlockColorHandler(iBlockColor,block);
    }
}
 
开发者ID:Dark32,项目名称:NordMod,代码行数:8,代码来源:RegisterColorHelper.java

示例10: initRenderers

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public void initRenderers() {
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPhantomLight.class, new TileEntityPhantomLightRenderer());
    RenderUtil.setupColors();
    minecraft.getBlockColors().registerBlockColorHandler(new IBlockColor() {
        @Override
        public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int renderPass) {
            return getColorAsInt(state.getValue(BlockFLColorableMachine.COLOR));
        }
    },ModBlocks.blockCarbonLight,ModBlocks.blockElectricLight,ModBlocks.blockSmallElectricLight);
}
 
开发者ID:Keridos,项目名称:FloodLights,代码行数:12,代码来源:ClientProxy.java

示例11: colorMultiplier

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public int colorMultiplier(@Nonnull IBlockState state, @Nullable IBlockAccess world, @Nullable BlockPos pos, int tintIndex) {
  if (world == null || pos == null) {
    return -1;
  }
  Block block = state.getBlock();

  IBlockState paintSource = null;
  if (block instanceof IPaintable) {
    paintSource = ((IPaintable) block).getPaintSource(state, world, pos);
    if (paintSource != null && paintSource.getBlock() != block) {
      block = paintSource.getBlock();
      state = paintSource;
    } else {
      paintSource = null;
    }
  }
  if (block instanceof ITintedBlock) {
    return ((ITintedBlock) block).getBlockTint(state, world, pos, tintIndex);
  }
  if (block instanceof IBlockColor) {
    return ((IBlockColor) block).colorMultiplier(state, world, pos, tintIndex);
  }
  if (paintSource != null) {
    return Minecraft.getMinecraft().getBlockColors().colorMultiplier(paintSource, world, pos, tintIndex);
  }
  return -1;
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:29,代码来源:PaintTintHandler.java

示例12: getBlockColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public IBlockColor getBlockColor() {
    return null;
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:5,代码来源:ItemToolShard.java

示例13: getBlockColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public IBlockColor getBlockColor() {
    return ColorHandlers.GRASS_COLORING;
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:5,代码来源:BlockExtraGrass.java

示例14: getBlockColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
IBlockColor getBlockColor();
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:3,代码来源:IColorable.java

示例15: getBlockColor

import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public IBlockColor getBlockColor() {
    return ColorHandlers.REDSTONE_COLORING;
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:5,代码来源:BlockWirePCB.java


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