Skip to content

Commit

Permalink
add lavalink youtube-source
Browse files Browse the repository at this point in the history
  • Loading branch information
MORIMORI0317 committed May 19, 2024
1 parent 2c2b8d1 commit 5379c45
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ allprojects {
maven {
url "https://cursemaven.com"
}
maven {
url "https://maven.lavalink.dev/releases"
}
}

tasks.withType(JavaCompile) {
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,6 +24,7 @@ protected YoutubeMusicMedia(String name) {

@Override
public void registerSourceManager(AudioPlayerManager audioPlayerManager) {
// FIXME 開発環境でForgeが起動できない
audioPlayerManager.registerSourceManager(new YoutubeAudioSourceManager());
}

Expand Down
4 changes: 3 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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 {
Expand Down
11 changes: 7 additions & 4 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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")) {
Expand Down Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ 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
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
Expand Down

0 comments on commit 5379c45

Please # to comment.