spacepaste

  1.  
  2. protected boolean isValidLightLevel()
  3. {
  4. BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
  5. if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
  6. {
  7. return false;
  8. }
  9. else
  10. {
  11. int i = this.world.getLightFromNeighbors(blockpos);
  12. if (this.world.isThundering())
  13. {
  14. int j = this.world.getSkylightSubtracted();
  15. this.world.setSkylightSubtracted(10);
  16. i = this.world.getLightFromNeighbors(blockpos);
  17. this.world.setSkylightSubtracted(j);
  18. }
  19. return i <= this.rand.nextInt(8);
  20. }
  21. }
  22.