generated from mingliqiye/lib-tem
Compare commits
2 Commits
9796338c72
...
2a27d11273
Author | SHA1 | Date | |
---|---|---|---|
2a27d11273 | |||
34006c08b6 |
@ -38,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.alibaba.fastjson2:fastjson2:2.0.57")
|
implementation("com.fasterxml.jackson.core:jackson-databind:2.19.1")
|
||||||
implementation("com.mingliqiye:network-endpoint:1.0.3")
|
implementation("com.mingliqiye:network-endpoint:1.0.3")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
GROUPSID=com.mingliqiye
|
GROUPSID=com.mingliqiye
|
||||||
ARTIFACTID=minecraft-SLP
|
ARTIFACTID=minecraft-SLP
|
||||||
VERSIONS=1.0.1
|
VERSIONS=1.0.2
|
||||||
MAINCLASS=com.mingliqiye.minecraftSLP.Main
|
MAINCLASS=com.mingliqiye.minecraftSLP.Main
|
||||||
JDKVERSIONS=1.8
|
JDKVERSIONS=1.8
|
||||||
|
32
package.json
32
package.json
@ -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\""
|
"format": "prettier --write \"**/*.{java,json}\""
|
||||||
},
|
},
|
||||||
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,10 @@ 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("请使用 {地址}:{端口号}");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.mingliqiye.minecraftSLP;
|
package com.mingliqiye.minecraftSLP;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
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,6 +9,8 @@ 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
|
||||||
@ -72,7 +74,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 = JSON.parseObject(
|
MinecraftServerStatus serverStatus = objectMapper.readValue(
|
||||||
data,
|
data,
|
||||||
MinecraftServerStatus.class
|
MinecraftServerStatus.class
|
||||||
);
|
);
|
||||||
|
8
src/main/resources/META-INF/native-image/jni-config.json
Normal file
8
src/main/resources/META-INF/native-image/jni-config.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "java.lang.Boolean",
|
||||||
|
"methods": [
|
||||||
|
{ "name": "getBoolean", "parameterTypes": ["java.lang.String"] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,6 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"type": "agent-extracted",
|
||||||
|
"classes": []
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1 @@
|
|||||||
|
[]
|
@ -0,0 +1 @@
|
|||||||
|
[]
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"resources": {
|
||||||
|
"includes": []
|
||||||
|
},
|
||||||
|
"bundles": []
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"types": [],
|
||||||
|
"lambdaCapturingTypes": [],
|
||||||
|
"proxies": []
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user