Skip to content

Commit

Permalink
Add offhand slot to invsee equip (#3265)
Browse files Browse the repository at this point in the history
  • Loading branch information
pop4959 committed May 13, 2020
1 parent a93ca9b commit a58ba40
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.earth2me.essentials.commands;

import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.VersionUtil;
import org.bukkit.Server;
import org.bukkit.inventory.Inventory;

Expand All @@ -25,6 +26,9 @@ protected void run(final Server server, final User user, final String commandLab
if (args.length > 1 && user.isAuthorized("essentials.invsee.equip")) {
inv = server.createInventory(invUser.getBase(), 9, "Equipped");
inv.setContents(invUser.getBase().getInventory().getArmorContents());
if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_9_4_R01)) {
inv.setItem(4, invUser.getBase().getInventory().getItemInOffHand());
}
} else {
inv = invUser.getBase().getInventory();
}
Expand Down

0 comments on commit a58ba40

Please sign in to comment.