generated from mingliqiye/lib-tem
no message
This commit is contained in:
parent
9796338c72
commit
34006c08b6
@ -38,7 +38,7 @@ dependencies {
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
implementation("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")
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
GROUPSID=com.mingliqiye
|
||||
ARTIFACTID=minecraft-SLP
|
||||
VERSIONS=1.0.1
|
||||
VERSIONS=1.0.2
|
||||
MAINCLASS=com.mingliqiye.minecraftSLP.Main
|
||||
JDKVERSIONS=1.8
|
||||
|
32
package.json
32
package.json
@ -1,18 +1,18 @@
|
||||
{
|
||||
"name": "maven-repository",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "gradle build-jar",
|
||||
"buildw": "gradlew build-jar",
|
||||
"format": "prettier --write \"**/*.java\""
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"packageManager": "pnpm@10.4.1",
|
||||
"devDependencies": {
|
||||
"prettier-plugin-java": "^2.7.1",
|
||||
"prettier": "^3.6.2"
|
||||
}
|
||||
"name": "maven-repository",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "gradle build-jar",
|
||||
"buildw": "gradlew build-jar",
|
||||
"format": "prettier --write \"**/*.{java,json}\""
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"packageManager": "pnpm@10.4.1",
|
||||
"devDependencies": {
|
||||
"prettier-plugin-java": "^2.7.1",
|
||||
"prettier": "^3.6.2"
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,10 @@ import java.io.IOException;
|
||||
|
||||
public class Main {
|
||||
|
||||
static {
|
||||
System.setProperty("fastjson2.parser.safeMode", "true");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
if (args.length != 1) {
|
||||
System.err.println("请使用 {地址}:{端口号}");
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.mingliqiye.minecraftSLP;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.mingliqiye.network.endpoint.NetworkEndpoint;
|
||||
import java.io.*;
|
||||
import java.net.Socket;
|
||||
@ -9,6 +9,8 @@ import java.nio.ByteOrder;
|
||||
|
||||
public class SLP {
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
/**
|
||||
* 将 int32 4个字节 转换为 short 2 个字节
|
||||
* @param value int32
|
||||
@ -72,7 +74,7 @@ public class SLP {
|
||||
int lengthjson = readVarInt(inputStream);
|
||||
byte[] data = new byte[lengthjson];
|
||||
inputStream.readFully(data);
|
||||
MinecraftServerStatus serverStatus = JSON.parseObject(
|
||||
MinecraftServerStatus serverStatus = objectMapper.readValue(
|
||||
data,
|
||||
MinecraftServerStatus.class
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user