mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-21 18:32:11 +00:00
2.16.1
This commit is contained in:
1 parent
4cc8fa886a
commit
c86abfd71f
32 files changed
+832
-187
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
||||
id 'maven-publish'
|
||||
id 'com.github.johnrengelman.shadow' version '6.1.0'
|
||||
}
|
||||
version = "2.15.2"
|
||||
version = "2.16.1"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -26,7 +26,8 @@ import java.util.Map;
|
||||
|
||||
public class AllMusic {
|
||||
public static final String channel = "allmusic:channel";
|
||||
public static final String version = "2.15.2";
|
||||
public static final String channelBC = "allmusic:channelbc";
|
||||
public static final String version = "2.16.1";
|
||||
|
||||
private static final Map<String, SearchPage> searchSave = new HashMap<>();
|
||||
private static final List<String> votePlayer = new ArrayList<>();
|
||||
@@ -188,21 +189,21 @@ public class AllMusic {
|
||||
private static void loadConfig() {
|
||||
try {
|
||||
InputStreamReader reader = new InputStreamReader(
|
||||
new FileInputStream(configFile), StandardCharsets.UTF_8);
|
||||
Files.newInputStream(configFile.toPath()), StandardCharsets.UTF_8);
|
||||
BufferedReader bf = new BufferedReader(reader);
|
||||
config = new Gson().fromJson(bf, ConfigOBJ.class);
|
||||
bf.close();
|
||||
reader.close();
|
||||
configCheck();
|
||||
|
||||
reader = new InputStreamReader(new FileInputStream(AllMusic.messageFile), StandardCharsets.UTF_8);
|
||||
reader = new InputStreamReader(Files.newInputStream(AllMusic.messageFile.toPath()), StandardCharsets.UTF_8);
|
||||
bf = new BufferedReader(reader);
|
||||
message = new Gson().fromJson(bf, MessageOBJ.class);
|
||||
bf.close();
|
||||
reader.close();
|
||||
messageCheck();
|
||||
|
||||
reader = new InputStreamReader(new FileInputStream(AllMusic.cookieFile), StandardCharsets.UTF_8);
|
||||
reader = new InputStreamReader(Files.newInputStream(AllMusic.cookieFile.toPath()), StandardCharsets.UTF_8);
|
||||
bf = new BufferedReader(reader);
|
||||
cookie = new Gson().fromJson(bf, CookieObj.class);
|
||||
bf.close();
|
||||
|
||||
@@ -18,6 +18,7 @@ public class AllMusicBC extends Plugin {
|
||||
|
||||
if (!AllMusic.isRun)
|
||||
return;
|
||||
ProxyServer.getInstance().registerChannel(AllMusic.channelBC);
|
||||
ProxyServer.getInstance().getPluginManager().registerCommand(this, new CommandBC());
|
||||
ProxyServer.getInstance().getPluginManager().registerListener(this, new EventBC());
|
||||
new MetricsBC(this, 6720);
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package coloryr.allmusic;
|
||||
|
||||
import coloryr.allmusic.music.api.SongInfo;
|
||||
import coloryr.allmusic.music.api.TopSongInfo;
|
||||
import coloryr.allmusic.music.lyric.TopLyricItem;
|
||||
import coloryr.allmusic.music.play.PlayMusic;
|
||||
import coloryr.allmusic.side.bukkit.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -9,6 +14,7 @@ public class AllMusicBukkit extends JavaPlugin {
|
||||
public static Plugin plugin;
|
||||
public static AllMusicPAPI PAPI;
|
||||
public static boolean spigotSet;
|
||||
private static PluginMessage pluginMessage;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@@ -58,18 +64,33 @@ public class AllMusicBukkit extends JavaPlugin {
|
||||
AllMusic.log.info("§2Vault未挂钩");
|
||||
AllMusic.vault = null;
|
||||
}
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, AllMusic.channel);
|
||||
Bukkit.getPluginCommand("music").setExecutor(new CommandBukkit());
|
||||
Bukkit.getPluginCommand("music").setTabCompleter(new CommandBukkit());
|
||||
Bukkit.getPluginManager().registerEvents(new EventBukkit(), this);
|
||||
new MetricsBukkit(this, 6720);
|
||||
|
||||
AllMusic.start();
|
||||
if (AllMusic.getConfig().isTopPAPI()) {
|
||||
PlayMusic.nowPlayMusic = new TopSongInfo();
|
||||
PlayMusic.lyricItem = new TopLyricItem();
|
||||
pluginMessage = new PluginMessage();
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, AllMusic.channelBC);
|
||||
getServer().getMessenger().registerIncomingPluginChannel(this, AllMusic.channelBC, pluginMessage);
|
||||
AllMusic.log.info("§2设置为顶层模式");
|
||||
} else {
|
||||
CommandBukkit command = new CommandBukkit();
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, AllMusic.channel);
|
||||
PluginCommand command1 = Bukkit.getPluginCommand("music");
|
||||
command1.setExecutor(command);
|
||||
command1.setTabCompleter(command);
|
||||
Bukkit.getPluginManager().registerEvents(new EventBukkit(), this);
|
||||
AllMusic.start();
|
||||
}
|
||||
|
||||
new MetricsBukkit(this, 6720);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
AllMusic.isRun = false;
|
||||
AllMusic.stop();
|
||||
if (AllMusic.getConfig().isTopPAPI())
|
||||
pluginMessage.stop();
|
||||
else
|
||||
AllMusic.stop();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.velocitypowered.api.plugin.Plugin;
|
||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.nio.file.Path;
|
||||
@@ -22,7 +23,8 @@ public class AllMusicVelocity {
|
||||
public final Path dataDirectory;
|
||||
private final Logger logger;
|
||||
private final MetricsVelocity.Factory metricsFactory;
|
||||
public ChannelIdentifier channel;
|
||||
public static ChannelIdentifier channel;
|
||||
public static ChannelIdentifier channelBC;
|
||||
|
||||
@Inject
|
||||
public AllMusicVelocity(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory, MetricsVelocity.Factory metricsFactory) {
|
||||
@@ -43,8 +45,9 @@ public class AllMusicVelocity {
|
||||
.aliases("allmusic")
|
||||
.build();
|
||||
channel = () -> AllMusic.channel;
|
||||
channelBC = MinecraftChannelIdentifier.from(AllMusic.channelBC);
|
||||
AllMusic.side = new SideVelocity();
|
||||
// server.getChannelRegistrar().register(channel);
|
||||
server.getChannelRegistrar().register(channelBC);
|
||||
server.getCommandManager().register(meta, new CommandVelocity());
|
||||
server.getEventManager().register(this, new EventVelocity());
|
||||
metricsFactory.make(this, 6720);
|
||||
|
||||
@@ -34,6 +34,11 @@ public class ConfigOBJ {
|
||||
private String LoginUser;
|
||||
private String MusicBR;
|
||||
|
||||
private boolean TopPAPI;
|
||||
|
||||
private boolean MessageLimit;
|
||||
private int MessageLimitSize;
|
||||
|
||||
public ConfigOBJ() {
|
||||
MaxList = 10;
|
||||
MinVote = 3;
|
||||
@@ -60,9 +65,25 @@ public class ConfigOBJ {
|
||||
|
||||
MusicBR = "320000";
|
||||
|
||||
TopPAPI = false;
|
||||
MessageLimit = false;
|
||||
MessageLimitSize = 40;
|
||||
|
||||
Version = AllMusic.version;
|
||||
}
|
||||
|
||||
public int getMessageLimitSize() {
|
||||
return MessageLimitSize;
|
||||
}
|
||||
|
||||
public boolean isMessageLimit() {
|
||||
return MessageLimit;
|
||||
}
|
||||
|
||||
public boolean isTopPAPI() {
|
||||
return TopPAPI;
|
||||
}
|
||||
|
||||
public String getMusicBR() {
|
||||
return MusicBR;
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ public interface ISide {
|
||||
|
||||
void clearHudAll();
|
||||
|
||||
void sendMessaget(Object obj, String Message);
|
||||
void sendMessaget(Object obj, String message);
|
||||
|
||||
void sendMessage(Object obj, String Message);
|
||||
void sendMessage(Object obj, String message);
|
||||
|
||||
void sendMessageRun(Object obj, String Message, String end, String command);
|
||||
void sendMessageRun(Object obj, String message, String end, String command);
|
||||
|
||||
void sendMessageSuggest(Object obj, String Message, String end, String command);
|
||||
void sendMessageSuggest(Object obj, String message, String end, String command);
|
||||
|
||||
void runTask(Runnable run);
|
||||
|
||||
@@ -40,4 +40,10 @@ public interface ISide {
|
||||
boolean checkPermission(String player, String permission);
|
||||
|
||||
void task(Runnable run, int delay);
|
||||
|
||||
void updateInfo();
|
||||
|
||||
void updateLyric();
|
||||
|
||||
void ping();
|
||||
}
|
||||
@@ -120,6 +120,8 @@ public class CommandEX {
|
||||
AllMusic.getMessage().getClick().Check, "/music hud enable ");
|
||||
AllMusic.side.sendMessageSuggest(sender, AllMusic.getMessage().getHelp().getNormal().getHud2(),
|
||||
AllMusic.getMessage().getClick().Check, "/music hud ");
|
||||
AllMusic.side.sendMessageSuggest(sender, AllMusic.getMessage().getHelp().getNormal().getHud3(),
|
||||
AllMusic.getMessage().getClick().Check, "/music hud picsize ");
|
||||
if (AllMusic.getConfig().getAdmin().contains(name)) {
|
||||
AllMusic.side.sendMessageRun(sender, AllMusic.getMessage().getHelp().getAdmin().getReload(),
|
||||
AllMusic.getMessage().getClick().This, "/music reload");
|
||||
@@ -167,7 +169,7 @@ public class CommandEX {
|
||||
}
|
||||
return;
|
||||
} else if (args[0].equalsIgnoreCase("vote")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "AllMusic.vote")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "allmusic.vote")) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getVote().getNoPermission());
|
||||
return;
|
||||
}
|
||||
@@ -200,7 +202,7 @@ public class CommandEX {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getMusicPlay().getNoPlayMusic());
|
||||
return;
|
||||
} else if (args[0].equalsIgnoreCase("search") && args.length >= 2) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "AllMusic.search")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "allmusic.search")) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getSearch().getNoPer());
|
||||
return;
|
||||
}
|
||||
@@ -217,7 +219,7 @@ public class CommandEX {
|
||||
searchMusic(sender, name, args, false);
|
||||
return;
|
||||
} else if (args[0].equalsIgnoreCase("select") && args.length == 2) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "AllMusic.search")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "allmusic.search")) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getSearch().getNoPer());
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +242,7 @@ public class CommandEX {
|
||||
}
|
||||
return;
|
||||
} else if (args[0].equalsIgnoreCase("nextpage")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "AllMusic.search")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "allmusic.search")) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getSearch().getNoPer());
|
||||
return;
|
||||
}
|
||||
@@ -254,7 +256,7 @@ public class CommandEX {
|
||||
}
|
||||
return;
|
||||
} else if (args[0].equalsIgnoreCase("lastpage")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "AllMusic.search")) {
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "allmusic.search")) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getSearch().getNoPer());
|
||||
return;
|
||||
}
|
||||
@@ -385,7 +387,7 @@ public class CommandEX {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "AllMusic.addmusic"))
|
||||
if (AllMusic.getConfig().isNeedPermission() && AllMusic.side.checkPermission(name, "allmusic.addmusic"))
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().getCommand().getNoPer());
|
||||
else {
|
||||
switch (AllMusic.getConfig().getDefaultAddMusic()) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TabCommand {
|
||||
|
||||
public static List<String> getTabList(String name, String[] arg) {
|
||||
List<String> arguments = new ArrayList<>();
|
||||
if (arg.length == 1) {
|
||||
if (arg.length == 1 || arg.length == 0) {
|
||||
arguments.addAll(normal);
|
||||
if (AllMusic.getSearch(name) != null) {
|
||||
arguments.addAll(search);
|
||||
|
||||
@@ -5,7 +5,7 @@ import coloryr.allmusic.hud.obj.Pos;
|
||||
import coloryr.allmusic.hud.obj.PosOBJ;
|
||||
import coloryr.allmusic.hud.obj.SaveOBJ;
|
||||
import coloryr.allmusic.music.api.SongInfo;
|
||||
import coloryr.allmusic.music.lyric.ShowOBJ;
|
||||
import coloryr.allmusic.music.lyric.LyricItem;
|
||||
import coloryr.allmusic.music.play.PlayMusic;
|
||||
import coloryr.allmusic.utils.Function;
|
||||
import com.google.gson.Gson;
|
||||
@@ -100,7 +100,7 @@ public class HudUtils {
|
||||
AllMusic.side.sendHudInfo(list.toString());
|
||||
}
|
||||
|
||||
public static void sendHudLyricData(ShowOBJ showobj) {
|
||||
public static void sendHudLyricData(LyricItem showobj) {
|
||||
StringBuilder list = new StringBuilder();
|
||||
if (showobj == null) {
|
||||
list.append(AllMusic.getMessage().getHud().getNoLyric());
|
||||
|
||||
@@ -48,10 +48,16 @@ public class HelpNormalObj {
|
||||
return true;
|
||||
if(Hud2 == null)
|
||||
return true;
|
||||
if(Hud3 == null)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getHud3() {
|
||||
return Hud3;
|
||||
}
|
||||
|
||||
public String getBase() {
|
||||
return Base;
|
||||
}
|
||||
|
||||
@@ -4,21 +4,21 @@ import coloryr.allmusic.AllMusic;
|
||||
import coloryr.allmusic.music.api.obj.music.trialinfo.freeTrialInfo;
|
||||
|
||||
public class SongInfo {
|
||||
private String author;
|
||||
private String name;
|
||||
private String id;
|
||||
private String alia;
|
||||
private String call;
|
||||
private String al;
|
||||
private String playerUrl;
|
||||
private String picUrl;
|
||||
private boolean isTrial;
|
||||
private freeTrialInfo trialInfo;
|
||||
protected String author;
|
||||
protected String name;
|
||||
protected String id;
|
||||
protected String alia;
|
||||
protected String call;
|
||||
protected String al;
|
||||
protected String playerUrl;
|
||||
protected String picUrl;
|
||||
protected boolean isTrial;
|
||||
protected freeTrialInfo trialInfo;
|
||||
|
||||
private int length;
|
||||
protected int length;
|
||||
|
||||
private boolean isList;
|
||||
private boolean isUrl;
|
||||
protected boolean isList;
|
||||
protected boolean isUrl;
|
||||
|
||||
public SongInfo(String Name, String Url, int Length) {
|
||||
this.length = Length;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package coloryr.allmusic.music.api;
|
||||
|
||||
import coloryr.allmusic.AllMusic;
|
||||
import coloryr.allmusic.music.api.obj.music.trialinfo.freeTrialInfo;
|
||||
|
||||
public class TopSongInfo extends SongInfo {
|
||||
public TopSongInfo() {
|
||||
super(null, null, 0);
|
||||
}
|
||||
|
||||
public void setAl(String al) {
|
||||
this.al = al;
|
||||
}
|
||||
|
||||
public void setAlia(String alia) {
|
||||
this.alia = alia;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public void setCall(String call) {
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setLength(int length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public void setList(boolean list) {
|
||||
isList = list;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setPicUrl(String picUrl) {
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
public void setPlayerUrl(String playerUrl) {
|
||||
this.playerUrl = playerUrl;
|
||||
}
|
||||
|
||||
public void setTrial(boolean trial) {
|
||||
isTrial = trial;
|
||||
}
|
||||
|
||||
public void setTrialInfo(freeTrialInfo trialInfo) {
|
||||
this.trialInfo = trialInfo;
|
||||
}
|
||||
|
||||
public void setUrl(boolean url) {
|
||||
isUrl = url;
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ import java.util.*;
|
||||
|
||||
public class LyricDo {
|
||||
|
||||
private final Map<Integer, ShowOBJ> temp = new HashMap<>();
|
||||
private final Map<Integer, LyricItem> temp = new HashMap<>();
|
||||
public boolean isHave = false;
|
||||
|
||||
public Map<Integer, ShowOBJ> getTemp() {
|
||||
public Map<Integer, LyricItem> getTemp() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ public class LyricDo {
|
||||
if (haveT) {
|
||||
Map<Integer, String> temp1 = getTime(Tlyric);
|
||||
for (Map.Entry<Integer, String> item : temp.entrySet()) {
|
||||
this.temp.put(item.getKey(), new ShowOBJ(haveT,
|
||||
this.temp.put(item.getKey(), new LyricItem(haveT,
|
||||
item.getValue(), temp1.get(item.getKey())));
|
||||
}
|
||||
} else {
|
||||
for (Map.Entry<Integer, String> item : temp.entrySet()) {
|
||||
this.temp.put(item.getKey(), new ShowOBJ(haveT,
|
||||
this.temp.put(item.getKey(), new LyricItem(haveT,
|
||||
item.getValue(), null));
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -2,12 +2,12 @@ package coloryr.allmusic.music.lyric;
|
||||
|
||||
import coloryr.allmusic.AllMusic;
|
||||
|
||||
public class ShowOBJ {
|
||||
private final boolean haveT;
|
||||
private final String lyric;
|
||||
private final String tlyric;
|
||||
public class LyricItem {
|
||||
protected boolean haveT;
|
||||
protected String lyric;
|
||||
protected String tlyric;
|
||||
|
||||
public ShowOBJ(boolean haveT, String lyric, String tlyric) {
|
||||
public LyricItem(boolean haveT, String lyric, String tlyric) {
|
||||
this.haveT = haveT;
|
||||
this.lyric = lyric;
|
||||
this.tlyric = tlyric;
|
||||
@@ -4,7 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LyricSave {
|
||||
private Map<Integer, ShowOBJ> lyric;
|
||||
private Map<Integer, LyricItem> lyric;
|
||||
private boolean haveLyric;
|
||||
|
||||
public LyricSave() {
|
||||
@@ -12,7 +12,7 @@ public class LyricSave {
|
||||
lyric = new HashMap<>();
|
||||
}
|
||||
|
||||
public void setLyric(Map<Integer, ShowOBJ> lyric) {
|
||||
public void setLyric(Map<Integer, LyricItem> lyric) {
|
||||
this.lyric = lyric;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class LyricSave {
|
||||
this.haveLyric = haveLyric;
|
||||
}
|
||||
|
||||
public ShowOBJ checkTime(int playNow) {
|
||||
public LyricItem checkTime(int playNow) {
|
||||
if (lyric == null)
|
||||
return null;
|
||||
if (lyric.containsKey(playNow))
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package coloryr.allmusic.music.lyric;
|
||||
|
||||
public class TopLyricItem extends LyricItem {
|
||||
public TopLyricItem() {
|
||||
super(false, null, null);
|
||||
}
|
||||
|
||||
public void setTlyric(String data){
|
||||
tlyric = data;
|
||||
}
|
||||
|
||||
public void setLyric(String data){
|
||||
lyric = data;
|
||||
}
|
||||
|
||||
public void setHaveT(boolean data){
|
||||
haveT = data;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package coloryr.allmusic.music.play;
|
||||
import coloryr.allmusic.AllMusic;
|
||||
import coloryr.allmusic.hud.HudUtils;
|
||||
import coloryr.allmusic.music.lyric.LyricSave;
|
||||
import coloryr.allmusic.music.lyric.ShowOBJ;
|
||||
import coloryr.allmusic.music.lyric.LyricItem;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
@@ -17,11 +17,15 @@ public class PlayGo {
|
||||
|
||||
private static ScheduledExecutorService service;
|
||||
private static ScheduledExecutorService service1;
|
||||
private static ScheduledExecutorService service2;
|
||||
|
||||
public static void start() {
|
||||
Thread taskT = new Thread(PlayGo::task, "AllMusic_Play");
|
||||
isRun = true;
|
||||
taskT.start();
|
||||
|
||||
service2 = Executors.newSingleThreadScheduledExecutor();
|
||||
service2.scheduleAtFixedRate(PlayGo::time3, 0, 10, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
public static void stop() {
|
||||
@@ -39,6 +43,10 @@ public class PlayGo {
|
||||
service1.shutdown();
|
||||
service1 = null;
|
||||
}
|
||||
if (service2 != null) {
|
||||
service2.shutdown();
|
||||
service2 = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void startTimer() {
|
||||
@@ -55,8 +63,9 @@ public class PlayGo {
|
||||
PlayMusic.musicAllTime = 0;
|
||||
PlayMusic.musicLessTime = 0;
|
||||
PlayMusic.lyric = null;
|
||||
PlayMusic.nowLyric = null;
|
||||
PlayMusic.lyricItem = null;
|
||||
PlayMusic.nowPlayMusic = null;
|
||||
AllMusic.side.updateInfo();
|
||||
closeTimer();
|
||||
HudUtils.clearHud();
|
||||
}
|
||||
@@ -71,20 +80,26 @@ public class PlayGo {
|
||||
}
|
||||
|
||||
private static void time2() {
|
||||
ShowOBJ show = PlayMusic.lyric.checkTime(PlayMusic.musicNowTime);
|
||||
LyricItem show = PlayMusic.lyric.checkTime(PlayMusic.musicNowTime);
|
||||
if (show != null) {
|
||||
PlayMusic.nowLyric = show;
|
||||
PlayMusic.lyricItem = show;
|
||||
times = 0;
|
||||
HudUtils.sendHudLyricData(show);
|
||||
AllMusic.side.updateLyric();
|
||||
} else {
|
||||
times++;
|
||||
if (times == 500 && PlayMusic.nowLyric != null) {
|
||||
if (times == 500 && PlayMusic.lyricItem != null) {
|
||||
times = 0;
|
||||
HudUtils.sendHudLyricData(PlayMusic.nowLyric);
|
||||
HudUtils.sendHudLyricData(PlayMusic.lyricItem);
|
||||
AllMusic.side.updateLyric();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void time3() {
|
||||
AllMusic.side.ping();
|
||||
}
|
||||
|
||||
private static void task() {
|
||||
while (isRun) {
|
||||
try {
|
||||
@@ -142,6 +157,9 @@ public class PlayGo {
|
||||
PlayMusic.musicLessTime = PlayMusic.nowPlayMusic.getTrialInfo().getEnd();
|
||||
PlayMusic.musicNowTime = PlayMusic.nowPlayMusic.getTrialInfo().getStart();
|
||||
}
|
||||
|
||||
AllMusic.side.updateInfo();
|
||||
|
||||
while (PlayMusic.musicLessTime > 0) {
|
||||
HudUtils.sendHudNowData();
|
||||
HudUtils.sendHudListData();
|
||||
|
||||
@@ -5,7 +5,7 @@ import coloryr.allmusic.decoder.Bitstream;
|
||||
import coloryr.allmusic.decoder.Header;
|
||||
import coloryr.allmusic.music.api.SongInfo;
|
||||
import coloryr.allmusic.music.lyric.LyricSave;
|
||||
import coloryr.allmusic.music.lyric.ShowOBJ;
|
||||
import coloryr.allmusic.music.lyric.LyricItem;
|
||||
import coloryr.allmusic.utils.logs;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
@@ -27,7 +27,7 @@ public class PlayMusic {
|
||||
public static SongInfo nowPlayMusic;
|
||||
|
||||
public static LyricSave lyric;
|
||||
public static ShowOBJ nowLyric;
|
||||
public static LyricItem lyricItem;
|
||||
public static int error;
|
||||
|
||||
private static boolean isRun;
|
||||
@@ -140,6 +140,8 @@ public class PlayMusic {
|
||||
list.append(a).append("\n");
|
||||
}
|
||||
String temp = list.toString();
|
||||
if (temp.isEmpty())
|
||||
return "";
|
||||
return temp.substring(0, temp.length() - 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
package coloryr.allmusic.side.bc;
|
||||
|
||||
import coloryr.allmusic.AllMusic;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
public class EventBC implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerquit(final PlayerDisconnectEvent event) {
|
||||
@@ -16,4 +26,17 @@ public class EventBC implements Listener {
|
||||
public void onLoginEvent(PostLoginEvent event) {
|
||||
AllMusic.joinPlay(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPluginMessageEvent(PluginMessageEvent event) {
|
||||
if (event.getTag().equals(AllMusic.channelBC)) {
|
||||
event.setCancelled(true);
|
||||
if (event.getSender() instanceof Server) {
|
||||
Server server = (Server) event.getSender();
|
||||
SideBC.TopServers.add(server);
|
||||
SideBC.sendAllToServer(server);
|
||||
SideBC.sendLyricToServer(server);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@ import coloryr.allmusic.AllMusicBC;
|
||||
import coloryr.allmusic.api.ISide;
|
||||
import coloryr.allmusic.hud.HudSave;
|
||||
import coloryr.allmusic.hud.obj.SaveOBJ;
|
||||
import coloryr.allmusic.music.play.PlayMusic;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.google.gson.Gson;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
@@ -14,12 +17,17 @@ import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SideBC implements ISide {
|
||||
public static final Set<Server> TopServers = new CopyOnWriteArraySet<>();
|
||||
private boolean isOK(ProxiedPlayer player, boolean in) {
|
||||
if (player == null || player.getServer() == null)
|
||||
return false;
|
||||
@@ -144,11 +152,19 @@ public class SideBC implements ISide {
|
||||
|
||||
@Override
|
||||
public void bq(String data) {
|
||||
if (AllMusic.getConfig().isMessageLimit()
|
||||
&& data.length() > AllMusic.getConfig().getMessageLimitSize()) {
|
||||
data = data.substring(0, 30) + "...";
|
||||
}
|
||||
ProxyServer.getInstance().broadcast(new TextComponent(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bqt(String data) {
|
||||
if (AllMusic.getConfig().isMessageLimit()
|
||||
&& data.length() > AllMusic.getConfig().getMessageLimitSize()) {
|
||||
data = data.substring(0, 30) + "...";
|
||||
}
|
||||
ProxyServer.getInstance().broadcast(new TextComponent(data));
|
||||
}
|
||||
|
||||
@@ -167,29 +183,29 @@ public class SideBC implements ISide {
|
||||
|
||||
|
||||
@Override
|
||||
public void sendMessaget(Object obj, String Message) {
|
||||
public void sendMessaget(Object obj, String message) {
|
||||
CommandSender sender = (CommandSender) obj;
|
||||
sender.sendMessage(new TextComponent(Message));
|
||||
sender.sendMessage(new TextComponent(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(Object obj, String Message) {
|
||||
public void sendMessage(Object obj, String message) {
|
||||
CommandSender sender = (CommandSender) obj;
|
||||
sender.sendMessage(new TextComponent(Message));
|
||||
sender.sendMessage(new TextComponent(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageRun(Object obj, String Message, String end, String command) {
|
||||
public void sendMessageRun(Object obj, String message, String end, String command) {
|
||||
CommandSender sender = (CommandSender) obj;
|
||||
TextComponent send = new TextComponent(Message + end);
|
||||
TextComponent send = new TextComponent(message + end);
|
||||
send.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command));
|
||||
sender.sendMessage(send);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageSuggest(Object obj, String Message, String end, String command) {
|
||||
public void sendMessageSuggest(Object obj, String message, String end, String command) {
|
||||
CommandSender sender = (CommandSender) obj;
|
||||
TextComponent send = new TextComponent(Message + end);
|
||||
TextComponent send = new TextComponent(message + end);
|
||||
send.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command));
|
||||
sender.sendMessage(send);
|
||||
}
|
||||
@@ -219,6 +235,121 @@ public class SideBC implements ISide {
|
||||
ProxyServer.getInstance().getScheduler().schedule(AllMusicBC.plugin, run, delay, TimeUnit.MICROSECONDS);
|
||||
}
|
||||
|
||||
public static void sendAllToServer(Server server){
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(0);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF(AllMusic.getMessage().getPAPI().getNoMusic());
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getName());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(1);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getAl());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(2);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getAlia());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(3);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getAuthor());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(4);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getCall());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(5);
|
||||
out.writeInt(PlayMusic.getSize());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(6);
|
||||
out.writeUTF(PlayMusic.getAllList());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendLyricToServer(Server server){
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(7);
|
||||
if (PlayMusic.lyricItem == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.lyricItem.getLyric());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(8);
|
||||
if (PlayMusic.lyricItem == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.lyricItem.getTlyric());
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInfo() {
|
||||
Iterator<Server> iterator = TopServers.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Server server = iterator.next();
|
||||
if (server.isConnected()) {
|
||||
sendAllToServer(server);
|
||||
} else {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLyric() {
|
||||
Iterator<Server> iterator = TopServers.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Server server = iterator.next();
|
||||
if (server.isConnected()) {
|
||||
sendLyricToServer(server);
|
||||
} else {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendPingToServer(Server server){
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(200);
|
||||
server.sendData(AllMusic.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ping() {
|
||||
Iterator<Server> iterator = TopServers.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Server server = iterator.next();
|
||||
if (server.isConnected()) {
|
||||
sendPingToServer(server);
|
||||
} else {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void send(ProxiedPlayer players, String data, Boolean isplay) {
|
||||
if (players == null)
|
||||
return;
|
||||
|
||||
@@ -53,54 +53,93 @@ public class AllMusicPAPI extends PlaceholderExpansion {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onRequest(OfflinePlayer player, String identifier) {
|
||||
|
||||
switch (identifier) {
|
||||
case "now_music_name": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return AllMusic.getMessage().getPAPI().getNoMusic();
|
||||
return PlayMusic.nowPlayMusic.getName();
|
||||
public String onRequest(OfflinePlayer player, @NotNull String identifier) {
|
||||
if(AllMusic.getConfig().isTopPAPI()){
|
||||
if(!PluginMessage.update){
|
||||
PluginMessage.startUpdate();
|
||||
return "";
|
||||
}
|
||||
case "now_music_al": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getAl();
|
||||
switch (identifier) {
|
||||
case "now_music_name": {
|
||||
return PlayMusic.nowPlayMusic.getName();
|
||||
}
|
||||
case "now_music_al": {
|
||||
return PlayMusic.nowPlayMusic.getAl();
|
||||
}
|
||||
case "now_music_alia": {
|
||||
return PlayMusic.nowPlayMusic.getAlia();
|
||||
}
|
||||
case "now_music_author": {
|
||||
return PlayMusic.nowPlayMusic.getAuthor();
|
||||
}
|
||||
case "now_music_call": {
|
||||
return PlayMusic.nowPlayMusic.getCall();
|
||||
}
|
||||
case "now_music_info": {
|
||||
return PlayMusic.nowPlayMusic.getInfo();
|
||||
}
|
||||
case "list_size": {
|
||||
return "" + PluginMessage.size;
|
||||
}
|
||||
case "music_list": {
|
||||
return PluginMessage.allList;
|
||||
}
|
||||
case "lyric": {
|
||||
return PlayMusic.lyricItem.getLyric();
|
||||
}
|
||||
case "tlyric": {
|
||||
return PlayMusic.lyricItem.getTlyric();
|
||||
}
|
||||
}
|
||||
case "now_music_alia": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getAlia();
|
||||
}
|
||||
case "now_music_author": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getAuthor();
|
||||
}
|
||||
case "now_music_call": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getCall();
|
||||
}
|
||||
case "now_music_info": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getInfo();
|
||||
}
|
||||
case "list_size": {
|
||||
return "" + PlayMusic.getSize();
|
||||
}
|
||||
case "music_list": {
|
||||
return PlayMusic.getAllList();
|
||||
}
|
||||
case "lyric": {
|
||||
if (PlayMusic.nowLyric == null)
|
||||
return "";
|
||||
return PlayMusic.nowLyric.getLyric();
|
||||
}
|
||||
case "tlyric": {
|
||||
if (PlayMusic.nowLyric == null)
|
||||
return "";
|
||||
return PlayMusic.nowLyric.getTlyric();
|
||||
}
|
||||
else {
|
||||
switch (identifier) {
|
||||
case "now_music_name": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return AllMusic.getMessage().getPAPI().getNoMusic();
|
||||
return PlayMusic.nowPlayMusic.getName();
|
||||
}
|
||||
case "now_music_al": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getAl();
|
||||
}
|
||||
case "now_music_alia": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getAlia();
|
||||
}
|
||||
case "now_music_author": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getAuthor();
|
||||
}
|
||||
case "now_music_call": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getCall();
|
||||
}
|
||||
case "now_music_info": {
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
return "";
|
||||
return PlayMusic.nowPlayMusic.getInfo();
|
||||
}
|
||||
case "list_size": {
|
||||
return "" + PlayMusic.getSize();
|
||||
}
|
||||
case "music_list": {
|
||||
return PlayMusic.getAllList();
|
||||
}
|
||||
case "lyric": {
|
||||
if (PlayMusic.lyricItem == null)
|
||||
return "";
|
||||
return PlayMusic.lyricItem.getLyric();
|
||||
}
|
||||
case "tlyric": {
|
||||
if (PlayMusic.lyricItem == null)
|
||||
return "";
|
||||
return PlayMusic.lyricItem.getTlyric();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package coloryr.allmusic.side.bukkit;
|
||||
|
||||
import coloryr.allmusic.AllMusic;
|
||||
import coloryr.allmusic.music.api.TopSongInfo;
|
||||
import coloryr.allmusic.music.play.PlayMusic;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
|
||||
public class EventBukkit implements Listener {
|
||||
@EventHandler
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package coloryr.allmusic.side.bukkit;
|
||||
|
||||
import coloryr.allmusic.AllMusic;
|
||||
import coloryr.allmusic.AllMusicBukkit;
|
||||
import coloryr.allmusic.music.api.TopSongInfo;
|
||||
import coloryr.allmusic.music.lyric.TopLyricItem;
|
||||
import coloryr.allmusic.music.play.PlayGo;
|
||||
import coloryr.allmusic.music.play.PlayMusic;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class PluginMessage implements PluginMessageListener {
|
||||
private static ScheduledExecutorService service;
|
||||
|
||||
public static int size;
|
||||
public static String allList;
|
||||
public static boolean update = false;
|
||||
private final TopSongInfo info;
|
||||
private final TopLyricItem lyric;
|
||||
|
||||
public PluginMessage() {
|
||||
info = (TopSongInfo) PlayMusic.nowPlayMusic;
|
||||
lyric = (TopLyricItem) PlayMusic.lyricItem;
|
||||
|
||||
service = Executors.newSingleThreadScheduledExecutor();
|
||||
service.scheduleAtFixedRate(PluginMessage::clear, 0, 30, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private static void clear(){
|
||||
update = false;
|
||||
}
|
||||
|
||||
public void stop(){
|
||||
service.shutdownNow();
|
||||
}
|
||||
|
||||
public static void startUpdate() {
|
||||
Player player = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
|
||||
if (player == null)
|
||||
return;
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeUTF("allmusic");
|
||||
player.sendPluginMessage(AllMusicBukkit.plugin, AllMusic.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, @NotNull Player player, byte[] message) {
|
||||
if (!channel.equals(AllMusic.channelBC)) {
|
||||
return;
|
||||
}
|
||||
ByteArrayDataInput in = ByteStreams.newDataInput(message);
|
||||
int type = in.readInt();
|
||||
update = true;
|
||||
switch (type) {
|
||||
case 0:
|
||||
info.setName(in.readUTF());
|
||||
break;
|
||||
case 1:
|
||||
info.setAl(in.readUTF());
|
||||
break;
|
||||
case 2:
|
||||
info.setAlia(in.readUTF());
|
||||
break;
|
||||
case 3:
|
||||
info.setAuthor(in.readUTF());
|
||||
break;
|
||||
case 4:
|
||||
info.setCall(in.readUTF());
|
||||
break;
|
||||
case 5:
|
||||
size = in.readInt();
|
||||
break;
|
||||
case 6:
|
||||
allList = in.readUTF();
|
||||
break;
|
||||
case 7:
|
||||
lyric.setLyric(in.readUTF());
|
||||
break;
|
||||
case 8:
|
||||
lyric.setTlyric(in.readUTF());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,12 +101,21 @@ public class SideBukkit implements ISide {
|
||||
|
||||
@Override
|
||||
public void bq(String data) {
|
||||
if (AllMusic.getConfig().isMessageLimit()
|
||||
&& data.length() > AllMusic.getConfig().getMessageLimitSize()) {
|
||||
data = data.substring(0, 30) + "...";
|
||||
}
|
||||
Bukkit.broadcastMessage(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bqt(String data) {
|
||||
Bukkit.getScheduler().runTask(AllMusicBukkit.plugin, () -> Bukkit.broadcastMessage(data));
|
||||
if (AllMusic.getConfig().isMessageLimit()
|
||||
&& data.length() > AllMusic.getConfig().getMessageLimitSize()) {
|
||||
data = data.substring(0, 30) + "...";
|
||||
}
|
||||
String finalData = data;
|
||||
Bukkit.getScheduler().runTask(AllMusicBukkit.plugin, () -> Bukkit.broadcastMessage(finalData));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,33 +183,33 @@ public class SideBukkit implements ISide {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessaget(Object obj, String Message) {
|
||||
Bukkit.getScheduler().runTask(AllMusicBukkit.plugin, () -> ((CommandSender) obj).sendMessage(Message));
|
||||
public void sendMessaget(Object obj, String message) {
|
||||
Bukkit.getScheduler().runTask(AllMusicBukkit.plugin, () -> ((CommandSender) obj).sendMessage(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(Object obj, String Message) {
|
||||
public void sendMessage(Object obj, String message) {
|
||||
CommandSender sender = (CommandSender) obj;
|
||||
sender.sendMessage(Message);
|
||||
sender.sendMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageRun(Object obj, String Message, String end, String command) {
|
||||
public void sendMessageRun(Object obj, String message, String end, String command) {
|
||||
if (AllMusicBukkit.spigotSet) {
|
||||
SpigotApi.sendMessageRun(obj, Message + end, command);
|
||||
SpigotApi.sendMessageRun(obj, message + end, command);
|
||||
} else {
|
||||
if (!Message.isEmpty())
|
||||
sendMessage(obj, Message);
|
||||
if (!message.isEmpty())
|
||||
sendMessage(obj, message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageSuggest(Object obj, String Message, String end, String command) {
|
||||
public void sendMessageSuggest(Object obj, String message, String end, String command) {
|
||||
if (AllMusicBukkit.spigotSet) {
|
||||
SpigotApi.sendMessageSuggest(obj, Message + end, command);
|
||||
SpigotApi.sendMessageSuggest(obj, message + end, command);
|
||||
} else {
|
||||
if (!Message.isEmpty())
|
||||
sendMessage(obj, Message);
|
||||
if (!message.isEmpty())
|
||||
sendMessage(obj, message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,6 +238,21 @@ public class SideBukkit implements ISide {
|
||||
Bukkit.getScheduler().runTaskLater(AllMusicBukkit.plugin, run, delay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInfo() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLyric() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ping() {
|
||||
|
||||
}
|
||||
|
||||
private void send(Player players, String data, Boolean isplay) {
|
||||
if (players == null)
|
||||
return;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package coloryr.allmusic.side.velocity;
|
||||
|
||||
import coloryr.allmusic.command.CommandEX;
|
||||
import coloryr.allmusic.command.TabCommand;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.command.SimpleCommand;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CommandVelocity implements SimpleCommand {
|
||||
@Override
|
||||
public void execute(final Invocation invocation) {
|
||||
@@ -22,4 +26,15 @@ public class CommandVelocity implements SimpleCommand {
|
||||
public boolean hasPermission(final Invocation invocation) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> suggest(final Invocation invocation) {
|
||||
String[] args = invocation.arguments();
|
||||
if (invocation.source() instanceof Player) {
|
||||
Player player = (Player) invocation.source();
|
||||
String name = player.getUsername();
|
||||
return TabCommand.getTabList(name, args);
|
||||
}
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package coloryr.allmusic.side.velocity;
|
||||
|
||||
import coloryr.allmusic.AllMusic;
|
||||
import coloryr.allmusic.side.bc.SideBC;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.connection.DisconnectEvent;
|
||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||
import com.velocitypowered.api.event.connection.PostLoginEvent;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
|
||||
public class EventVelocity {
|
||||
@Subscribe
|
||||
@@ -15,4 +18,17 @@ public class EventVelocity {
|
||||
public void onPostLoginEvent(final PostLoginEvent event) {
|
||||
AllMusic.removeNowPlayPlayer(event.getPlayer().getUsername());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPluginMessageEvent(final PluginMessageEvent event){
|
||||
if (event.getIdentifier().getId().equals(AllMusic.channelBC)) {
|
||||
event.setResult(PluginMessageEvent.ForwardResult.handled());
|
||||
if (event.getSource() instanceof ServerConnection) {
|
||||
ServerConnection server = (ServerConnection) event.getSource();
|
||||
SideVelocity.TopServers.add(server);
|
||||
SideVelocity.sendAllToServer(server);
|
||||
SideVelocity.sendLyricToServer(server);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,13 @@ import coloryr.allmusic.AllMusicVelocity;
|
||||
import coloryr.allmusic.api.ISide;
|
||||
import coloryr.allmusic.hud.HudSave;
|
||||
import coloryr.allmusic.hud.obj.SaveOBJ;
|
||||
import coloryr.allmusic.music.play.PlayMusic;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.google.gson.Gson;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
@@ -17,10 +21,14 @@ import net.kyori.adventure.text.event.ClickEvent;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SideVelocity implements ISide {
|
||||
public static final Set<ServerConnection> TopServers = new CopyOnWriteArraySet<>();
|
||||
private boolean isOK(Player player, boolean in) {
|
||||
try {
|
||||
if (player == null)
|
||||
@@ -68,11 +76,19 @@ public class SideVelocity implements ISide {
|
||||
|
||||
@Override
|
||||
public void bq(String data) {
|
||||
if (AllMusic.getConfig().isMessageLimit()
|
||||
&& data.length() > AllMusic.getConfig().getMessageLimitSize()) {
|
||||
data = data.substring(0, 30) + "...";
|
||||
}
|
||||
AllMusicVelocity.plugin.server.sendMessage(Component.text(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bqt(String data) {
|
||||
if (AllMusic.getConfig().isMessageLimit()
|
||||
&& data.length() > AllMusic.getConfig().getMessageLimitSize()) {
|
||||
data = data.substring(0, 30) + "...";
|
||||
}
|
||||
AllMusicVelocity.plugin.server.sendMessage(Component.text(data));
|
||||
}
|
||||
|
||||
@@ -175,29 +191,29 @@ public class SideVelocity implements ISide {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessaget(Object obj, String Message) {
|
||||
public void sendMessaget(Object obj, String message) {
|
||||
CommandSource sender = (CommandSource) obj;
|
||||
sender.sendMessage(Component.text(Message));
|
||||
sender.sendMessage(Component.text(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(Object obj, String Message) {
|
||||
public void sendMessage(Object obj, String message) {
|
||||
CommandSource sender = (CommandSource) obj;
|
||||
sender.sendMessage(Component.text(Message));
|
||||
sender.sendMessage(Component.text(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageRun(Object obj, String Message, String end, String command) {
|
||||
public void sendMessageRun(Object obj, String message, String end, String command) {
|
||||
CommandSource sender = (CommandSource) obj;
|
||||
TextComponent send = Component.text(Message + end)
|
||||
TextComponent send = Component.text(message + end)
|
||||
.clickEvent(ClickEvent.runCommand(command));
|
||||
sender.sendMessage(send);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageSuggest(Object obj, String Message, String end, String command) {
|
||||
public void sendMessageSuggest(Object obj, String message, String end, String command) {
|
||||
CommandSource sender = (CommandSource) obj;
|
||||
TextComponent send = Component.text(Message + end)
|
||||
TextComponent send = Component.text(message + end)
|
||||
.clickEvent(ClickEvent.suggestCommand(command));
|
||||
sender.sendMessage(send);
|
||||
}
|
||||
@@ -231,6 +247,121 @@ public class SideVelocity implements ISide {
|
||||
.delay(delay, TimeUnit.MICROSECONDS).schedule();
|
||||
}
|
||||
|
||||
public static void sendAllToServer(ServerConnection server){
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(0);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF(AllMusic.getMessage().getPAPI().getNoMusic());
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getName());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(1);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getAl());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(2);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getAlia());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(3);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getAuthor());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(4);
|
||||
if (PlayMusic.nowPlayMusic == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.nowPlayMusic.getCall());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(5);
|
||||
out.writeInt(PlayMusic.getSize());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(6);
|
||||
out.writeUTF(PlayMusic.getAllList());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendLyricToServer(ServerConnection server){
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(7);
|
||||
if (PlayMusic.lyricItem == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.lyricItem.getLyric());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
|
||||
out = ByteStreams.newDataOutput();
|
||||
out.writeInt(8);
|
||||
if (PlayMusic.lyricItem == null)
|
||||
out.writeUTF("");
|
||||
else
|
||||
out.writeUTF(PlayMusic.lyricItem.getTlyric());
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendPingToServer(ServerConnection server) {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeInt(200);
|
||||
server.sendPluginMessage(AllMusicVelocity.channelBC, out.toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ping(){
|
||||
Iterator<ServerConnection> iterator = TopServers.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ServerConnection server = iterator.next();
|
||||
try{
|
||||
sendPingToServer(server);
|
||||
}catch (Exception e){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInfo() {
|
||||
Iterator<ServerConnection> iterator = TopServers.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ServerConnection server = iterator.next();
|
||||
try{
|
||||
sendAllToServer(server);
|
||||
}catch (Exception e){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLyric() {
|
||||
Iterator<ServerConnection> iterator = TopServers.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ServerConnection server = iterator.next();
|
||||
try {
|
||||
sendLyricToServer(server);
|
||||
} catch (Exception e) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void send(Player players, String data, Boolean isplay) {
|
||||
if (players == null)
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: AllMusic
|
||||
main: coloryr.allmusic.AllMusicBC
|
||||
author: Color_yr
|
||||
version: 2.15.2
|
||||
version: 2.16.1
|
||||
@@ -13,6 +13,9 @@
|
||||
"SendLyric": true,
|
||||
"NeedPermission": false,
|
||||
"DefaultAddMusic": 0,
|
||||
"TopPAPI": false,
|
||||
"MessageLimit": false,
|
||||
"MessageLimitSize": 40,
|
||||
"DefaultHud": {
|
||||
"List": {
|
||||
"x": 2,
|
||||
@@ -39,5 +42,5 @@
|
||||
"SearchCost": 20,
|
||||
"AddMusicCost": 10,
|
||||
"MusicBR": "320000",
|
||||
"Version": "2.15.2"
|
||||
"Version": "2.16.1"
|
||||
}
|
||||
@@ -1,32 +1,32 @@
|
||||
{
|
||||
"MusicPlay": {
|
||||
"StopPlay": "§d[AllMusic]§2已停止你的音乐播放",
|
||||
"NoMusic": "§d[AllMusic]§2无正在播放的歌曲",
|
||||
"Play": "§d[AllMusic]§2正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%",
|
||||
"NoPlay": "§d[AllMusic]§2队列中无歌曲",
|
||||
"StopPlay": "§d[AllMusic]§e已停止你的音乐播放",
|
||||
"NoMusic": "§d[AllMusic]§e无正在播放的歌曲",
|
||||
"Play": "§d[AllMusic]§e正在播放:%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%",
|
||||
"NoPlay": "§d[AllMusic]§e队列中无歌曲",
|
||||
"ListMusic": {
|
||||
"Head": "§d[AllMusic]§2队列中有歌曲数:&Count&",
|
||||
"Item": "§2%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%",
|
||||
"Get": "§d[AllMusic]§2歌曲列表%ListName%获取成功"
|
||||
"Head": "§d[AllMusic]§e队列中有歌曲数:&Count&",
|
||||
"Item": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%",
|
||||
"Get": "§d[AllMusic]§e歌曲列表%ListName%获取成功"
|
||||
},
|
||||
"NoCanPlay": "§d[AllMusic]§c无法播放歌曲%MusicID%可能该歌曲为VIP歌曲",
|
||||
"NoPlayMusic": "§d[AllMusic]§2你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!",
|
||||
"Switch": "§d[AllMusic]§2切换到玩家歌曲",
|
||||
"AddMusic": "§d[AllMusic]§2音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%",
|
||||
"PlayerAdd": "§d[AllMusic]§2%PlayerName%点歌%MusicID%",
|
||||
"NoPlayMusic": "§d[AllMusic]§e你不会再收到点歌了!想要再次参与点歌就点一首歌或者参与切歌投票吧!",
|
||||
"Switch": "§d[AllMusic]§e切换到玩家歌曲",
|
||||
"AddMusic": "§d[AllMusic]§e音乐列表添加%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia%",
|
||||
"PlayerAdd": "§d[AllMusic]§e%PlayerName%点歌%MusicID%",
|
||||
"MusicInfo": "%MusicName% | %MusicAuthor% | %MusicAl% | %MusicAlia% | by: %PlayerName%",
|
||||
"Trail": "§d[AllMusic]§2该音乐为试听音乐"
|
||||
"Trail": "§d[AllMusic]§e该音乐为试听音乐"
|
||||
},
|
||||
"AddMusic": {
|
||||
"ListFull": "§d[AllMusic]§c错误,队列已满",
|
||||
"BanMusic": "§d[AllMusic]§c错误,这首歌被禁点了",
|
||||
"ExistMusic": "§d[AllMusic]§c错误,这首歌已经存在了",
|
||||
"Success": "§d[AllMusic]§2点歌成功",
|
||||
"Success": "§d[AllMusic]§e点歌成功",
|
||||
"NoPlayer": "§d[AllMusic]§c没有播放的玩家",
|
||||
"NoID": "§d[AllMusic]§c错误,请输入歌曲数字ID"
|
||||
},
|
||||
"Page": {
|
||||
"Choice": "§2%index%->%MusicName% | %MusicAuthor% | %MusicAl%",
|
||||
"Choice": "§e%index%->%MusicName% | %MusicAuthor% | %MusicAl%",
|
||||
"Next": "§e[§n点我下一页§r§e]",
|
||||
"Last": "§e[§n点我上一页§r§e]"
|
||||
},
|
||||
@@ -36,33 +36,33 @@
|
||||
},
|
||||
"Vote": {
|
||||
"NoPermission": "§d[AllMusic]§c你没有权限切歌",
|
||||
"DoVote": "§d[AllMusic]§2已发起切歌投票",
|
||||
"BQ": "§d[AllMusic]§2%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。",
|
||||
"Agree": "§d[AllMusic]§2你同意切歌",
|
||||
"BQAgree": "§d[AllMusic]§2%PlayerName%同意切歌,共有%Count%名玩家同意切歌。",
|
||||
"ARAgree": "§d[AllMusic]§2你已申请切歌",
|
||||
"TimeOut": "§d[AllMusic]§2切歌时间结束",
|
||||
"Do": "§d[AllMusic]§2已切歌"
|
||||
"DoVote": "§d[AllMusic]§e已发起切歌投票",
|
||||
"BQ": "§d[AllMusic]§e%PlayerName%发起了切歌投票,30秒后结束,输入/music vote 同意切歌。",
|
||||
"Agree": "§d[AllMusic]§e你同意切歌",
|
||||
"BQAgree": "§d[AllMusic]§e%PlayerName%同意切歌,共有%Count%名玩家同意切歌。",
|
||||
"ARAgree": "§d[AllMusic]§e你已申请切歌",
|
||||
"TimeOut": "§d[AllMusic]§e切歌时间结束",
|
||||
"Do": "§d[AllMusic]§e已切歌"
|
||||
},
|
||||
"Search": {
|
||||
"StartSearch": "§d[AllMusic]§2正在排队搜歌",
|
||||
"StartSearch": "§d[AllMusic]§e正在排队搜歌",
|
||||
"NoPer": "§d[AllMusic]§c你没有权限搜歌",
|
||||
"CantSearch": "§d[AllMusic]§c无法搜索歌曲:%Music%",
|
||||
"Res": "§d[AllMusic]§2搜索结果",
|
||||
"Res": "§d[AllMusic]§e搜索结果",
|
||||
"NoSearch": "§d[AllMusic]§c你没有搜索音乐",
|
||||
"ErrorNum": "§d[AllMusic]§c请输入正确的序号",
|
||||
"Chose": "§d[AllMusic]§2你选择了序号%Num%",
|
||||
"Chose": "§d[AllMusic]§e你选择了序号%Num%",
|
||||
"CantNext": "§d[AllMusic]§c无法下一页",
|
||||
"CantLast": "§d[AllMusic]§c无法上一页"
|
||||
},
|
||||
"Hud": {
|
||||
"State": "§d[AllMusic]§2设置信息位置:%Hud%,状态:%State%",
|
||||
"Set": "§d[AllMusic]§2已设置%Hud%的坐标为%x%, %y%",
|
||||
"Reset": "§d[AllMusic]§2Hud恢复至默认位置",
|
||||
"State": "§d[AllMusic]§e设置信息位置:%Hud%,状态:%State%",
|
||||
"Set": "§d[AllMusic]§e已设置%Hud%的坐标为%x%, %y%",
|
||||
"Reset": "§d[AllMusic]§eHud恢复至默认位置",
|
||||
"NoMusic": "没有播放的音乐",
|
||||
"NoList": "队列中无歌曲",
|
||||
"NoLyric": "无歌词",
|
||||
"PicSize": "§d[ALLMusic]§2设置图片尺寸为%Size%"
|
||||
"PicSize": "§d[ALLMusic]§e设置图片尺寸为%Size%"
|
||||
},
|
||||
"Command": {
|
||||
"Error": "§d[AllMusic]§c参数错误,请输入/music help获取帮助",
|
||||
@@ -82,8 +82,8 @@
|
||||
"NoMusic": "没有播放的音乐"
|
||||
},
|
||||
"Cost": {
|
||||
"Search": "§d[AllMusic]§2你搜歌花费了%Cost%",
|
||||
"AddMusic": "§d[AllMusic]§2你点歌花费了%Cost%",
|
||||
"Search": "§d[AllMusic]§e你搜歌花费了%Cost%",
|
||||
"AddMusic": "§d[AllMusic]§e你点歌花费了%Cost%",
|
||||
"NoMoney": "§d[AllMusic]§c你没有足够的钱"
|
||||
},
|
||||
"Click": {
|
||||
@@ -92,27 +92,27 @@
|
||||
},
|
||||
"Help": {
|
||||
"Normal": {
|
||||
"Head": "§d[AllMusic]§2帮助手册",
|
||||
"Base": "§d[AllMusic]§2使用/music [音乐ID] 来点歌",
|
||||
"Stop": "§d[AllMusic]§2使用/music stop 停止播放歌曲",
|
||||
"List": "§d[AllMusic]§2使用/music list 查看歌曲队列",
|
||||
"Vote": "§d[AllMusic]§2使用/music vote 投票切歌",
|
||||
"NoMusic": "§d[AllMusic]§2使用/music nomusic 不再参与点歌",
|
||||
"Search": "§d[AllMusic]§2使用/music search [歌名] 搜索歌曲",
|
||||
"Select": "§d[AllMusic]§2使用/music select [序列] 选择歌曲",
|
||||
"Hud1": "§d[AllMusic]§2使用/music hud enable [位置] 启用关闭Hud",
|
||||
"Hud2": "§d[AllMusic]§2使用/music hud [位置] [x] [y] 设置某个Hud的位置",
|
||||
"Hud3": "§d[AllMusic]§2使用/music hud picsize [尺寸] 设置图片尺寸"
|
||||
"Head": "§d[AllMusic]§e帮助手册",
|
||||
"Base": "§d[AllMusic]§e使用/music [音乐ID] 来点歌",
|
||||
"Stop": "§d[AllMusic]§e使用/music stop 停止播放歌曲",
|
||||
"List": "§d[AllMusic]§e使用/music list 查看歌曲队列",
|
||||
"Vote": "§d[AllMusic]§e使用/music vote 投票切歌",
|
||||
"NoMusic": "§d[AllMusic]§e使用/music nomusic 不再参与点歌",
|
||||
"Search": "§d[AllMusic]§e使用/music search [歌名] 搜索歌曲",
|
||||
"Select": "§d[AllMusic]§e使用/music select [序列] 选择歌曲",
|
||||
"Hud1": "§d[AllMusic]§e使用/music hud enable [位置] 启用关闭Hud",
|
||||
"Hud2": "§d[AllMusic]§e使用/music hud [位置] [x] [y] 设置某个Hud的位置",
|
||||
"Hud3": "§d[AllMusic]§e使用/music hud picsize [尺寸] 设置图片尺寸"
|
||||
},
|
||||
"Admin": {
|
||||
"Reload": "§d[AllMusic]§2使用/music reload 重读配置文件",
|
||||
"Next": "§d[AllMusic]§2使用/music next 强制切歌",
|
||||
"Ban": "§d[AllMusic]§2使用/music ban [ID] 禁止点这首歌",
|
||||
"Url": "§d[AllMusic]§2使用/music url [url] 播放一首自定义歌曲",
|
||||
"Delete": "§d[AllMusic]§2使用/music delete [序号] 删除队列中的歌曲",
|
||||
"AddList": "§d[AllMusic]§2使用/music addlist [歌单ID] 添加歌单到空闲列表",
|
||||
"ClearList": "§d[AllMusic]§2使用/music clearlist 清空空闲歌单",
|
||||
"Login": "§d[AllMusic]§2使用/music login 重新登录账户"
|
||||
"Reload": "§d[AllMusic]§e使用/music reload 重读配置文件",
|
||||
"Next": "§d[AllMusic]§e使用/music next 强制切歌",
|
||||
"Ban": "§d[AllMusic]§e使用/music ban [ID] 禁止点这首歌",
|
||||
"Url": "§d[AllMusic]§e使用/music url [url] 播放一首自定义歌曲",
|
||||
"Delete": "§d[AllMusic]§e使用/music delete [序号] 删除队列中的歌曲",
|
||||
"AddList": "§d[AllMusic]§e使用/music addlist [歌单ID] 添加歌单到空闲列表",
|
||||
"ClearList": "§d[AllMusic]§e使用/music clearlist 清空空闲歌单",
|
||||
"Login": "§d[AllMusic]§e使用/music login 重新登录账户"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
name: AllMusic
|
||||
main: coloryr.allmusic.AllMusicBukkit
|
||||
author: Color_yr
|
||||
version: 2.15.2
|
||||
version: 2.16.0
|
||||
loadbefore: [PlaceholderAPI, Vault, Essentials, CMI]
|
||||
api-version: 1.13
|
||||
|
||||
commands:
|
||||
music:
|
||||
|
||||
Reference in new issue
Block a user