Skip to content

Commit

Permalink
fix: An error when converting air item to NBTItem
Browse files Browse the repository at this point in the history
  • Loading branch information
blank038 committed Dec 18, 2023
1 parent 5222c96 commit 68a3095
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.blank038.servermarket.internal.util.ItemUtil;
import com.blank038.servermarket.internal.util.TextUtil;
import de.tr7zw.nbtapi.NBTItem;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
Expand Down Expand Up @@ -99,7 +100,7 @@ public void open(int currentPage) {
Player clicker = (Player) e.getWhoClicked();
// 获取点击的物品和物品的Tag
ItemStack itemStack = e.getCurrentItem();
if (itemStack == null) {
if (itemStack == null || itemStack.getType() == Material.AIR) {
return;
}
if (this.isCooldown(clicker.getUniqueId())) {
Expand Down

0 comments on commit 68a3095

Please sign in to comment.