Skip to content

Commit 821f323

Browse files
committed
Better fix for moon
1 parent 2dd5087 commit 821f323

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

common/src/main/java/fr/tathan/sky_aesthetics/client/skies/settings/CustomVanillaObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static Moon createMoon(boolean moonPhase, ResourceLocation texture, float
5555
}
5656

5757
public void render(ClientLevel level, Tesselator tesselator, PoseStack poseStack, float nightAngle) {
58-
if(PlatformHelper.isModLoaded("lunar") && level != null) {
58+
if(PlatformHelper.isModLoaded("lunar")) {
5959
SkyCompat.drawLunarSky(level, tesselator, poseStack, moonSize(), nightAngle);
6060
} else if (this.moonPhase()) {
6161
SkyHelper.drawMoonWithPhase(level, tesselator, poseStack, moonSize(), moonTexture(), nightAngle);

common/src/main/java/fr/tathan/sky_aesthetics/helper/SkyCompat.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
public class SkyCompat {
1212

1313
public static void drawLunarSky(ClientLevel level, Tesselator tesselator, PoseStack poseStack, float y, float dayAngle) {
14-
int moonPhase = level.getMoonPhase();
14+
var moonPhase = 3;
15+
if(level != null)
16+
moonPhase = level.getMoonPhase();
1517
int xCoord = moonPhase % 4;
1618
int yCoord = moonPhase / 4 % 2;
1719
float startX = xCoord / 4.0F;

0 commit comments

Comments
 (0)