diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java index 8587c88..9e59da8 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java @@ -359,7 +359,7 @@ public class CommandProcessor { Song currentSong = SongHandler.getInstance().currentSong; long currentTime = Math.min(currentSong.time, currentSong.length); long totalTime = currentSong.length; - SongPlayer.addChatMessage(String.format("§6Currently playing %s §3(%s/%s)", Util.formatTime(currentTime), Util.formatTime(totalTime))); + SongPlayer.addChatMessage(String.format("§6Currently playing %s §3(%s/%s)", currentSong.name, Util.formatTime(currentTime), Util.formatTime(totalTime))); return true; } else { diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java b/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java index efd0b40..c344fbe 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java @@ -3,13 +3,11 @@ package com.github.hhhzzzsss.songplayer; import com.github.hhhzzzsss.songplayer.playing.SongHandler; import com.github.hhhzzzsss.songplayer.playing.Stage; import com.mojang.authlib.GameProfile; -import net.minecraft.client.RunArgs; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.network.OtherClientPlayerEntity; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.EntityPose; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.Uuids; import java.util.UUID; diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java b/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java index da6c24c..9864171 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java @@ -2,9 +2,7 @@ package com.github.hhhzzzsss.songplayer; import net.fabricmc.api.ModInitializer; import net.minecraft.block.Block; -import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.enums.Instrument; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.Entity; import net.minecraft.text.Text; @@ -12,8 +10,6 @@ import net.minecraft.text.Text; import java.nio.file.Files; import java.nio.file.Path; -import static net.minecraft.block.NoteBlock.*; - public class SongPlayer implements ModInitializer { public static final MinecraftClient MC = MinecraftClient.getInstance(); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/NBSConverter.java b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/NBSConverter.java index a7cf703..dad97c8 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/NBSConverter.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/NBSConverter.java @@ -171,7 +171,7 @@ public class NBSConverter { if (length > maxSize) { throw new IOException("String is too large"); } - byte arr[] = new byte[length]; + byte[] arr = new byte[length]; buffer.get(arr, 0, length); return new String(arr); } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java index 3c69ad8..7a3fd7d 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java @@ -96,7 +96,7 @@ public class SPConverter { if (length > maxSize) { throw new IOException("String is too large"); } - byte arr[] = new byte[length]; + byte[] arr = new byte[length]; buffer.get(arr, 0, length); System.out.println(new String(arr, StandardCharsets.UTF_8)); return new String(arr, StandardCharsets.UTF_8); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/item/SongItemConfirmationScreen.java b/src/main/java/com/github/hhhzzzsss/songplayer/item/SongItemConfirmationScreen.java index 82c250e..0d9a2c4 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/item/SongItemConfirmationScreen.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/item/SongItemConfirmationScreen.java @@ -69,7 +69,7 @@ public class SongItemConfirmationScreen extends Screen { String.format("§7Max notes per second: %s%d", getNumberColor(loaderThread.maxNotesPerSecond), loaderThread.maxNotesPerSecond), String.format("§7Avg notes per second: %s%.2f", getNumberColor(loaderThread.avgNotesPerSecond), loaderThread.avgNotesPerSecond), }; - List messageList = Arrays.stream(loadedMessages).map(Text::literal).collect(Collectors.toList());; + List messageList = Arrays.stream(loadedMessages).map(Text::literal).collect(Collectors.toList()); this.loadedText = MultilineText.createFromTexts(this.textRenderer, messageList); int loadedTextHeight = this.loadedText.count() * this.textRenderer.fontHeight; diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java index aef1709..c20611e 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java @@ -10,7 +10,6 @@ import net.minecraft.entity.EntityPose; import net.minecraft.network.ClientConnection; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; -import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerAbilitiesS2CPacket; diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java index 41e9b5a..2131d32 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java @@ -7,7 +7,6 @@ import com.github.hhhzzzsss.songplayer.Util; import com.github.hhhzzzsss.songplayer.mixin.ClientPlayerInteractionManagerAccessor; import com.github.hhhzzzsss.songplayer.song.*; import net.minecraft.block.Block; -import net.minecraft.client.RunArgs; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; @@ -141,7 +140,7 @@ public class SongHandler { else { try { loaderThread = new SongLoaderThread(location); - SongPlayer.addChatMessage("§6Loading §3" + location + ""); + SongPlayer.addChatMessage("§6Loading §3" + location); loaderThread.start(); } catch (IOException e) { SongPlayer.addChatMessage("§cFailed to load song: §4" + e.getMessage()); @@ -489,8 +488,6 @@ public class SongHandler { private void getAndSaveBuildSlot() { buildSlot = SongPlayer.MC.player.getInventory().getSwappableHotbarSlot(); prevHeldItem = SongPlayer.MC.player.getInventory().getStack(buildSlot); - System.out.println(buildSlot); - System.out.println(prevHeldItem.toString()); } private void restoreBuildSlot() { SongPlayer.MC.player.getInventory().setStack(buildSlot, prevHeldItem); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java b/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java index 42c5faf..52f12dd 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java @@ -16,7 +16,7 @@ import java.util.stream.Collectors; public class Stage { private final ClientPlayerEntity player = SongPlayer.MC.player; - public static enum StageType { + public enum StageType { DEFAULT, WIDE, SPHERICAL, diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/song/DownloadUtils.java b/src/main/java/com/github/hhhzzzsss/songplayer/song/DownloadUtils.java index 9880782..6bc366a 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/song/DownloadUtils.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/song/DownloadUtils.java @@ -41,7 +41,7 @@ public class DownloadUtils { ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); try { - byte buf[] = new byte[1024]; + byte[] buf = new byte[1024]; int n; int tot = 0; while ((n = downloadStream.read(buf)) > 0) {