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

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

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

World.setSkylightSubtracted介绍

暂无

代码示例

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

@Override
public void setSkylightSubtracted(int newSkylightSubtracted) {
 wrapped.setSkylightSubtracted(newSkylightSubtracted);
}

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

@Override
public void setSkylightSubtracted(int newSkylightSubtracted) {
  getActualWorld().setSkylightSubtracted(newSkylightSubtracted);
}

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

protected boolean isLowLightLevel() {
  BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
  if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) {
    return false;
  } else {
    int i = this.world.getLightFromNeighbors(blockpos);
    if (this.world.isThundering()) {
      int j = this.world.getSkylightSubtracted();
      this.world.setSkylightSubtracted(10);
      i = this.world.getLightFromNeighbors(blockpos);
      this.world.setSkylightSubtracted(j);
    }
    return i <= this.rand.nextInt(8);
  }
}

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

/**
 * @see EntityMob
 */
private boolean isValidLightLevel() {
  BlockPos blockpos = new BlockPos(posX, getEntityBoundingBox().minY, posZ);
  if (world.getLightFor(EnumSkyBlock.SKY, blockpos) > rand.nextInt(32)) {
    return false;
  } else {
    int i = world.getLightFromNeighbors(blockpos);
    if (world.isThundering()) {
      int j = world.getSkylightSubtracted();
      world.setSkylightSubtracted(10);
      i = world.getLightFromNeighbors(blockpos);
      world.setSkylightSubtracted(j);
    }
    return i <= rand.nextInt(8);
  }
}

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

/**
 * Checks to make sure the light is not too bright where the mob is spawning
 */
private boolean isValidLightLevel() {
  BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
  if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) {
    return false;
  } else {
    int i = this.world.getLightFromNeighbors(blockpos);
    if (this.world.isThundering()) {
      int j = this.world.getSkylightSubtracted();
      this.world.setSkylightSubtracted(10);
      i = this.world.getLightFromNeighbors(blockpos);
      this.world.setSkylightSubtracted(j);
    }
    return i <= this.rand.nextInt(8);
  }
}

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

protected boolean isValidLightLevel()
{
  BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
  if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
  {
    return false;
  }
  else
  {
    int i = this.world.getLightFromNeighbors(blockpos);
    if (this.world.isThundering())
    {
      int j = this.world.getSkylightSubtracted();
      this.world.setSkylightSubtracted(10);
      i = this.world.getLightFromNeighbors(blockpos);
      this.world.setSkylightSubtracted(j);
    }
    return i <= this.rand.nextInt(8);
  }
}

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

@Override
protected boolean isValidLightLevel() {
  if (!restrictLightLevel()) {
    return true;
  }
  BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
  if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) {
    return false;
  } else {
    int i = this.world.getLightFromNeighbors(blockpos);
    if (this.world.isThundering()) {
      int j = this.world.getSkylightSubtracted();
      this.world.setSkylightSubtracted(10);
      i = this.world.getLightFromNeighbors(blockpos);
      this.world.setSkylightSubtracted(j);
    }
    return i <= this.rand.nextInt(getSpawnLightLevel());
  }
}

相关文章

微信公众号

最新文章

更多

World类方法