Skip to content

Commit

Permalink
# 1.7.1 | 2020-09-02
Browse files Browse the repository at this point in the history
* 修复1.13以上版本无法加载插件的问题
  • Loading branch information
RealHeart committed Sep 2, 2020
1 parent 53af5c0 commit 88d8594
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 191 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.7.1 | 2020-09-02
* 修复1.13以上版本无法加载插件的问题

# 1.7 | 2020-09-02
* 添加全服歌单功能
* 插件支持1.13-1.16播放
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,6 @@ lyric:

## 1.4及以下版本使用

~~[```AudioBuffer```](https://www.mcbbs.net/thread-832205-1-1.html) [必须] 用于播放音乐,贴内有配套Mod 客户端需安装~~
~~[```AudioBuffer```](https://www.mcbbs.net/thread-832205-1-1.html) [必须] 用于播放音乐,贴内有配套Mod 客户端需安装~~
~~[```BossBarAPI```](https://www.mcbbs.net/thread-729531-1-1.html) [可选] 如需使用BossBar显示歌词 请安装~~
~~[```ActionBarAPI```](https://www.spigotmc.org/resources/actionbarapi-1-8-1-14-2.1315/) [可选] 如需使用ActionBar显示歌词 请安装~~
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.iqianye.mc</groupId>
<artifactId>ZMusic</artifactId>
<version>1.7</version>
<version>1.7.1</version>

<repositories>
<repository>
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/cn/iqianye/mc/zmusic/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Main extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Config.debug = true;
Version version = new Version();
LogUtils.sendNormalMessage("正在加载中....");
//注册bStats
MetricsLite metricsLite = new MetricsLite(this, 7291);
Expand All @@ -38,18 +39,22 @@ public void onEnable() {
getCommand("zm").setTabCompleter(new CommandExec());
if (org.bukkit.Bukkit.getPluginManager().isPluginEnabled("AudioBuffer")) {
LogUtils.sendErrorMessage("请勿安装AudioBuffer插件.");
setEnabled(false);
Val.isEnable = false;
}
if (org.bukkit.Bukkit.getPluginManager().isPluginEnabled("AllMusic")) {
LogUtils.sendErrorMessage("请勿安装AllMusic插件.");
setEnabled(false);
Val.isEnable = false;
}
//注册Mod通信频道
LogUtils.sendNormalMessage("正在注册Mod通信频道...");
getServer().getMessenger().registerOutgoingPluginChannel(this, "allmusic:channel");
LogUtils.sendNormalMessage("-- §r[§eAllMusic§r]§a 频道注册完毕.");
getServer().getMessenger().registerOutgoingPluginChannel(this, "AudioBuffer");
LogUtils.sendNormalMessage("-- §r[§eAudioBuffer§r]§a 频道注册完毕.");
if (!version.isHigherThan("1.13")) {
getServer().getMessenger().registerOutgoingPluginChannel(this, "AudioBuffer");
LogUtils.sendNormalMessage("-- §r[§eAudioBuffer§r]§a 频道注册完毕.");
} else {
LogUtils.sendErrorMessage("-- §r[§eAudioBuffer§r]§c 服务端大于1.13,频道注册取消.");
}
//注册事件监听器
getServer().getPluginManager().registerEvents(this, this);
OtherUtils.checkUpdate(Val.thisVer, null);
Expand All @@ -76,7 +81,6 @@ public void onEnable() {
LogUtils.sendErrorMessage("未找到ViaVersion, 高版本转发功能不生效.");
Val.isViaVer = false;
}
Version version = new Version();
if (Bukkit.getBukkitVersion().contains("1.7.10")) {
if (!Bukkit.getBukkitVersion().contains("Uranium")) {
LogUtils.sendErrorMessage("检测到当前服务端非Uranium,不支持Title/ActionBar显示");
Expand Down
366 changes: 186 additions & 180 deletions src/main/java/cn/iqianye/mc/zmusic/command/CommandExec.java

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main/java/cn/iqianye/mc/zmusic/mod/Send.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void sendAM(Player player, String data) {
buf.writeBytes(bytes);
player.sendPluginMessage(JavaPlugin.getPlugin(Main.class), "allmusic:channel", buf.array());
} catch (Exception e) {
LogUtils.sendErrorMessage("§c数据发送发生错误");
LogUtils.sendErrorMessage("数据发送发生错误");
e.printStackTrace();
}
}
Expand All @@ -32,7 +32,7 @@ public static void sendABF(Player player, String data) {
try {
player.sendPluginMessage(JavaPlugin.getPlugin(Main.class), "AudioBuffer", data.getBytes());
} catch (Exception e) {
LogUtils.sendErrorMessage("§c数据发送发生错误");
LogUtils.sendErrorMessage("数据发送发生错误");
e.printStackTrace();
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/cn/iqianye/mc/zmusic/other/Val.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cn.iqianye.mc.zmusic.other;

public class Val {
public static String thisVer = "1.7";
public static int thisVerCode = 202009020;
public static String thisVer = "1.7.1";
public static int thisVerCode = 202009021;
public static boolean isLatest = true;
public static String updateLog;
public static String latestVer;
Expand All @@ -16,4 +16,6 @@ public class Val {
public static boolean bilibiliIsVIP = false;

public static boolean isViaVer = true;

public static boolean isEnable = true;
}

0 comments on commit 88d8594

Please sign in to comment.