mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Export all minecraft json in raw object. Use modern minecraftping for all minecraft queries.
This commit is contained in:
parent
82961e550c
commit
9b9277172d
2 changed files with 7 additions and 6 deletions
|
|
@ -14,7 +14,7 @@ function buildPacket(id,data) {
|
|||
]);
|
||||
}
|
||||
|
||||
class MinecraftPing extends require('./core') {
|
||||
class Minecraft extends require('./core') {
|
||||
run(state) {
|
||||
let receivedData;
|
||||
|
||||
|
|
@ -75,9 +75,8 @@ class MinecraftPing extends require('./core') {
|
|||
return this.fatal('Invalid JSON');
|
||||
}
|
||||
|
||||
state.raw.version = json.version.name;
|
||||
state.raw = json;
|
||||
state.maxplayers = json.players.max;
|
||||
state.raw.description = json.description.text;
|
||||
if(json.players.sample) {
|
||||
for(const player of json.players.sample) {
|
||||
state.players.push({
|
||||
|
|
@ -96,4 +95,4 @@ class MinecraftPing extends require('./core') {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports = MinecraftPing;
|
||||
module.exports = Minecraft;
|
||||
Loading…
Add table
Add a link
Reference in a new issue