Compare commits

..

No commits in common. "master" and "Auto-Releases-1.0.1-9796338c72" have entirely different histories.

12 changed files with 38 additions and 172 deletions

View File

@ -1,13 +1,14 @@
import java.security.MessageDigest
import java.text.SimpleDateFormat
import java.util.Date
plugins { import java.security.MessageDigest
id("java") import java.text.SimpleDateFormat
id("java-library") import java.util.Date
id("maven-publish")
id("com.github.johnrengelman.shadow") version ("8.1.1") plugins {
} id("java")
id("java-library")
id("maven-publish")
id("com.github.johnrengelman.shadow") version ("8.1.1")
}
val GROUPSID = project.properties["GROUPSID"] as String val GROUPSID = project.properties["GROUPSID"] as String
val VERSIONS = project.properties["VERSIONS"] as String val VERSIONS = project.properties["VERSIONS"] as String
@ -37,7 +38,7 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher") testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation("org.jetbrains:annotations:24.0.0") implementation("org.jetbrains:annotations:24.0.0")
annotationProcessor("org.jetbrains:annotations:24.0.0") annotationProcessor("org.jetbrains:annotations:24.0.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.19.1") implementation("com.alibaba.fastjson2:fastjson2:2.0.57")
implementation("com.mingliqiye:network-endpoint:1.0.3") implementation("com.mingliqiye:network-endpoint:1.0.3")
} }
@ -132,17 +133,11 @@ tasks.register("build-jar") {
dependsOn(tasks["generatePomFileForMavenJavaPublication"]) dependsOn(tasks["generatePomFileForMavenJavaPublication"])
dependsOn(tasks["generateMetadataFileForMavenJavaPublication"]) dependsOn(tasks["generateMetadataFileForMavenJavaPublication"])
doLast { doLast {
getHash(libDir.toString(), File(libDir, jarName)) getHash(libDir.toString(),File(libDir, jarName))
getHash(libDir.toString(), File(libDir, fatJarName)) getHash(libDir.toString(),File(libDir, fatJarName))
getHash(libDir.toString(), File(libDir, srcJarName)) getHash(libDir.toString(),File(libDir, srcJarName))
getHash( getHash(publicationsDir.toString(),File(publicationsDir, "module.json"))
publicationsDir.toString(), getHash(publicationsDir.toString(),File(publicationsDir, "pom-default.xml"))
File(publicationsDir, "module.json")
)
getHash(
publicationsDir.toString(),
File(publicationsDir, "pom-default.xml")
)
} }
} }
components { components {

View File

@ -1,5 +1,5 @@
GROUPSID=com.mingliqiye GROUPSID=com.mingliqiye
ARTIFACTID=minecraft-SLP ARTIFACTID=minecraft-SLP
VERSIONS=1.0.3 VERSIONS=1.0.1
MAINCLASS=com.mingliqiye.minecraftSLP.Main MAINCLASS=com.mingliqiye.minecraftSLP.Main
JDKVERSIONS=1.8 JDKVERSIONS=1.8

View File

@ -1,18 +1,18 @@
{ {
"name": "maven-repository", "name": "maven-repository",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"scripts": { "scripts": {
"build": "gradle build-jar", "build": "gradle build-jar",
"buildw": "gradlew build-jar", "buildw": "gradlew build-jar",
"format": "prettier --write \"**/*.{java,json}\"" "format": "prettier --write \"**/*.java\""
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"packageManager": "pnpm@10.4.1", "packageManager": "pnpm@10.4.1",
"devDependencies": { "devDependencies": {
"prettier-plugin-java": "^2.7.1", "prettier-plugin-java": "^2.7.1",
"prettier": "^3.6.2" "prettier": "^3.6.2"
} }
} }

View File

@ -6,10 +6,6 @@ import java.io.IOException;
public class Main { public class Main {
static {
System.setProperty("fastjson2.parser.safeMode", "true");
}
public static void main(String[] args) { public static void main(String[] args) {
if (args.length != 1) { if (args.length != 1) {
System.err.println("请使用 {地址}:{端口号}"); System.err.println("请使用 {地址}:{端口号}");

View File

@ -1,5 +1,6 @@
package com.mingliqiye.minecraftSLP; package com.mingliqiye.minecraftSLP;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -13,8 +14,7 @@ public class MinecraftServerStatus {
private boolean previewsChat; private boolean previewsChat;
private String jsonData; private String jsonData;
public MinecraftServerStatus() {} // Getters and Setters
public Description getDescription() { public Description getDescription() {
return description; return description;
} }
@ -71,13 +71,12 @@ public class MinecraftServerStatus {
this.jsonData = jsonData; this.jsonData = jsonData;
} }
// Nested Classes
public static class Description { public static class Description {
private String text; private String text;
private Extra[] extra; private Extra[] extra;
public Description() {}
public String getText() { public String getText() {
return text; return text;
} }
@ -143,8 +142,6 @@ public class MinecraftServerStatus {
private int online; private int online;
private PlayerSample[] sample; private PlayerSample[] sample;
public Players() {}
public int getMax() { public int getMax() {
return max; return max;
} }
@ -205,8 +202,6 @@ public class MinecraftServerStatus {
private String name; private String name;
private int protocol; private int protocol;
public Version() {}
public String getName() { public String getName() {
return name; return name;
} }

View File

@ -1,6 +1,6 @@
package com.mingliqiye.minecraftSLP; package com.mingliqiye.minecraftSLP;
import com.fasterxml.jackson.databind.ObjectMapper; import com.alibaba.fastjson2.JSON;
import com.mingliqiye.network.endpoint.NetworkEndpoint; import com.mingliqiye.network.endpoint.NetworkEndpoint;
import java.io.*; import java.io.*;
import java.net.Socket; import java.net.Socket;
@ -9,8 +9,6 @@ import java.nio.ByteOrder;
public class SLP { public class SLP {
private static final ObjectMapper objectMapper = new ObjectMapper();
/** /**
* int32 4个字节 转换为 short 2 个字节 * int32 4个字节 转换为 short 2 个字节
* @param value int32 * @param value int32
@ -74,7 +72,7 @@ public class SLP {
int lengthjson = readVarInt(inputStream); int lengthjson = readVarInt(inputStream);
byte[] data = new byte[lengthjson]; byte[] data = new byte[lengthjson];
inputStream.readFully(data); inputStream.readFully(data);
MinecraftServerStatus serverStatus = objectMapper.readValue( MinecraftServerStatus serverStatus = JSON.parseObject(
data, data,
MinecraftServerStatus.class MinecraftServerStatus.class
); );

View File

@ -1,8 +0,0 @@
[
{
"name": "java.lang.Boolean",
"methods": [
{ "name": "getBoolean", "parameterTypes": ["java.lang.String"] }
]
}
]

View File

@ -1,6 +0,0 @@
[
{
"type": "agent-extracted",
"classes": []
}
]

View File

@ -1,88 +0,0 @@
[
{
"name": "[Lcom.mingliqiye.minecraftSLP.MinecraftServerStatus$Description$Extra;"
},
{
"name": "[Lcom.mingliqiye.minecraftSLP.MinecraftServerStatus$Players$PlayerSample;"
},
{
"name": "com.fasterxml.jackson.databind.ext.Java7SupportImpl",
"methods": [{ "name": "<init>", "parameterTypes": [] }]
},
{
"name": "com.mingliqiye.minecraftSLP.MinecraftServerStatus",
"allDeclaredFields": true,
"queryAllDeclaredMethods": true,
"queryAllDeclaredConstructors": true,
"methods": [
{ "name": "<init>", "parameterTypes": [] },
{
"name": "setDescription",
"parameterTypes": [
"com.mingliqiye.minecraftSLP.MinecraftServerStatus$Description"
]
},
{ "name": "setEnforcesSecureChat", "parameterTypes": ["boolean"] },
{
"name": "setPlayers",
"parameterTypes": [
"com.mingliqiye.minecraftSLP.MinecraftServerStatus$Players"
]
},
{
"name": "setVersion",
"parameterTypes": [
"com.mingliqiye.minecraftSLP.MinecraftServerStatus$Version"
]
}
]
},
{
"name": "com.mingliqiye.minecraftSLP.MinecraftServerStatus$Description",
"allDeclaredFields": true,
"queryAllDeclaredMethods": true,
"queryAllDeclaredConstructors": true,
"methods": [
{ "name": "<init>", "parameterTypes": [] },
{ "name": "setText", "parameterTypes": ["java.lang.String"] }
]
},
{
"name": "com.mingliqiye.minecraftSLP.MinecraftServerStatus$Description$Extra",
"allDeclaredFields": true,
"queryAllDeclaredMethods": true,
"queryAllDeclaredConstructors": true
},
{
"name": "com.mingliqiye.minecraftSLP.MinecraftServerStatus$Players",
"allDeclaredFields": true,
"queryAllDeclaredMethods": true,
"queryAllDeclaredConstructors": true,
"methods": [
{ "name": "<init>", "parameterTypes": [] },
{ "name": "setMax", "parameterTypes": ["int"] },
{ "name": "setOnline", "parameterTypes": ["int"] }
]
},
{
"name": "com.mingliqiye.minecraftSLP.MinecraftServerStatus$Players$PlayerSample",
"allDeclaredFields": true,
"queryAllDeclaredMethods": true,
"queryAllDeclaredConstructors": true
},
{
"name": "com.mingliqiye.minecraftSLP.MinecraftServerStatus$Version",
"allDeclaredFields": true,
"queryAllDeclaredMethods": true,
"queryAllDeclaredConstructors": true,
"methods": [
{ "name": "<init>", "parameterTypes": [] },
{ "name": "setName", "parameterTypes": ["java.lang.String"] },
{ "name": "setProtocol", "parameterTypes": ["int"] }
]
},
{
"name": "java.util.concurrent.atomic.AtomicReference",
"fields": [{ "name": "value" }]
}
]

View File

@ -1,10 +0,0 @@
{
"resources": {
"includes": [
{
"pattern": "\\QMETA-INF/services/java.time.zone.ZoneRulesProvider\\E"
}
]
},
"bundles": []
}

View File

@ -1,5 +0,0 @@
{
"types": [],
"lambdaCapturingTypes": [],
"proxies": []
}