generated from MrSphay/codex-agent-repository-kit
This commit is contained in:
@@ -5,24 +5,48 @@ import net.minecraft.client.Minecraft;
|
||||
public class DeafnessConcussionEffect {
|
||||
public static boolean debugShowChat = false;
|
||||
public static volatile boolean enabled = true;
|
||||
private static int ticksRemaining;
|
||||
private static int totalTicks;
|
||||
private static float intensity;
|
||||
|
||||
public static boolean start(float intensity, double silentSeconds, double effectivePercent, String visibility, int intensityPercent) {
|
||||
return false;
|
||||
if (!enabled) {
|
||||
return false;
|
||||
}
|
||||
DeafnessConcussionEffect.intensity = Math.max(DeafnessConcussionEffect.intensity, intensity);
|
||||
totalTicks = Math.max(1, (int)Math.round(Math.max(1.0, silentSeconds) * 20.0));
|
||||
ticksRemaining = Math.max(ticksRemaining, totalTicks);
|
||||
LowPassConcussionEffect.setDeafnessGain((float)Math.max(0.18, 1.0 - intensity * 0.75));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void stop() {
|
||||
ticksRemaining = 0;
|
||||
intensity = 0.0f;
|
||||
resetVolume();
|
||||
}
|
||||
|
||||
public static boolean isActive() {
|
||||
return false;
|
||||
return enabled && ticksRemaining > 0 && intensity > 0.01f;
|
||||
}
|
||||
|
||||
public static void resetVolume() {
|
||||
LowPassConcussionEffect.setDeafnessGain(1.0f);
|
||||
}
|
||||
|
||||
public static void applyMasterVolume(Minecraft mc, double volume) {
|
||||
}
|
||||
|
||||
public static void onClientTick() {
|
||||
if (ticksRemaining <= 0) {
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
--ticksRemaining;
|
||||
double remaining = ticksRemaining / Math.max(1.0, totalTicks);
|
||||
LowPassConcussionEffect.setDeafnessGain((float)Math.max(0.18, lerp(1.0, 1.0 - intensity * 0.75, easeOutQuad(remaining))));
|
||||
}
|
||||
|
||||
public static double lerp(double a, double b, double t) {
|
||||
return a + (b - a) * t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user