本文整理了Java中net.minecraft.world.World.getSkylightSubtracted()
方法的一些代码示例,展示了World.getSkylightSubtracted()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.getSkylightSubtracted()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:getSkylightSubtracted
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public int getSkylightSubtracted() {
return wrapped.getSkylightSubtracted();
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public int getSkylightSubtracted() {
return getActualWorld().getSkylightSubtracted();
}
代码示例来源:origin: SleepyTrousers/EnderIO
public static float calculateLightRatio(World world) {
int lightValue = EnumSkyBlock.SKY.defaultLightValue - world.getSkylightSubtracted();
float sunAngle = world.getCelestialAngleRadians(1.0F);
if (sunAngle < (float) Math.PI) {
sunAngle += (0.0F - sunAngle) * 0.2F;
} else {
sunAngle += (((float) Math.PI * 2F) - sunAngle) * 0.2F;
}
lightValue = Math.round(lightValue * MathHelper.cos(sunAngle));
lightValue = MathHelper.clamp(lightValue, 0, 15);
return lightValue / 15f;
}
代码示例来源:origin: SquidDev-CC/plethora
@Nonnull
@Override
public Map<Object, Object> getMeta(@Nonnull IPartialContext<BlockReference> context) {
if (!context.getModules().hasModule(IntegrationVanilla.daylightSensorMod)) return Collections.emptyMap();
IWorldLocation location = context.getTarget().getLocation();
World world = location.getWorld();
BlockPos pos = location.getPos();
Map<Object, Object> out = Maps.newHashMap();
if (!world.provider.hasSkyLight()) {
out.put("sky", world.getLightFor(EnumSkyBlock.SKY, pos) - world.getSkylightSubtracted());
}
out.put("block", world.getLightFor(EnumSkyBlock.BLOCK, pos));
return out;
}
}
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
public void manageChagrgeAmount() {
if (!world.isRemote) {
if (world.provider.hasSkyLight()) {
float f = 0;
int i1 = world.getLightFor(EnumSkyBlock.SKY, getPos().up()) - world.getSkylightSubtracted();
if (i1 >= 15) {
f = getTime();
}
chargeAmount = (byte) Math.round(CHARGE_AMOUNT * f);
} else {
chargeAmount = 0;
}
}
}
代码示例来源: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: SquidDev-CC/plethora
@SubtargetedModuleObjectMethod.Inject(
module = IntegrationVanilla.daylightSensor, target = IWorldLocation.class,
doc = "function():int -- The light level from the sun"
)
public static Object[] getSkyLight(IWorldLocation location, IContext<IModuleContainer> context, Object[] args) throws LuaException {
World world = location.getWorld();
if (!world.provider.hasSkyLight()) {
throw new LuaException("The world has no sky");
} else {
BlockPos pos = location.getPos();
return new Object[]{world.getLightFor(EnumSkyBlock.SKY, pos) - world.getSkylightSubtracted()};
}
}
代码示例来源: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());
}
}
内容来源于网络,如有侵权,请联系作者删除!