diff --git a/CHANGELOG.md b/CHANGELOG.md index d893743a..353b6d12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ Changelog to track updates for this mod. ### Removed ### Fixed - +- Fixed the problem that YouTube cannot be played ### Security ## [3.22.0-alpha.4] - 2024-03-13 diff --git a/build.gradle b/build.gradle index c3dc208c..0dc3e982 100644 --- a/build.gradle +++ b/build.gradle @@ -56,6 +56,9 @@ allprojects { maven { url "https://cursemaven.com" } + maven { + url "https://maven.lavalink.dev/releases" + } } tasks.withType(JavaCompile) { diff --git a/common/build.gradle b/common/build.gradle index 1ab1c7eb..465ecd99 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -22,7 +22,7 @@ dependencies { implementation("dev.arbjerg:lavaplayer:${rootProject.lava_version}") { exclude group: 'dev.arbjerg', module: 'lavaplayer-natives' } - + implementation("dev.lavalink.youtube:v2:${rootProject.lava_version_youtube}") implementation 'com.github.sealedtx:java-youtube-downloader:3.1.0' implementation 'com.mpatric:mp3agic:0.9.1' diff --git a/common/src/main/java/dev/felnull/imp/client/gui/screen/monitor/boombox/RadioSelectBMonitor.java b/common/src/main/java/dev/felnull/imp/client/gui/screen/monitor/boombox/RadioSelectBMonitor.java index b6865750..eb103c7d 100644 --- a/common/src/main/java/dev/felnull/imp/client/gui/screen/monitor/boombox/RadioSelectBMonitor.java +++ b/common/src/main/java/dev/felnull/imp/client/gui/screen/monitor/boombox/RadioSelectBMonitor.java @@ -1,7 +1,6 @@ package dev.felnull.imp.client.gui.screen.monitor.boombox; import com.mojang.blaze3d.vertex.PoseStack; -import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; import dev.felnull.imp.IamMusicPlayer; import dev.felnull.imp.block.BoomboxData; import dev.felnull.imp.client.gui.IIMPSmartRender; @@ -14,6 +13,7 @@ import dev.felnull.otyacraftengine.client.util.OEClientUtils; import dev.felnull.otyacraftengine.client.util.OERenderUtils; import dev.felnull.otyacraftengine.util.FlagThread; +import dev.lavalink.youtube.YoutubeAudioSourceManager; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.EditBox; import net.minecraft.client.renderer.MultiBufferSource; diff --git a/common/src/main/java/dev/felnull/imp/client/music/media/YoutubeMusicMedia.java b/common/src/main/java/dev/felnull/imp/client/music/media/YoutubeMusicMedia.java index 7fa5f95a..2991b719 100644 --- a/common/src/main/java/dev/felnull/imp/client/music/media/YoutubeMusicMedia.java +++ b/common/src/main/java/dev/felnull/imp/client/music/media/YoutubeMusicMedia.java @@ -2,11 +2,14 @@ import com.google.common.collect.ImmutableList; import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; -import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import dev.felnull.imp.client.lava.LavaPlayerManager; import dev.felnull.imp.music.resource.ImageInfo; +import dev.lavalink.youtube.YoutubeAudioSourceManager; +import dev.lavalink.youtube.clients.Music; +import dev.lavalink.youtube.clients.skeleton.Client; import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.vehicle.Minecart; import java.util.ArrayList; import java.util.List; @@ -21,6 +24,7 @@ protected YoutubeMusicMedia(String name) { @Override public void registerSourceManager(AudioPlayerManager audioPlayerManager) { + // FIXME 開発環境でForgeが起動できない audioPlayerManager.registerSourceManager(new YoutubeAudioSourceManager()); } diff --git a/fabric/build.gradle b/fabric/build.gradle index fafc9a08..a1ecf4ec 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -78,6 +78,7 @@ dependencies { shadowIn("dev.arbjerg:lavaplayer:${rootProject.lava_version}") { exclude group: 'dev.arbjerg', module: 'lavaplayer-natives' } + shadowIn("dev.lavalink.youtube:v2:${rootProject.lava_version_youtube}") shadowIn 'com.github.sealedtx:java-youtube-downloader:3.2.3' shadowIn "dev.felnull:felnull-java-library:${rootProject.felnull_version}" @@ -125,8 +126,9 @@ shadowJar { relocate 'ibxm', 'dev.felnull.imp.include.ibxm' relocate 'net.sourceforge.jaad', 'dev.felnull.imp.include.net.sourceforge.jaad' - relocate 'org.mozilla.javascript', 'dev.felnull.imp.include.org.mozilla.javascript' + // relocate 'org.mozilla.javascript', 'dev.felnull.imp.include.org.mozilla.javascript' relocate 'org.mozilla.classfile', 'dev.felnull.imp.include.org.mozilla.classfile' + relocate 'dev.lavalink.youtube', 'dev.felnull.imp.include.dev.lavalink.youtube' } shadowJar { diff --git a/forge/build.gradle b/forge/build.gradle index a1b22b7a..3810275a 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -61,13 +61,15 @@ dependencies { /*shadowIn("com.github.walkyst:lavaplayer-fork:${rootProject.lava_version}") { exclude group: 'com.github.walkyst', module: 'lavaplayer-natives-fork' }*/ - shadowIn("dev.arbjerg:lavaplayer:${rootProject.lava_version}"){ + shadowIn("dev.arbjerg:lavaplayer:${rootProject.lava_version}") { exclude group: 'dev.arbjerg', module: 'lavaplayer-natives' } shadowIn 'com.github.sealedtx:java-youtube-downloader:3.1.0' shadowIn "dev.felnull:felnull-java-library:${rootProject.felnull_version}" shadowIn 'com.mpatric:mp3agic:0.9.1' + + shadowIn("dev.lavalink.youtube:v2:${rootProject.lava_version_youtube}") } processResources { @@ -111,8 +113,9 @@ shadowJar { relocate 'ibxm', 'dev.felnull.imp.include.ibxm' relocate 'net.sourceforge.jaad', 'dev.felnull.imp.include.net.sourceforge.jaad' - relocate 'org.mozilla.javascript', 'dev.felnull.imp.include.org.mozilla.javascript' + // relocate 'org.mozilla.javascript', 'dev.felnull.imp.include.org.mozilla.javascript' relocate 'org.mozilla.classfile', 'dev.felnull.imp.include.org.mozilla.classfile' + relocate 'dev.lavalink.youtube', 'dev.felnull.imp.include.dev.lavalink.youtube' } shadowJar { @@ -208,7 +211,7 @@ curseforge { requiredDependency "cloth-config" requiredDependency "architectury-api" requiredDependency "otyacraft-engine" - // optionalDependency "patchouli" + // optionalDependency "patchouli" } mainArtifact(file("${project.buildDir}/libs/${rootProject.archives_base_name}-${project.name}-mc${rootProject.minecraft_version}-${project.mod_version}.jar")) { @@ -236,7 +239,7 @@ if (System.getenv('modrinthapikey') != null && "${modrinth_id}" != '') { required.project("9s6osm5g")//Cloth Config API required.project("lhGA9TYQ")//Architectury API required.project("iu3upNjC")//Otyacraft Engine - // optional.project("nU0bVIaL")//Patchouli + // optional.project("nU0bVIaL")//Patchouli } changelog = file('../LATEST_CHANGELOG.md').text } diff --git a/gradle.properties b/gradle.properties index 426725f8..6f141464 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ enabled_platforms=fabric,forge # Mod archives_base_name=iammusicplayer mod_display_name=IamMusicPlayer -mod_version=3.22.0-alpha.4 +mod_version=3.22.0-alpha.5 # Dependencies architectury_version=9.0.8 fabric_loader_version=0.14.21 @@ -15,7 +15,8 @@ fabric_api_version=0.83.0+1.20 forge_version=1.20-46.0.13 felnull_version=1.75 oe_version=3.7.0-alpha.2 -lava_version=2.1.1 +lava_version=2.1.2 +lava_version_youtube=1.3.0 cloth_config_version=11.1.118 modmenu_version=7.0.1 rei_version=12.0.625