Add offhand slot to invsee equip (#3265)

This commit is contained in:
pop4959 2020-05-12 21:26:24 -07:00 committed by GitHub
parent a93ca9b7bc
commit a58ba406eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
@ -25,6 +26,9 @@ public class Commandinvsee extends EssentialsCommand {
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();
}