Fixed bug when loading chunks that contain jukeboxes.
This commit is contained in:
Navoei
2024-06-12 15:23:14 -05:00
parent 930c82263d
commit 7796e8d0d6
2 changed files with 3 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ public class HopperManager implements Listener {
Component songNameComponent = Objects.requireNonNull(event.getItem().getItemMeta().lore()).get(0).asComponent();
String songName = PlainTextComponentSerializer.plainText().serialize(songNameComponent);
String content = Lang.NOW_PLAYING.toString().replace("%song_name%", songName);
TextComponent customActionBarSongPlaying = Component.text()
.content(content)
.color(NamedTextColor.GOLD)
@@ -96,6 +96,7 @@ public class HopperManager implements Listener {
public void onChunkLoad(ChunkLoadEvent event) {
for (BlockState blockState : event.getChunk().getTileEntities()) {
if (blockState instanceof Jukebox jukebox) {
if (!jukebox.hasRecord()) return;
if (!PlayerManager.instance().isAudioPlayerPlaying(blockState.getLocation()) && isCustomMusicDisc(jukebox.getRecord())) {
discToHopper(blockState.getBlock());
}

View File

@@ -28,7 +28,7 @@ public class VoicePlugin implements VoicechatPlugin {
*/
@Override
public String getPluginId() {
return CustomDiscs.PLUGIN_ID;
return null;
}
/**