From 7d50b6b51834ae1165e2c2728e6e829c6fda61ce Mon Sep 17 00:00:00 2001 From: Patrick <147879351+WinniePatGG@users.noreply.github.com> Date: Thu, 4 Jun 2026 01:16:20 +0200 Subject: [PATCH] README.md update --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c18772c..9211b0e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# License Lib by WinniePatGG +# LicenseLib by WinniePatGG ## This library is built for the [license system by Pietriss](https://github.com/Pietriss/pietlizenz) ### Installation @@ -20,21 +20,51 @@ dependencies { You can work with syncResult.isValid() to check if the license is valid and handle it from there ```java import de.winniepat.licenselib.LicenseClient; +import de.winniepat.licenselib.LicenseSuccess; -LicenseClient.LicenseResult syncResult = LicenseClient.check(apiUrl, plugin, licenseKey, serverId); +public class main { + public static void main(String[] args) { + LicenseClient.LicenseResult result = LicenseClient.check( + apiUrl, + plugin, + licenseKey, + serverId //can be null + ); + if (result instanceof LicenceSuccess success) { + if(success.isValid()) { + System.out.println("Valid: " + success); + } else { + System.out.println("Invalid: " + success); + } + } + } +} ``` ### Usage (Async) Here you can also work with result.isValid() and handle it from there -````java +```java import de.winniepat.licenselib.LicenseClient; +import de.winniepat.licenselib.LicenseSuccess; -LicenseClient.checkAsync(apiUrl, plugin, licenseKey, serverId) - .thenAccept(result -> { - if (result.isValid()) { - System.out.println("Async Valid: " + result); - } else { - System.out.println("Async Invalid: " + result); +import java.util.concurrent.CompletableFuture; + +public class main { + public static void main(String[] args) { + CompletableFuture resultAsync = LicenseClient.checkAsync( + apiUrl, + plugin, + licenseKey, + serverId + ); + if (result instanceof LicenseSuccess success) { + if (success.valid()) { + System.out.println("Valid: " + success); + } else { + System.out.println("Invalid " + success); + } } - }); \ No newline at end of file + } +} +``` \ No newline at end of file