net.minecraft.world.World.setSkylightSubtracted()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中net.minecraft.world.World.setSkylightSubtracted()方法的一些代码示例,展示了World.setSkylightSubtracted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.setSkylightSubtracted()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:setSkylightSubtracted

World.setSkylightSubtracted介绍

暂无

代码示例

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public void setSkylightSubtracted(int newSkylightSubtracted) {
  3. wrapped.setSkylightSubtracted(newSkylightSubtracted);
  4. }

代码示例来源:origin: amadornes/MCMultiPart

  1. @Override
  2. public void setSkylightSubtracted(int newSkylightSubtracted) {
  3. getActualWorld().setSkylightSubtracted(newSkylightSubtracted);
  4. }

代码示例来源:origin: TeamLapen/Vampirism

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

代码示例来源:origin: Silentine/GrimoireOfGaia

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

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. /**
  2. * Checks to make sure the light is not too bright where the mob is spawning
  3. */
  4. private boolean isValidLightLevel() {
  5. BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
  6. if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) {
  7. return false;
  8. } else {
  9. int i = this.world.getLightFromNeighbors(blockpos);
  10. if (this.world.isThundering()) {
  11. int j = this.world.getSkylightSubtracted();
  12. this.world.setSkylightSubtracted(10);
  13. i = this.world.getLightFromNeighbors(blockpos);
  14. this.world.setSkylightSubtracted(j);
  15. }
  16. return i <= this.rand.nextInt(8);
  17. }
  18. }

代码示例来源:origin: CyclopsMC/EvilCraft

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

代码示例来源:origin: CoFH/ThermalFoundation

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

相关文章

World类方法