Compare commits

..

3 Commits
test ... test-2

Author SHA1 Message Date
Liz Graham
9584d5ad94 work pls 2022-03-25 15:07:00 +00:00
Liz Graham
705402c139 ??? 2022-03-25 15:02:58 +00:00
Liz Graham
0bf6db4415 hopefully fix workflow ?? 2022-03-25 15:00:47 +00:00
2 changed files with 49 additions and 4 deletions

View File

@@ -52,9 +52,8 @@ jobs:
java: 17 java: 17
dependencies: | dependencies: |
fabric-api | depends | 0.46.0 fabric | depends | 0.46.0
kirin | includes | 1.10.0-beta.2 kirin | includes | 1.10.0-beta.2
modmenu | recommends | * modmenu | recommends | *
version-resolver: latest # Defaults to selecting the latest compatible version of Minecraft, using the tag from the fabric.mod.json version-resolver: latest # Defaults to selecting the latest compatible version of Minecraft, using the tag from the fabric.mod.json

View File

@@ -0,0 +1,46 @@
package net.lizistired.cavedust.utils;
import net.lizistired.cavedust.CaveDustConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.world.World;
import java.util.Objects;
import java.util.Optional;
import static net.minecraft.world.biome.BiomeKeys.LUSH_CAVES;
public class ParticleSpawnUtil {
private static float timer;
public static boolean shouldParticlesSpawn;
public static boolean shouldParticlesSpawn(MinecraftClient client, CaveDustConfig config) {
//checks if the config is enabled, if the game isn't paused, if the world is valid, if the particle is valid and if the player isn't in a lush caves biome
if (!config.getCaveDustEnabled()
|| client.isPaused()
|| client.world == null
|| !client.world.getDimension().isBedWorking()
|| Objects.equals(client.world.getBiomeKey(Objects.requireNonNull(client.player).getBlockPos()), Optional.of(LUSH_CAVES))
|| Objects.requireNonNull(client.player).isSubmergedInWater())
{
timer = 0;
shouldParticlesSpawn = false;
return false;
}
World world = client.world;
int seaLevel = world.getSeaLevel();
if (!client.player.clientWorld.isSkyVisible(client.player.getBlockPos())) {
if (client.player.getBlockPos().getY() < seaLevel){
timer = timer + 1;
if (timer > 10){
timer = 10;
shouldParticlesSpawn = true;
return true;
}
}
}
shouldParticlesSpawn = false;
return false;
}
}