Added deployment

This commit is contained in:
SBDeveloper 2022-11-01 20:30:57 +01:00
parent a88525269e
commit 65ef411116
3 changed files with 50 additions and 6 deletions

36
pom.xml
View file

@ -6,7 +6,7 @@
<groupId>me.mctp</groupId>
<artifactId>MCTPAudio</artifactId>
<version>1.5</version>
<version>1.5-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MCTPAudio</name>
@ -24,6 +24,13 @@
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>https://repo.sbdevelopment.tech/repository/mcthemeparks-private-snapshot/</url>
</snapshotRepository>
</distributionManagement>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
@ -65,6 +72,33 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus-snapshots</serverId>
<nexusUrl>https://repo.sbdevelopment.tech/</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
<resources>
<resource>

View file

@ -84,10 +84,12 @@ public class Playlist {
if (faultCounter > 4) {
MCTPAudio.getPlugin(MCTPAudio.class).getLogger().severe("Detected to many IO errors! Stopping the radio...");
stop(); //FALLBACK! 4 errors occured.
return;
}
if (playList.isEmpty()) {
start();
return;
}
//Get song
@ -97,7 +99,7 @@ public class Playlist {
//Remove from PlayList
try {
playList.remove(nextURL);
} catch (ArrayIndexOutOfBoundsException ignored) { }
} catch (ArrayIndexOutOfBoundsException ignored) {}
//Get ticks of song
int ticks;
@ -109,7 +111,6 @@ public class Playlist {
embed.setColor(Color.RED);
embed.setDescription("A song in the radio does not have MPEG headers. A song without headers cannot be played in the radio because the length cannot be determined. Please fix as soon as possible.\n\nClick on the title to go to the song.");
embed.setUrl(nextURL);
try {
MainUtil.sendMessageDiscord(embed);
} catch (IOException e) {
@ -123,8 +124,17 @@ public class Playlist {
return;
}
if (ticks == 0) {
Bukkit.getLogger().info("0 ticks");
if (ticks <= 0) {
WebhookMessage.EmbedObject embed = new WebhookMessage.EmbedObject();
embed.setTitle("Radio song failure!");
embed.setColor(Color.RED);
embed.setDescription("A song in the radio does not have MPEG headers. A song without headers cannot be played in the radio because the length cannot be determined. Please fix as soon as possible.\n\nClick on the title to go to the song.");
embed.setUrl(nextURL);
try {
MainUtil.sendMessageDiscord(embed);
} catch (IOException e) {
e.printStackTrace();
}
nextSong();
return;
}

View file

@ -1,7 +1,7 @@
name: MCTPAudio
version: ${project.version}
main: nl.sbdeveloper.mctpaudio.MCTPAudio
api-version: 1.17
api-version: 1.19
depend: [ WorldGuard, Train_Carts ]
authors: [ SBDeveloper ]
description: The audio plugin of MCThemeParks!