mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Allow off-hand in bukkit showitem
This commit is contained in:
1 parent
d9b24569a3
commit
8d1833bd43
1 file changed
+19
-1
@@ -67,7 +67,25 @@ public final class CarbonChatBukkit extends JavaPlugin implements CarbonChat {
|
||||
return empty();
|
||||
}
|
||||
|
||||
final ItemStack itemStack = player.getInventory().getItemInMainHand();
|
||||
final ItemStack itemStack;
|
||||
|
||||
final ItemStack mainHand = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (mainHand != null && !mainHand.getType().isAir()) {
|
||||
itemStack = mainHand;
|
||||
} else {
|
||||
final ItemStack offHand = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (offHand != null && !offHand.getType().isAir()) {
|
||||
itemStack = offHand;
|
||||
} else {
|
||||
itemStack = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack == null) {
|
||||
return empty();
|
||||
}
|
||||
|
||||
if (itemStack.getType().isAir()) {
|
||||
return empty();
|
||||
|
||||
Reference in new issue
Block a user