From 1f3f32f49fed85fa3ac6df870808b6a898ec2bdb Mon Sep 17 00:00:00 2001 From: GrahamKracker Date: Wed, 11 Dec 2024 11:29:28 -0500 Subject: [PATCH] use string.matches instead of pattern matcher --- .../generated/.cache/cabcb80d088276cffde41e74584028f1c00b99b8 | 2 +- .../farming/garden/visitors/VisitorDropProtection.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/generated/.cache/cabcb80d088276cffde41e74584028f1c00b99b8 b/src/main/generated/.cache/cabcb80d088276cffde41e74584028f1c00b99b8 index 24221a42..08a5164d 100644 --- a/src/main/generated/.cache/cabcb80d088276cffde41e74584028f1c00b99b8 +++ b/src/main/generated/.cache/cabcb80d088276cffde41e74584028f1c00b99b8 @@ -1,2 +1,2 @@ -// 1.21.3 2024-12-11T10:48:26.7384154 cookies-mod/Language (en_us) +// 1.21.3 2024-12-11T11:17:47.4766913 cookies-mod/Language (en_us) b8e506abeadfabc1b260c9088e803802d2607fc9 assets\cookies-mod\lang\en_us.json diff --git a/src/main/java/codes/cookies/mod/features/farming/garden/visitors/VisitorDropProtection.java b/src/main/java/codes/cookies/mod/features/farming/garden/visitors/VisitorDropProtection.java index f5c1f39e..b8c07375 100644 --- a/src/main/java/codes/cookies/mod/features/farming/garden/visitors/VisitorDropProtection.java +++ b/src/main/java/codes/cookies/mod/features/farming/garden/visitors/VisitorDropProtection.java @@ -66,7 +66,8 @@ private boolean handleAcceptItem(ItemStack visitorItem) { } var lore = String.join("\n", visitorItem.get(DataComponentTypes.LORE).lines().stream().map(Text::getString).toArray(String[]::new)); - if (!lore.matches("Rewards:([\\S\\s]*)(?:Click|Missing)")) { + if (!lore.matches("[\\S\\s]*Rewards:([\\S\\s]*)(?:Click|Missing)[\\S\\s]*")) { + CookiesUtils.sendMessage("Invalid lore: " + lore); return false; }