Skip to content

Commit

Permalink
up 3.1.0
Browse files Browse the repository at this point in the history
添加文件长度限制
  • Loading branch information
Coloryr committed May 13, 2024
1 parent efadd0f commit 3970a44
Show file tree
Hide file tree
Showing 40 changed files with 192 additions and 526 deletions.
2 changes: 1 addition & 1 deletion fabric_1_16_5/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.11
fabric_kotlin_version=1.10.19+kotlin.1.9.23

# Mod Properties
mod_version = 3.0.0
mod_version = 3.1.0
maven_group = com.coloryr.allmusic.server
archives_base_name =[fabric-1.16.5]AllMusic_Server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.coloryr.allmusic.server.core.objs.enums.HudType;
import com.coloryr.allmusic.server.core.objs.music.MusicObj;
import com.coloryr.allmusic.server.core.objs.music.SongInfoObj;
import com.coloryr.allmusic.server.core.side.ISide;
import com.coloryr.allmusic.server.core.side.BaseSide;
import com.coloryr.allmusic.server.core.utils.HudUtils;
import com.coloryr.allmusic.server.side.fabric.event.MusicAddEvent;
import com.coloryr.allmusic.server.side.fabric.event.MusicPlayEvent;
Expand All @@ -27,7 +27,7 @@
import java.util.List;
import java.util.UUID;

public class SideFabric extends ISide {
public class SideFabric extends BaseSide {

@Override
public void reload() {
Expand All @@ -36,7 +36,7 @@ public void reload() {
}

@Override
public int getAllPlayer() {
public int getPlayerSize() {
return AllMusicFabric.server.getCurrentPlayerCount();
}

Expand Down Expand Up @@ -64,7 +64,7 @@ public boolean checkPermission(String player, String permission) {

@Override
public boolean needPlay() {
int online = getAllPlayer();
int online = getPlayerSize();
for (ServerPlayerEntity player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
online--;
Expand Down Expand Up @@ -330,11 +330,7 @@ public void clearHud() {
}

@Override
public void bq(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
public void topBq(String data) {
for (ServerPlayerEntity player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(Text.of(data), false);
Expand All @@ -347,27 +343,6 @@ public void bqRun(String message, String end, String command) {
FabricApi.sendMessageBqRun(message, end, command);
}

@Override
public void bqt(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
Text finalData = Text.of(data);
runTask(() -> {
for (ServerPlayerEntity player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(finalData, false);
}
}
});
}

@Override
public void sendMessaget(Object obj, String message) {
runTask(() -> ((CommandOutput) obj).sendSystemMessage(Text.of(message), UUID.randomUUID()));
}

@Override
public void sendMessage(Object obj, String message) {
CommandOutput sender = (CommandOutput) obj;
Expand Down
2 changes: 1 addition & 1 deletion fabric_1_18_2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.11
fabric_kotlin_version=1.10.19+kotlin.1.9.23

# Mod Properties
mod_version=3.0.0
mod_version=3.1.0
maven_group=com.coloryr.allmusic.server
archives_base_name=[fabric-1.18.2]AllMusic_Server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.coloryr.allmusic.server.core.objs.enums.HudType;
import com.coloryr.allmusic.server.core.objs.music.MusicObj;
import com.coloryr.allmusic.server.core.objs.music.SongInfoObj;
import com.coloryr.allmusic.server.core.side.ISide;
import com.coloryr.allmusic.server.core.side.BaseSide;
import com.coloryr.allmusic.server.core.utils.HudUtils;
import com.coloryr.allmusic.server.side.fabric.event.MusicAddEvent;
import com.coloryr.allmusic.server.side.fabric.event.MusicPlayEvent;
Expand All @@ -27,7 +27,7 @@
import java.util.List;
import java.util.UUID;

public class SideFabric extends ISide {
public class SideFabric extends BaseSide {

@Override
public void reload() {
Expand All @@ -36,7 +36,7 @@ public void reload() {
}

@Override
public int getAllPlayer() {
public int getPlayerSize() {
return AllMusicFabric.server.getCurrentPlayerCount();
}

Expand Down Expand Up @@ -64,7 +64,7 @@ public boolean checkPermission(String player, String permission) {

@Override
public boolean needPlay() {
int online = getAllPlayer();
int online = getPlayerSize();
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
online--;
Expand Down Expand Up @@ -330,11 +330,7 @@ public void clearHud() {
}

@Override
public void bq(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
public void topBq(String data) {
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(Text.of(data), false);
Expand All @@ -347,27 +343,6 @@ public void bqRun(String message, String end, String command) {
FabricApi.sendMessageBqRun(message, end, command);
}

@Override
public void bqt(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
var finalData = Text.of(data);
runTask(() -> {
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(finalData, false);
}
}
});
}

@Override
public void sendMessaget(Object obj, String message) {
runTask(() -> ((CommandOutput) obj).sendSystemMessage(Text.of(message), UUID.randomUUID()));
}

@Override
public void sendMessage(Object obj, String message) {
CommandOutput sender = (CommandOutput) obj;
Expand Down
2 changes: 1 addition & 1 deletion fabric_1_19_2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.11
fabric_kotlin_version=1.10.19+kotlin.1.9.23

# Mod Properties
mod_version = 3.0.0
mod_version = 3.1.0
maven_group = com.coloryr.allmusic.server
archives_base_name =[fabric-1.19.2]AllMusic_Server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.coloryr.allmusic.server.core.objs.enums.HudType;
import com.coloryr.allmusic.server.core.objs.music.MusicObj;
import com.coloryr.allmusic.server.core.objs.music.SongInfoObj;
import com.coloryr.allmusic.server.core.side.ISide;
import com.coloryr.allmusic.server.core.side.BaseSide;
import com.coloryr.allmusic.server.core.utils.HudUtils;
import com.coloryr.allmusic.server.side.fabric.event.MusicAddEvent;
import com.coloryr.allmusic.server.side.fabric.event.MusicPlayEvent;
Expand All @@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;

public class SideFabric extends ISide {
public class SideFabric extends BaseSide {

@Override
public void reload() {
Expand All @@ -37,7 +37,7 @@ public void reload() {
}

@Override
public int getAllPlayer() {
public int getPlayerSize() {
return AllMusicFabric.server.getCurrentPlayerCount();
}

Expand Down Expand Up @@ -65,7 +65,7 @@ public boolean checkPermission(String player, String permission) {

@Override
public boolean needPlay() {
int online = getAllPlayer();
int online = getPlayerSize();
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
online--;
Expand Down Expand Up @@ -331,11 +331,7 @@ public void clearHud() {
}

@Override
public void bq(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
public void topBq(String data) {
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(Text.of(data), false);
Expand All @@ -348,27 +344,6 @@ public void bqRun(String message, String end, String command) {
FabricApi.sendMessageBqRun(message, end, command);
}

@Override
public void bqt(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
var finalData = Text.of(data);
runTask(() -> {
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(finalData, false);
}
}
});
}

@Override
public void sendMessaget(Object obj, String message) {
runTask(() -> ((CommandOutput) obj).sendMessage(Text.of(message)));
}

@Override
public void sendMessage(Object obj, String message) {
CommandOutput sender = (CommandOutput) obj;
Expand Down
2 changes: 1 addition & 1 deletion fabric_1_19_3/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.11
fabric_kotlin_version=1.10.19+kotlin.1.9.23

# Mod Properties
mod_version = 3.0.0
mod_version = 3.1.0
maven_group = com.coloryr.allmusic.server
archives_base_name =[fabric-1.19.3]AllMusic_Server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.coloryr.allmusic.server.core.objs.enums.HudType;
import com.coloryr.allmusic.server.core.objs.music.MusicObj;
import com.coloryr.allmusic.server.core.objs.music.SongInfoObj;
import com.coloryr.allmusic.server.core.side.ISide;
import com.coloryr.allmusic.server.core.side.BaseSide;
import com.coloryr.allmusic.server.core.utils.HudUtils;
import com.coloryr.allmusic.server.side.fabric.event.MusicAddEvent;
import com.coloryr.allmusic.server.side.fabric.event.MusicPlayEvent;
Expand All @@ -26,7 +26,7 @@
import java.util.ArrayList;
import java.util.List;

public class SideFabric extends ISide {
public class SideFabric extends BaseSide {

@Override
public void reload() {
Expand All @@ -35,7 +35,7 @@ public void reload() {
}

@Override
public int getAllPlayer() {
public int getPlayerSize() {
return AllMusicFabric.server.getCurrentPlayerCount();
}

Expand Down Expand Up @@ -63,7 +63,7 @@ public boolean checkPermission(String player, String permission) {

@Override
public boolean needPlay() {
int online = getAllPlayer();
int online = getPlayerSize();
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
online--;
Expand Down Expand Up @@ -329,11 +329,7 @@ public void clearHud() {
}

@Override
public void bq(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
public void topBq(String data) {
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(Text.of(data), false);
Expand All @@ -346,27 +342,6 @@ public void bqRun(String message, String end, String command) {
FabricApi.sendMessageBqRun(message, end, command);
}

@Override
public void bqt(String data) {
if (AllMusic.getConfig().messageLimit
&& data.length() > AllMusic.getConfig().messageLimitSize) {
data = data.substring(0, AllMusic.getConfig().messageLimitSize - 1) + "...";
}
var finalData = Text.of(data);
runTask(() -> {
for (var player : AllMusicFabric.server.getPlayerManager().getPlayerList()) {
if (!AllMusic.getConfig().mutePlayer.contains(player.getName().getString())) {
player.sendMessage(finalData, false);
}
}
});
}

@Override
public void sendMessaget(Object obj, String message) {
runTask(() -> ((CommandOutput) obj).sendMessage(Text.of(message)));
}

@Override
public void sendMessage(Object obj, String message) {
CommandOutput sender = (CommandOutput) obj;
Expand Down
2 changes: 1 addition & 1 deletion fabric_1_20/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.11
fabric_kotlin_version=1.10.19+kotlin.1.9.23

# Mod Properties
mod_version = 3.0.0
mod_version = 3.1.0
maven_group = com.coloryr.allmusic.server
archives_base_name =[fabric-1.20]AllMusic_Server

Expand Down
Loading

0 comments on commit 3970a44

Please sign in to comment.