本文整理汇总了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);
}
示例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);
}
示例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]));
}
示例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);
}
};
}
示例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);
}
};
}
示例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;
}
};
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例12: getBlockColor
import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public IBlockColor getBlockColor() {
return null;
}
示例13: getBlockColor
import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public IBlockColor getBlockColor() {
return ColorHandlers.GRASS_COLORING;
}
示例14: getBlockColor
import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
IBlockColor getBlockColor();
示例15: getBlockColor
import net.minecraft.client.renderer.color.IBlockColor; //导入依赖的package包/类
@Override
public IBlockColor getBlockColor() {
return ColorHandlers.REDSTONE_COLORING;
}