Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: LimeGlass <[email protected]>
  • Loading branch information
cheeezburga and TheLimeGlass authored Jun 16, 2024
1 parent 038e77e commit 6a66507
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/main/java/ch/njol/skript/conditions/CondTooltip.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@
public class CondTooltip extends Condition {

static {
if (Skript.methodExists(ItemMeta.class, "isHideTooltip")) // this method was added in the same version as the additional tooltip item flag
if (Skript.methodExists(ItemMeta.class, "isHideTooltip")) {// this method was added in the same version as the additional tooltip item flag
Skript.registerCondition(CondTooltip.class,
"[the] [entire|:additional] tool[ ]tip[s] of %itemtypes% (is|are) (:shown|hidden)",
"[the] [entire|:additional] tool[ ]tip[s] of %itemtypes% (isn't|is not|aren't|are not) (:shown|hidden)",
"%itemtypes%'[s] [entire|:additional] tool[ ]tip[s] (is|are) (:shown|hidden)",
"%itemtypes%'[s] [entire|:additional] tool[ ]tip[s] (isn't|is not|aren't|are not) (:shown|hidden)");
"%itemtypes%'[s] [entire|:additional] tool[ ]tip[s] (isn't|is not|aren't|are not) (:shown|hidden)"
);
}
}

@SuppressWarnings("NotNullFieldNotInitialized")
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/ch/njol/skript/effects/EffTooltip.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
public class EffTooltip extends Effect {

static {
if (Skript.methodExists(ItemMeta.class, "setHideTooltip", boolean.class)) // this method was added in the same version as the additional tooltip item flag
if (Skript.methodExists(ItemMeta.class, "setHideTooltip", boolean.class)) { // this method was added in the same version as the additional tooltip item flag
Skript.registerEffect(EffTooltip.class,
"(:show|hide) %itemtypes%'[s] [entire|:additional] tool[ ]tip",
"(:show|hide) [the] [entire|:additional] tool[ ]tip of %itemtypes%");
"(:show|hide) [the] [entire|:additional] tool[ ]tip of %itemtypes%"
);
}
}

@SuppressWarnings("NotNullFieldNotInitialized")
Expand Down

0 comments on commit 6a66507

Please sign in to comment.