From 79351b3ce71737694d5e860f123a31014e2b6fb1 Mon Sep 17 00:00:00 2001 From: Edrax Doodles Date: Mon, 2 Dec 2024 22:19:44 -0300 Subject: [PATCH] sounds fix --- .../client/renderer/vortex/VortexRenderer.java | 10 ++++++++-- .../client/screen/selections/ShellSelectionScreen.java | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/whocraft/tardis_refined/client/renderer/vortex/VortexRenderer.java b/common/src/main/java/whocraft/tardis_refined/client/renderer/vortex/VortexRenderer.java index ed06d1fe8..7355be6ba 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/renderer/vortex/VortexRenderer.java +++ b/common/src/main/java/whocraft/tardis_refined/client/renderer/vortex/VortexRenderer.java @@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.renderer.RenderHelper; +import whocraft.tardis_refined.common.capability.player.TardisPlayerInfo; import java.util.ArrayList; import java.util.HashMap; @@ -269,8 +270,13 @@ public void renderQuad(PoseStack poseStack, float time_offset, float opacity) { if (lightning && System.currentTimeMillis() % 5 == 0) if (lightning && Math.random() > 0.95f) { lightning_a = 3; if (tO > 0) lightning_strike = (opacity * (1 - Mth.abs(tO * tO))); - assert Minecraft.getInstance().player != null; - Minecraft.getInstance().player.playSound(RAND.nextBoolean() ? SoundEvents.LIGHTNING_BOLT_IMPACT : SoundEvents.LIGHTNING_BOLT_THUNDER, (opacity * (1 - Mth.abs(tO * tO))) * 0.5F, (float) (Math.random() * (1 - Mth.abs(tO)))); + TardisPlayerInfo.get(Minecraft.getInstance().player).ifPresent(tardisPlayerInfo -> { + if (!tardisPlayerInfo.isViewingTardis()) return; + if (!tardisPlayerInfo.isRenderVortex()) return; + assert Minecraft.getInstance().player != null; + Minecraft.getInstance().player.playSound(RAND.nextBoolean() ? SoundEvents.LIGHTNING_BOLT_IMPACT : SoundEvents.LIGHTNING_BOLT_THUNDER, (opacity * (1 - Mth.abs(tO * tO))) * 0.5F, (float) (Math.random() * (1 - Mth.abs(tO)))); + }); + rndUV(); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java b/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java index 4eb88f7be..07218f295 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java +++ b/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java @@ -143,7 +143,7 @@ public void render(GuiGraphics guiGraphics, int i, int j, float f) { RenderSystem.setProjectionMatrix(perspective, VertexSorting.DISTANCE_TO_ORIGIN); poseStack.pushPose(); poseStack.mulPose(Axis.YP.rotationDegrees(20)); - VortexOverlay.VORTEX.time.speed = 0.75; + VortexOverlay.VORTEX.time.speed = 0.3; VortexOverlay.VORTEX.renderVortex(guiGraphics, 1, false); RenderSystem.restoreProjectionMatrix(); poseStack.popPose(); @@ -167,6 +167,7 @@ public void render(GuiGraphics guiGraphics, int i, int j, float f) { int l = leftPos + 3, t = topPos + 3, b = height - t, r = width - l; int l1 = leftPos + imageWidth / 4, l2 = leftPos + imageWidth / 2; + guiGraphics.fill(l, t, r, b, 0x40000000); guiGraphics.fill(l2, t, r, b, -1072689136); poseStack.mulPose(Axis.ZP.rotationDegrees(-90));