From 69ce418e29e22391f60cdd55815727762a78c33a Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Fri, 24 May 2024 19:04:17 +0100 Subject: Apply updated GT5u spotless configs --- .../plugin/fixes/vanilla/music/MusicTocker.java | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/main/java/gtPlusPlus/plugin/fixes/vanilla/music') diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java index ed1d9890d7..c669f93f62 100644 --- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java +++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java @@ -48,13 +48,15 @@ public class MusicTocker extends MusicTicker implements Runnable { try { Object m = f.get(mMinecraft); if (m != null) { - if (m instanceof MusicTocker || m.getClass().isAssignableFrom(getClass())) { + if (m instanceof MusicTocker || m.getClass() + .isAssignableFrom(getClass())) { mPlugin.log("[BGM] Success."); return true; - } else if (m instanceof MusicTicker || m.getClass().isAssignableFrom(MusicTicker.class)) { - mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker."); - return true; - } + } else if (m instanceof MusicTicker || m.getClass() + .isAssignableFrom(MusicTicker.class)) { + mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker."); + return true; + } } } catch (IllegalArgumentException | IllegalAccessException e) {} @@ -88,25 +90,29 @@ public class MusicTocker extends MusicTicker implements Runnable { MusicType musictype = this.mMinecraft.func_147109_W(); if (this.mSound != null) { - if (!musictype.getMusicTickerLocation().equals(this.mSound.getPositionedSoundLocation())) { - this.mMinecraft.getSoundHandler().stopSound(this.mSound); + if (!musictype.getMusicTickerLocation() + .equals(this.mSound.getPositionedSoundLocation())) { + this.mMinecraft.getSoundHandler() + .stopSound(this.mSound); this.mTimeUntilNextTrack = MathHelper.getRandomIntegerInRange(this.mRandom, 0, getDelay() / 2); updateInternalNumber(); Logger.INFO("[BGM] Adjusted BGM delay 1"); } - if (!this.mMinecraft.getSoundHandler().isSoundPlaying(this.mSound)) { + if (!this.mMinecraft.getSoundHandler() + .isSoundPlaying(this.mSound)) { this.mSound = null; updateInternalSound(null); this.mTimeUntilNextTrack = Math.min( - MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2), - this.mTimeUntilNextTrack); + MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2), + this.mTimeUntilNextTrack); updateInternalNumber(); Logger.INFO("[BGM] Adjusted BGM delay 2"); } } else if (this.mSound == null && this.mTimeUntilNextTrack-- <= 0) { this.mSound = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation()); updateInternalSound(mSound); - this.mMinecraft.getSoundHandler().playSound(this.mSound); + this.mMinecraft.getSoundHandler() + .playSound(this.mSound); this.mTimeUntilNextTrack = getDelay(); updateInternalNumber(); Logger.INFO("[BGM] Adjusted BGM 3"); -- cgit