예제 #1
0
  /** Gets the amount of light on a block taking into account sunlight */
  public int getBlockLightValue(int par1, int par2, int par3, int par4) {
    ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4];

    if (var5 == null) {
      return !this.worldObj.provider.hasNoSky && par4 < EnumSkyBlock.Sky.defaultLightValue
          ? EnumSkyBlock.Sky.defaultLightValue - par4
          : 0;
    } else {
      int var6 =
          this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(par1, par2 & 15, par3);

      if (var6 > 0) {
        isLit = true;
      }

      var6 -= par4;
      int var7 = var5.getExtBlocklightValue(par1, par2 & 15, par3);

      if (var7 > var6) {
        var6 = var7;
      }

      return var6;
    }
  }
예제 #2
0
 /** Gets the amount of light saved in this block (doesn't adjust for daylight) */
 public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) {
   ExtendedBlockStorage var5 = this.storageArrays[par3 >> 4];
   return var5 == null
       ? (this.canBlockSeeTheSky(par2, par3, par4) ? par1EnumSkyBlock.defaultLightValue : 0)
       : (par1EnumSkyBlock == EnumSkyBlock.Sky
           ? (this.worldObj.provider.hasNoSky
               ? 0
               : var5.getExtSkylightValue(par2, par3 & 15, par4))
           : (par1EnumSkyBlock == EnumSkyBlock.Block
               ? var5.getExtBlocklightValue(par2, par3 & 15, par4)
               : par1EnumSkyBlock.defaultLightValue));
 }