mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-08 18:54:44 +00:00
up 大改渲染
This commit is contained in:
1 parent
7ebdffeeff
commit
d533e672f6
20 files changed
+201
-103
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ allprojects {
|
||||
apply(plugin = "com.gradleup.shadow")
|
||||
|
||||
group = "com.coloryr"
|
||||
version = "3.9.2"
|
||||
version = "4.0.0"
|
||||
|
||||
// 设置项目JDK版本
|
||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
object Versions {
|
||||
const val fabricLoom = "1.16-SNAPSHOT"
|
||||
const val architecturyLoom = "1.14-SNAPSHOT"
|
||||
const val httpclient5 = "5.6.1"
|
||||
const val httpcore5 = "5.4.2"
|
||||
const val httpcore5_h2 = "5.4.2"
|
||||
const val gson = "2.14.0"
|
||||
const val sqlite = "3.53.1.0"
|
||||
const val minimessage = "4.26.1"
|
||||
const val adventure = "4.8.1"
|
||||
}
|
||||
+1
-1
Submodule client updated: 722adca710...1f1a22e950.
+5
-2
@@ -1,6 +1,9 @@
|
||||
#Mon Jun 16 08:15:35 CST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -80,13 +82,11 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -133,22 +132,29 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -165,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -193,18 +198,27 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
||||
Vendored
+26
-33
@@ -13,19 +13,22 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,15 +43,15 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -56,34 +59,24 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
@@ -6,8 +6,6 @@ subprojects {
|
||||
shadowImplementation(project(":server:core"))
|
||||
shadowImplementation(project(":codec"))
|
||||
shadowImplementation(project(":codec:buffercodec"))
|
||||
|
||||
shadowImplementation("org.xerial:sqlite-jdbc:3.51.1.0")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
dependencies {
|
||||
shadowImplementation("org.apache.httpcomponents.client5:httpclient5:5.6")
|
||||
shadowImplementation("org.apache.httpcomponents.core5:httpcore5:5.4")
|
||||
shadowImplementation("org.apache.httpcomponents.core5:httpcore5-h2:5.4")
|
||||
shadowImplementation("org.apache.httpcomponents.client5:httpclient5:${Versions.httpclient5}")
|
||||
shadowImplementation("org.apache.httpcomponents.core5:httpcore5:${Versions.httpcore5}")
|
||||
shadowImplementation("org.apache.httpcomponents.core5:httpcore5-h2:${Versions.httpcore5_h2}")
|
||||
|
||||
compileOnly("com.google.code.gson:gson:2.11.0")
|
||||
compileOnly("net.kyori:adventure-text-minimessage:4.26.1")
|
||||
compileOnly("com.google.code.gson:gson:${Versions.gson}")
|
||||
compileOnly("net.kyori:adventure-text-minimessage:${Versions.minimessage}")
|
||||
}
|
||||
@@ -47,15 +47,15 @@ public class AllMusic {
|
||||
/**
|
||||
* 插件版本号
|
||||
*/
|
||||
public static final String version = "3.9.0";
|
||||
public static final String version = "4.0.0";
|
||||
/**
|
||||
* 配置文件版本号
|
||||
*/
|
||||
public static final String configVersion = "207";
|
||||
public static final String configVersion = "400";
|
||||
/**
|
||||
* 语言文件配置版本号
|
||||
*/
|
||||
public static final String messageVersion = "212";
|
||||
public static final String messageVersion = "400";
|
||||
/**
|
||||
* 日志
|
||||
*/
|
||||
|
||||
+31
-2
@@ -20,6 +20,7 @@ public class CommandHudSet extends AHudCommand {
|
||||
this.add("enable");
|
||||
this.add("pos");
|
||||
this.add("dir");
|
||||
this.add("alpha");
|
||||
this.add("reset");
|
||||
}};
|
||||
private static final List<String> pic = new ArrayList<String>() {{
|
||||
@@ -42,6 +43,7 @@ public class CommandHudSet extends AHudCommand {
|
||||
commandList.put("enable", new HudEnable(type));
|
||||
commandList.put("reset", new HudReset(type));
|
||||
commandList.put("pos", new HudPos(type));
|
||||
commandList.put("alpha", new HudAlpha(type));
|
||||
commandList.put("dir", new HudDir(type));
|
||||
if (type == HudType.PIC) {
|
||||
commandList.put("size", new PicSize());
|
||||
@@ -148,8 +150,35 @@ public class CommandHudSet extends AHudCommand {
|
||||
|
||||
AllMusic.side.sendMessageTask(sender, AllMusic.getMessage().hud.set
|
||||
.replace(ARG.hud, AllMusic.getMessage().hudList.getHud(type))
|
||||
.replace(ARG.x, args[3])
|
||||
.replace(ARG.y, args[4]));
|
||||
.replace(ARG.x, String.valueOf(obj.x))
|
||||
.replace(ARG.y, String.valueOf(obj.y)));
|
||||
} catch (Exception e) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().command.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class HudAlpha extends AHudCommand {
|
||||
public HudAlpha(HudType type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Object sender, String name, String[] args) {
|
||||
try {
|
||||
if (args.length != 4) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().command.error);
|
||||
return;
|
||||
}
|
||||
HudItemPosObj obj = HudUtils.setHudAlpha(name, type, args[3]);
|
||||
if (obj == null) {
|
||||
AllMusic.side.sendMessageTask(sender, AllMusic.getMessage().command.error);
|
||||
return;
|
||||
}
|
||||
|
||||
AllMusic.side.sendMessageTask(sender, AllMusic.getMessage().hud.set4
|
||||
.replace(ARG.hud, AllMusic.getMessage().hudList.getHud(type))
|
||||
.replace(ARG.alpha, String.valueOf(obj.alpha)));
|
||||
} catch (Exception e) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().command.error);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public class ARG {
|
||||
public static String cost = "%Cost%";
|
||||
public static String index = "%Index%";
|
||||
public static String state = "%State%";
|
||||
public static String alpha = "%Alpha%";
|
||||
public static String x = "%X%";
|
||||
public static String y = "%Y%";
|
||||
public static String dir = "%Dir%";
|
||||
|
||||
@@ -6,6 +6,7 @@ public class HudObj {
|
||||
public String set1;
|
||||
public String set2;
|
||||
public String set3;
|
||||
public String set4;
|
||||
public String reset;
|
||||
public String emptyMusic;
|
||||
public String emptyList;
|
||||
@@ -36,6 +37,8 @@ public class HudObj {
|
||||
return true;
|
||||
if (set3 == null)
|
||||
return true;
|
||||
if (set4 == null)
|
||||
return true;
|
||||
if (reset == null)
|
||||
return true;
|
||||
if (emptyMusic == null)
|
||||
@@ -70,6 +73,8 @@ public class HudObj {
|
||||
set2 = "<light_purple>[AllMusic3]<yellow>已设置[" + ARG.hud + "]的颜色为[" + ARG.color + "]";
|
||||
if (set3 == null)
|
||||
set3 = "<light_purple>[AllMusic3]<yellow>已设置[" + ARG.hud + "]的阴影为[" + ARG.state + "]";
|
||||
if (set4 == null)
|
||||
set4 = "<light_purple>[AllMusic3]<yellow>已设置[" + ARG.hud + "]的透明度为[" + ARG.alpha + "]";
|
||||
if (reset == null)
|
||||
reset = "<light_purple>[AllMusic3]<yellow>界面[" + ARG.hud + "]恢复至默认位置";
|
||||
if (emptyMusic == null)
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
public class Function {
|
||||
public static boolean isInteger(String str) {
|
||||
Pattern pattern = Pattern.compile("^[-+]?\\d*$");
|
||||
Pattern pattern = Pattern.compile("^[-+]?\\d*\\.?\\d+$");
|
||||
return pattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,24 +51,25 @@ public class HudUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置玩家Hud位置
|
||||
* 设置组件位置
|
||||
*
|
||||
* @param player 用户名
|
||||
* @param pos 位置
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @return 位置数据
|
||||
* @return 组件数据
|
||||
*/
|
||||
public static HudItemPosObj setHudPos(String player, HudType pos, String x, String y) {
|
||||
HudPosObj obj = get(player);
|
||||
if (obj == null)
|
||||
obj = AllMusic.getConfig().defaultHud.copy();
|
||||
HudItemPosObj posOBJ = new HudItemPosObj(0, 0, HudDirType.TOP_LEFT, 0xffffff, false, true);
|
||||
|
||||
if (!Function.isInteger(x) && !Function.isInteger(y))
|
||||
return null;
|
||||
int x1 = Integer.parseInt(x);
|
||||
int y1 = Integer.parseInt(y);
|
||||
|
||||
HudItemPosObj posOBJ;
|
||||
switch (pos) {
|
||||
case LYRIC:
|
||||
posOBJ = obj.lyric;
|
||||
@@ -81,6 +82,9 @@ public class HudUtils {
|
||||
break;
|
||||
case PIC:
|
||||
posOBJ = obj.pic;
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
posOBJ.x = x1;
|
||||
posOBJ.y = y1;
|
||||
@@ -90,6 +94,47 @@ public class HudUtils {
|
||||
return posOBJ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置组件透明度
|
||||
* @param player 用户名
|
||||
* @param pos 位置
|
||||
* @param alpha 透明度
|
||||
* @return 组件数据
|
||||
*/
|
||||
public static HudItemPosObj setHudAlpha(String player, HudType pos, String alpha) {
|
||||
HudPosObj obj = get(player);
|
||||
if (obj == null)
|
||||
obj = AllMusic.getConfig().defaultHud.copy();
|
||||
if (!Function.isInteger(alpha))
|
||||
return null;
|
||||
float alpha1 = Float.parseFloat(alpha);
|
||||
if (alpha1 > 1 || alpha1 < 0) {
|
||||
alpha1 = 1;
|
||||
}
|
||||
HudItemPosObj posOBJ;
|
||||
switch (pos) {
|
||||
case LYRIC:
|
||||
posOBJ = obj.lyric;
|
||||
break;
|
||||
case LIST:
|
||||
posOBJ = obj.list;
|
||||
break;
|
||||
case INFO:
|
||||
posOBJ = obj.info;
|
||||
break;
|
||||
case PIC:
|
||||
posOBJ = obj.pic;
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
posOBJ.alpha = alpha1;
|
||||
|
||||
addAndSave(player, obj);
|
||||
HudUtils.sendHudPos(player);
|
||||
return posOBJ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新Hud的List数据
|
||||
*/
|
||||
|
||||
@@ -8,14 +8,16 @@ dependencies {
|
||||
modCompileOnly("net.fabricmc:fabric-loader:0.18.5")
|
||||
|
||||
modCompileOnly("net.fabricmc.fabric-api:fabric-api:0.42.0+1.16")
|
||||
modCompileOnly("net.kyori:adventure-platform-fabric:4.0.0")
|
||||
|
||||
shadowImplementation("net.kyori:adventure-text-minimessage:4.26.1")
|
||||
shadowImplementation("net.kyori:adventure-api:4.26.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-gson:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-legacy:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-plain:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-key:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-platform-api:4.0.0")
|
||||
shadowImplementation("net.kyori:adventure-text-minimessage:${Versions.minimessage}")
|
||||
shadowImplementation("net.kyori:adventure-api:${Versions.minimessage}")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-gson:${Versions.adventure}")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-legacy:${Versions.adventure}")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-plain:${Versions.adventure}")
|
||||
shadowImplementation("net.kyori:adventure-key:${Versions.adventure}")
|
||||
|
||||
include("org.xerial:sqlite-jdbc:${Versions.sqlite}")
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -29,7 +31,7 @@ tasks {
|
||||
|
||||
shadowJar {
|
||||
relocate("net.kyori", "com.coloryr.allmusic.libs.net.kyori")
|
||||
relocate("com.google.gson", "com.coloryr.allmusic.libs.com.google.gson")
|
||||
// relocate("com.google.gson", "com.coloryr.allmusic.libs.com.google.gson")
|
||||
}
|
||||
|
||||
remapJar {
|
||||
|
||||
@@ -81,7 +81,7 @@ public class SideFabric extends BaseSide {
|
||||
|
||||
@Override
|
||||
public Object getPlayer(String player) {
|
||||
return null;
|
||||
return AllMusicServer.server.getPlayerList().getPlayerByName(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,6 +99,9 @@ public class SideFabric extends BaseSide {
|
||||
|
||||
@Override
|
||||
public boolean needPlay(boolean islist) {
|
||||
if (AllMusicServer.server == null || AllMusicServer.server.getPlayerList() == null) {
|
||||
return false;
|
||||
}
|
||||
for (ServerPlayer player : AllMusicServer.server.getPlayerList().getPlayers()) {
|
||||
if (!AllMusic.isSkip(player.getName().getString(), null, false, islist)) {
|
||||
return true;
|
||||
|
||||
@@ -11,14 +11,22 @@ dependencies {
|
||||
modImplementation("net.fabricmc:fabric-loader:0.16.10")
|
||||
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:0.92.3+1.20.1")
|
||||
modImplementation("net.kyori:adventure-platform-fabric:5.9.0")
|
||||
|
||||
shadowImplementation("net.kyori:adventure-text-minimessage:4.26.1")
|
||||
shadowImplementation("net.kyori:adventure-api:4.26.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-gson:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-legacy:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-plain:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-key:4.8.1")
|
||||
modImplementation(include("net.kyori:adventure-platform-fabric:5.9.0")!!)
|
||||
|
||||
// include("net.kyori:adventure-platform-fabric:5.9.0")?.let { modImplementation(it) }
|
||||
// include("net.kyori:adventure-text-minimessage:4.26.1")?.let { modImplementation(it) }
|
||||
// include("net.kyori:adventure-api:4.26.1")?.let { modImplementation(it) }
|
||||
// include("net.kyori:adventure-key:4.26.1")?.let { modImplementation(it) }
|
||||
|
||||
// shadowImplementation("net.kyori:adventure-text-minimessage:4.26.1")
|
||||
// shadowImplementation("net.kyori:adventure-api:4.26.1")
|
||||
// shadowImplementation("net.kyori:adventure-text-serializer-gson:4.8.1")
|
||||
// shadowImplementation("net.kyori:adventure-text-serializer-legacy:4.8.1")
|
||||
// shadowImplementation("net.kyori:adventure-text-serializer-plain:4.8.1")
|
||||
// shadowImplementation("net.kyori:adventure-key:4.8.1")
|
||||
|
||||
include("org.xerial:sqlite-jdbc:${Versions.sqlite}")
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -31,8 +39,8 @@ tasks {
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate("net.kyori", "com.coloryr.allmusic.libs.net.kyori")
|
||||
relocate("com.google.gson", "com.coloryr.allmusic.libs.com.google.gson")
|
||||
// relocate("net.kyori", "com.coloryr.allmusic.libs.net.kyori")
|
||||
// relocate("com.google.gson", "com.coloryr.allmusic.libs.com.google.gson")
|
||||
}
|
||||
|
||||
remapJar {
|
||||
|
||||
@@ -6,11 +6,6 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -21,13 +16,6 @@ public class AllMusicServer implements DedicatedServerModInitializer {
|
||||
|
||||
public static final String dir = "allmusic_server/";
|
||||
|
||||
private static final GsonComponentSerializer GSON_SERIALIZER = GsonComponentSerializer.builder().build();
|
||||
|
||||
public static MutableComponent parse(Component input) {
|
||||
String json = GSON_SERIALIZER.serialize(input);
|
||||
return MutableComponent.Serializer.fromJson(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeServer() {
|
||||
AllMusic.log = new LogFabric();
|
||||
|
||||
@@ -6,6 +6,6 @@ import net.kyori.adventure.text.Component;
|
||||
public class LogFabric implements IAllMusicLogger {
|
||||
@Override
|
||||
public void data(Component data) {
|
||||
AllMusicServer.server.sendSystemMessage(AllMusicServer.parse(data));
|
||||
AllMusicServer.server.sendMessage(data);
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -9,6 +9,8 @@ include(":client")
|
||||
project(":client").projectDir = file("client/client")
|
||||
include(":client:core")
|
||||
project(":client:core").projectDir = file("client/client/core")
|
||||
include(":client:core_gl")
|
||||
project(":client:core_gl").projectDir = file("client/client/core_gl")
|
||||
include(":client:fabric_1_16_5")
|
||||
project(":client:fabric_1_16_5").projectDir = file("client/client/fabric_1_16_5")
|
||||
include(":client:fabric_1_20_1")
|
||||
@@ -76,4 +78,4 @@ pluginManagement {
|
||||
maven("https://maven.architectury.dev/")
|
||||
maven("https://nexus.gtnewhorizons.com/repository/public/")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user