Skip to content

Commit

Permalink
Fixed HideFlags error when you are not holding anything
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcilore committed Jun 21, 2024
1 parent da96981 commit 4f72b66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/net/serble/estools/Commands/HideFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.serble.estools.EsToolsCommand;
import net.serble.estools.ServerApi.EsItemFlag;
import net.serble.estools.ServerApi.EsMaterial;
import net.serble.estools.ServerApi.Interfaces.EsCommandSender;
import net.serble.estools.ServerApi.Interfaces.EsItemMeta;
import net.serble.estools.ServerApi.Interfaces.EsItemStack;
Expand All @@ -19,7 +20,7 @@ public boolean execute(EsCommandSender sender, String[] args) {

EsItemStack is = ((EsPlayer) sender).getMainHand();

if (is == null || Objects.equals(is.getType(), "AIR") || is.getItemMeta() == null) {
if (is == null || Objects.equals(is.getType(), EsMaterial.createUnchecked("AIR")) || is.getItemMeta() == null) {
send(sender, "&cMust be a damageable item");
return false;
}
Expand Down

0 comments on commit 4f72b66

Please sign in to comment.