Skip to content

Commit

Permalink
fix: オフハンドのアイテムの挙動を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
matsu1213 committed Mar 29, 2024
1 parent 8381b8d commit abe9529
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.azisaba.lgw.core.listeners.others;

import com.shampaggon.crackshot.CSUtility;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -35,7 +37,13 @@ public void onInventoryClose(InventoryCloseEvent e) {
inventory.addItem(offhand);
} else {
// インベントリーに空きがない場合はドロップ
p.getWorld().dropItem(p.getLocation(), offhand);
//p.getWorld().dropItem(p.getLocation(), offhand);
String weaponTitle = new CSUtility().getWeaponTitle(offhand);
if(weaponTitle == null){
Bukkit.getLogger().info("[LeonGunWar] " + p.getName() + " がオフハンドの " + offhand.getType().name() + " をドロップしようとしました");
}else {
Bukkit.getLogger().info("[LeonGunWar] " + p.getName() + " がオフハンドの " + weaponTitle + " をドロップしようとしました");
}
}

// オフハンドからアイテムを消す
Expand Down

0 comments on commit abe9529

Please sign in to comment.