generated from MrSphay/codex-agent-repository-kit
Fix dust crash and restore intro music
All checks were successful
Build / build (push) Successful in 12m49s
All checks were successful
Build / build (push) Successful in 12m49s
This commit is contained in:
@@ -28,6 +28,11 @@ public class FirstTimeScreen extends Screen {
|
||||
super(Component.literal("Explosion Overhaul Setup"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
IntroMusicManager.getInstance().start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
|
||||
graphics.fill(0, 0, this.width, this.height, 0xFF050506);
|
||||
@@ -76,6 +81,7 @@ public class FirstTimeScreen extends Screen {
|
||||
}
|
||||
|
||||
private void finish(Choice choice) {
|
||||
IntroMusicManager.getInstance().startFadeOut();
|
||||
Config.CLIENT.particleRenderMode.set(choice.mode);
|
||||
Config.CLIENT.glowTextureQuality.set(Config.Client.GlowTextureQuality.QUALITY_256);
|
||||
Config.CLIENT.firstLaunchComplete.set(true);
|
||||
|
||||
@@ -9,7 +9,6 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
@@ -18,6 +17,7 @@ import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
|
||||
public class GroundDustEffect {
|
||||
private final ClientLevel level;
|
||||
@@ -72,7 +72,7 @@ public class GroundDustEffect {
|
||||
new Vec3(checkX, this.center.y - 15.0, checkZ),
|
||||
ClipContext.Block.COLLIDER,
|
||||
ClipContext.Fluid.NONE,
|
||||
(Entity)null));
|
||||
CollisionContext.empty()));
|
||||
if (hit.getType() == HitResult.Type.BLOCK) {
|
||||
Color color = getDustColorForState(this.level.getBlockState(hit.getBlockPos()));
|
||||
if (color != null) {
|
||||
@@ -95,7 +95,7 @@ public class GroundDustEffect {
|
||||
new Vec3(x, this.center.y - 15.0, z),
|
||||
ClipContext.Block.COLLIDER,
|
||||
ClipContext.Fluid.NONE,
|
||||
(Entity)null));
|
||||
CollisionContext.empty()));
|
||||
if (hit.getType() != HitResult.Type.BLOCK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
|
||||
public class GroundMistEffect {
|
||||
private final ClientLevel level;
|
||||
@@ -68,7 +68,7 @@ public class GroundMistEffect {
|
||||
if (i % this.raycastFrequency == 0) {
|
||||
Vec3 from = new Vec3(x, this.center.y + 15.0, z);
|
||||
Vec3 to = new Vec3(x, this.center.y - 15.0, z);
|
||||
BlockHitResult hit = this.level.clip(new ClipContext(from, to, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, (Entity)null));
|
||||
BlockHitResult hit = this.level.clip(new ClipContext(from, to, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, CollisionContext.empty()));
|
||||
if (hit.getType() != HitResult.Type.BLOCK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,11 @@ public class GuideSlidesScreen extends Screen {
|
||||
super(Component.empty());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
IntroMusicManager.getInstance().start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
|
||||
graphics.fill(0, 0, this.width, this.height, 0xFF070708);
|
||||
|
||||
@@ -1,32 +1,60 @@
|
||||
package com.vinlanx.explosionoverhaul.client;
|
||||
|
||||
import com.vinlanx.explosionoverhaul.ModSounds;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
||||
public class IntroMusicManager {
|
||||
private static final float INTRO_VOLUME = 0.55f;
|
||||
private static final IntroMusicManager INSTANCE = new IntroMusicManager();
|
||||
private FadingMusicInstance music;
|
||||
private boolean fadingOut;
|
||||
|
||||
public static IntroMusicManager getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (this.music != null) {
|
||||
this.music.fadeTo(INTRO_VOLUME, 0.65f);
|
||||
this.fadingOut = false;
|
||||
return;
|
||||
}
|
||||
this.music = new FadingMusicInstance(ModSounds.INTRO_MUSIC.get(), INTRO_VOLUME, SoundSource.MUSIC);
|
||||
Minecraft.getInstance().getSoundManager().play(this.music);
|
||||
this.fadingOut = false;
|
||||
}
|
||||
|
||||
public void startFadeOut() {
|
||||
if (this.music != null) {
|
||||
this.music.fadeOutAndStop(1.25f);
|
||||
this.fadingOut = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (this.music != null) {
|
||||
this.music.fadeOutAndStop(0.05f);
|
||||
this.music = null;
|
||||
}
|
||||
this.fadingOut = false;
|
||||
}
|
||||
|
||||
public void stopBoomSound() {
|
||||
}
|
||||
|
||||
public void tick(float deltaTime) {
|
||||
if (this.music != null && this.music.hasFinishedFading()) {
|
||||
this.music = null;
|
||||
this.fadingOut = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPlaying() {
|
||||
return false;
|
||||
return this.music != null && !this.fadingOut;
|
||||
}
|
||||
|
||||
public boolean isFadingOut() {
|
||||
return false;
|
||||
return this.music != null && this.fadingOut;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user