Skip to content

Commit

Permalink
哪个弱智写无限弓不判断无限附魔?是我
Browse files Browse the repository at this point in the history
  • Loading branch information
0XPYEX0 committed Jan 21, 2024
1 parent c4f6d81 commit 01c87ed
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import me.xpyex.plugin.xplib.bukkit.util.inventory.ItemUtil;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
Expand All @@ -26,6 +27,7 @@ public void onRightClick(PlayerInteractEvent event) {
if (event.getItem().getType() == Material.BOW) {
PlayerInventory playerInv = event.getPlayer().getInventory();
if (InvUtil.hasItemType(playerInv, Material.ARROW)) return;
if (event.getItem().getEnchantmentLevel(Enchantment.ARROW_INFINITE) <= 0) return;

EquipmentSlot targetHand = event.getHand() == EquipmentSlot.HAND ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND;
ItemStack stack = playerInv.getItem(targetHand).clone();
Expand Down

0 comments on commit 01c87ed

Please sign in to comment.