Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/main/java/com/gregtechceu/gtceu/GTCEu.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ public static boolean isModernFixLoaded() {
return isModLoaded(GTValues.MODID_MODERNFIX);
}

public static boolean isJAVDLoaded() {
return isModLoaded(GTValues.MODID_JAVD);
}

public static boolean isFTBTeamsLoaded() {
return isModLoaded(GTValues.MODID_FTB_TEAMS);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/gregtechceu/gtceu/api/GTValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public static int[] tiersBetween(int minInclusive, int maxInclusive) {
MODID_XAEROS_MINIMAP = "xaerominimap",
MODID_XAEROS_WORLDMAP = "xaeroworldmap",
MODID_FTB_CHUNKS = "ftbchunks",
MODID_JAVD = "javd",
MODID_FTB_TEAMS = "ftbteams",
MODID_ARGONAUTS = "argonauts",
MODID_HERACLES = "heracles",
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -510,22 +509,23 @@ public static boolean canSeeSunClearly(Level world, BlockPos blockPos) {
return false;
}

Biome biome = world.getBiome(blockPos.above()).value();
Holder<Biome> biome = world.getBiome(blockPos.above());
if (world.isRaining()) {
if (biome.warmEnoughToRain(blockPos.above()) || biome.coldEnoughToSnow(blockPos.above())) {
if (biome.value().warmEnoughToRain(blockPos.above()) || biome.value().coldEnoughToSnow(blockPos.above())) {
return false;
}
}

if (world.getBiome(blockPos.above()).is(BiomeTags.IS_END)) {
if (biome.is(BiomeTags.IS_END)) {
return false;
}

ResourceLocation javdVoidBiome = new ResourceLocation("javd", "void");
if (GTCEu.Mods.isJAVDLoaded() &&
world.registryAccess().registryOrThrow(Registries.BIOME).getKey(biome).equals(javdVoidBiome)) {
return !world.isDay();
} else return world.isDay();
// skip the fixed time check Level.isDay() does

// skyDarken is the amount of light subtracted from the stored skylight value in
// `Level.getMaxLocalRawBrightness(pos)` depending on the time of day.
// this here is the same code Level.isDay() uses to determine whether it's day or not.
return world.getSkyDarken() < 4;
}

/**
Expand Down
Loading