From 7bc0d82de75aa48ce39ce004177b2c409e4016c5 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 23 Jun 2024 09:51:13 +0800 Subject: [PATCH] Invert talk item pattern check to avoid null comparison --- main/src/main/java/net/citizensnpcs/trait/text/Text.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/net/citizensnpcs/trait/text/Text.java b/main/src/main/java/net/citizensnpcs/trait/text/Text.java index de137cbf8..0412b8b2e 100644 --- a/main/src/main/java/net/citizensnpcs/trait/text/Text.java +++ b/main/src/main/java/net/citizensnpcs/trait/text/Text.java @@ -141,7 +141,7 @@ public class Text extends Trait implements Runnable, Listener { private void onRightClick(NPCRightClickEvent event) { if (!event.getNPC().equals(npc) || text.size() == 0) return; - String localPattern = itemInHandPattern.equals("default") ? Setting.TALK_ITEM.asString() : itemInHandPattern; + String localPattern = "default".equals(itemInHandPattern) ? Setting.TALK_ITEM.asString() : itemInHandPattern; if (Util.matchesItemInHand(event.getClicker(), localPattern) && !shouldTalkClose()) { talk(event.getClicker()); event.setDelayedCancellation(true);