hide sun and moon behind void, fix wrong skylight for entity

This commit is contained in:
LabyStudio
2022-05-03 01:15:49 +02:00
parent 058b81210a
commit e68243220a
2 changed files with 72 additions and 66 deletions
+6 -1
View File
@@ -534,11 +534,16 @@ export default class World {
getStarBrightness(partialTicks) {
let angle = this.getCelestialAngle(partialTicks);
let rotation = 1.0 - (Math.cos(angle * 3.141593 * 2.0) * 2.0 + 0.75);
let rotation = 1.0 - (Math.cos(angle * Math.PI * 2.0) * 2.0 + 0.75);
rotation = MathHelper.clamp(rotation, 0.0, 1.0);
return rotation * rotation * 0.5;
}
getLightBrightnessForEntity(entity) {
let level = this.getTotalLightAt(Math.floor(entity.x), Math.floor(entity.y), Math.floor(entity.z));
return Math.max(level / 15, 0.1);
}
getLightBrightness(x, y, z) {
let level = this.getTotalLightAt(x, y, z);
return Math.max(level / 15, 0.1);