當前位置: 首頁>>代碼示例>>Java>>正文


Java IBlockAccess.getCombinedLight方法代碼示例

本文整理匯總了Java中net.minecraft.world.IBlockAccess.getCombinedLight方法的典型用法代碼示例。如果您正苦於以下問題:Java IBlockAccess.getCombinedLight方法的具體用法?Java IBlockAccess.getCombinedLight怎麽用?Java IBlockAccess.getCombinedLight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.world.IBlockAccess的用法示例。


在下文中一共展示了IBlockAccess.getCombinedLight方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMixedBrightnessForBlock

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos)
{
    Block block = worldIn.getBlockState(pos).getBlock();
    int i = worldIn.getCombinedLight(pos, block.getLightValue());

    if (i == 0 && block instanceof BlockSlab)
    {
        pos = pos.down();
        block = worldIn.getBlockState(pos).getBlock();
        return worldIn.getCombinedLight(pos, block.getLightValue());
    }
    else
    {
        return i;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:Block.java

示例2: getPackedLightmapCoords

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Deprecated
@SideOnly(Side.CLIENT)
public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos)
{
    int i = source.getCombinedLight(pos, state.getLightValue(source, pos));

    if (i == 0 && (state.getBlock() instanceof net.minecraft.block.BlockSlab || state.getBlock() instanceof BlockSlab))
    {
        pos = pos.down();
        state = source.getBlockState(pos);
        return source.getCombinedLight(pos, state.getLightValue(source, pos));
    } else
    {
        return i;
    }
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:17,代碼來源:BlockSlab.java

示例3: getPackedLightmapCoords

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Deprecated
  public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos)
  {
  	if(Hacks.findMod(XRay.class).isEnabled()) {
	return 1000;
}
  	
      int i = source.getCombinedLight(pos, state.getLightValue());

      if (i == 0 && state.getBlock() instanceof BlockSlab)
      {
          pos = pos.down();
          state = source.getBlockState(pos);
          return source.getCombinedLight(pos, state.getLightValue());
      }
      else
      {
          return i;
      }
  }
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:21,代碼來源:Block.java

示例4: getPackedLightmapCoords

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Deprecated
@SideOnly(Side.CLIENT)
public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos)
{
    int i = source.getCombinedLight(pos, state.getLightValue(source, pos));

    if (i == 0 && state.getBlock() instanceof BlockSlab)
    {
        pos = pos.down();
        state = source.getBlockState(pos);
        return source.getCombinedLight(pos, state.getLightValue(source, pos));
    }
    else
    {
        return i;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:Block.java

示例5: getMixedBrightnessForBlock

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos)
{
    int i = worldIn.getCombinedLight(pos, 0);
    int j = worldIn.getCombinedLight(pos.up(), 0);
    int k = i & 255;
    int l = j & 255;
    int i1 = i >> 16 & 255;
    int j1 = j >> 16 & 255;
    return (k > l ? k : l) | (i1 > j1 ? i1 : j1) << 16;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:11,代碼來源:BlockLiquid.java

示例6: getMixedBrightnessForBlock

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) {
	Block block = worldIn.getBlockState(pos).getBlock();
	int i = worldIn.getCombinedLight(pos, block.getLightValue());

	if (i == 0 && block instanceof BlockSlab) {
		pos = pos.down();
		block = worldIn.getBlockState(pos).getBlock();
		return worldIn.getCombinedLight(pos, block.getLightValue());
	} else {
		return i;
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:13,代碼來源:Block.java

示例7: getMixedBrightnessForBlock

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) {
	int i = worldIn.getCombinedLight(pos, 0);
	int j = worldIn.getCombinedLight(pos.up(), 0);
	int k = i & 255;
	int l = j & 255;
	int i1 = i >> 16 & 255;
	int j1 = j >> 16 & 255;
	return (k > l ? k : l) | (i1 > j1 ? i1 : j1) << 16;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:BlockLiquid.java

示例8: getPackedLightmapCoords

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos)
{
    int i = source.getCombinedLight(pos, 0);
    int j = source.getCombinedLight(pos.up(), 0);
    int k = i & 255;
    int l = j & 255;
    int i1 = i >> 16 & 255;
    int j1 = j >> 16 & 255;
    return (k > l ? k : l) | (i1 > j1 ? i1 : j1) << 16;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:11,代碼來源:BlockLiquid.java

示例9: getPackedLightmapCoords

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@Override
public int getPackedLightmapCoords(IBlockState state, IBlockAccess world, BlockPos pos)
{
    int lightThis     = world.getCombinedLight(pos, 0);
    int lightUp       = world.getCombinedLight(pos.up(), 0);
    int lightThisBase = lightThis & 255;
    int lightUpBase   = lightUp & 255;
    int lightThisExt  = lightThis >> 16 & 255;
    int lightUpExt    = lightUp >> 16 & 255;
    return (lightThisBase > lightUpBase ? lightThisBase : lightUpBase) |
           ((lightThisExt > lightUpExt ? lightThisExt : lightUpExt) << 16);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:13,代碼來源:BlockFluidBase.java

示例10: getPackedLightmapCoords

import net.minecraft.world.IBlockAccess; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos)
{
    int i = source.getCombinedLight(pos, 0);
    int j = source.getCombinedLight(pos.up(), 0);
    int k = i & 255;
    int l = j & 255;
    int i1 = i >> 16 & 255;
    int j1 = j >> 16 & 255;
    return (k > l ? k : l) | (i1 > j1 ? i1 : j1) << 16;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:12,代碼來源:BlockLiquid.java


注:本文中的net.minecraft.world.IBlockAccess.getCombinedLight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。