use updated library
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m23s

This commit is contained in:
Lee 2024-04-15 09:03:06 +01:00
parent cfc7a6c9fa
commit cb91880caf
4 changed files with 26 additions and 25 deletions

@ -14,7 +14,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"lucide-react": "^0.368.0",
"mcutils-library": "^1.0.2",
"mcutils-library": "^1.1.0",
"next": "14.2.1",
"next-themes": "^0.3.0",
"react": "^18",

8
pnpm-lock.yaml generated

@ -21,8 +21,8 @@ dependencies:
specifier: ^0.368.0
version: 0.368.0(react@18.2.0)
mcutils-library:
specifier: ^1.0.2
version: 1.0.2(@babel/core@7.24.4)(@types/node@20.12.7)
specifier: ^1.1.0
version: 1.1.0(@babel/core@7.24.4)(@types/node@20.12.7)
next:
specifier: 14.2.1
version: 14.2.1(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0)
@ -3516,8 +3516,8 @@ packages:
tmpl: 1.0.5
dev: false
/mcutils-library@1.0.2(@babel/core@7.24.4)(@types/node@20.12.7):
resolution: {integrity: sha512-Yl9w3H4FqDmhki32HGvR1jDLzhSJqaWuBiUqYom+5IZk6sLh5j6yfRVFvwHTOLfx/Ee43FWFBXeM+9TQoTUC4Q==}
/mcutils-library@1.1.0(@babel/core@7.24.4)(@types/node@20.12.7):
resolution: {integrity: sha512-G3qeRybVMUlfd36+ioqG5YsMgX+zDy3aeLk0qRqkjZ3zXvOgZ1OhjOFP7lEUcsMQ5nmcgwCCBqzk/UpAGiiDXg==}
dependencies:
axios: 1.6.8
jest: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2)

@ -1,6 +1,6 @@
"use client";
import mcUtils from "mcutils-library";
import { getPlayer } from "mcutils-library";
import Image from "next/image";
import Link from "next/link";
import { useState } from "react";
@ -12,19 +12,20 @@ export default function PlayerSearch() {
const [playerId, setPlayerId] = useState<string | null>(null);
const [player, setPlayer] = useState<any | null>(null);
const handleLookup = () => {
const handleLookup = async () => {
if (playerId === null || playerId.length <= 0) {
toast.error("Please enter a player ID");
return;
}
mcUtils.player
.getPlayer(playerId)
.then((response) => {
setPlayer(response.player);
})
.catch(() => {
toast.error("Player not found");
});
try {
const cachedPlayer = await getPlayer(playerId);
const { player } = cachedPlayer;
setPlayer(player);
} catch (error) {
toast.error("Unknown player");
return;
}
};
const handleKeyDown = (e: any) => {

@ -1,7 +1,7 @@
"use client";
import { cn } from "@/common/utils";
import mcUtils from "mcutils-library";
import { getServer } from "mcutils-library";
import JavaMinecraftServer from "mcutils-library/dist/types/server/javaServer";
import { ServerPlatform } from "mcutils-library/dist/types/server/platform";
import Image from "next/image";
@ -14,19 +14,19 @@ export default function ServerSearch() {
const [serverHostname, setServerHostname] = useState<string | null>(null);
const [server, setServer] = useState<JavaMinecraftServer | null>(null);
const handleLookup = () => {
const handleLookup = async () => {
if (serverHostname === null || serverHostname.length <= 0) {
toast.error("Please enter a server hostname");
return;
}
mcUtils.server
.getServer(ServerPlatform.Java, serverHostname)
.then((response) => {
setServer(response.server as JavaMinecraftServer);
})
.catch(() => {
toast.error("Server not found");
});
try {
const cachedServer = await getServer(ServerPlatform.Java, serverHostname);
const { server } = cachedServer;
setServer(server as JavaMinecraftServer);
} catch (error) {
toast.error("Unknown server");
return;
}
};
const handleKeyDown = (e: any) => {