mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Invert talk item pattern check to avoid null comparison
This commit is contained in:
parent
20ea3e8723
commit
7bc0d82de7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user