From 275552fe042e967b4b360d178b0db7257abe8b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A5=93?= Date: Thu, 19 Jun 2025 17:10:01 +0800 Subject: [PATCH] Added `hasValue` function for Lazy (#148) --- src/main/java/com/gtnewhorizon/gtnhlib/util/data/Lazy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/gtnewhorizon/gtnhlib/util/data/Lazy.java b/src/main/java/com/gtnewhorizon/gtnhlib/util/data/Lazy.java index 7495f995..e18880f7 100644 --- a/src/main/java/com/gtnewhorizon/gtnhlib/util/data/Lazy.java +++ b/src/main/java/com/gtnewhorizon/gtnhlib/util/data/Lazy.java @@ -40,6 +40,10 @@ public class Lazy implements Supplier { return value; } + public synchronized boolean hasValue() { + return hasValue; + } + /** * Initializes the value. {@link #get()}, but with a more readable method name. */