本文整理汇总了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);
}
示例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();
}
示例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));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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()));
}
}
}
示例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);
}
}
示例13: getBlockColors
import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
public BlockColors getBlockColors()
{
return this.blockColors;
}
示例14: BlockFluidRenderer
import net.minecraft.client.renderer.color.BlockColors; //导入依赖的package包/类
public BlockFluidRenderer(BlockColors blockColorsIn)
{
this.blockColors = blockColorsIn;
this.initAtlasSprites();
}
示例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_);
}