Added post-rollback sorting for player inventories
This commit is contained in:
parent
840eb3b4ee
commit
5861570f8a
2 changed files with 56 additions and 9 deletions
|
|
@ -656,7 +656,7 @@ public class Util extends Queue {
|
|||
return artname;
|
||||
}
|
||||
|
||||
public static boolean setPlayerArmor(PlayerInventory inventory, ItemStack itemStack) {
|
||||
public static int setPlayerArmor(PlayerInventory inventory, ItemStack itemStack) {
|
||||
String itemName = itemStack.getType().name();
|
||||
boolean isHelmet = (itemName.endsWith("_HELMET") || itemName.endsWith("_HEAD") || itemName.endsWith("_SKULL") || itemName.endsWith("_PUMPKIN"));
|
||||
boolean isChestplate = (itemName.endsWith("_CHESTPLATE"));
|
||||
|
|
@ -665,22 +665,22 @@ public class Util extends Queue {
|
|||
|
||||
if (isHelmet && inventory.getHelmet() == null) {
|
||||
inventory.setHelmet(itemStack);
|
||||
return true;
|
||||
return 3;
|
||||
}
|
||||
else if (isChestplate && inventory.getChestplate() == null) {
|
||||
inventory.setChestplate(itemStack);
|
||||
return true;
|
||||
return 2;
|
||||
}
|
||||
else if (isLeggings && inventory.getLeggings() == null) {
|
||||
inventory.setLeggings(itemStack);
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
else if (isBoots && inventory.getBoots() == null) {
|
||||
inventory.setBoots(itemStack);
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static ItemStack[] getArmorStandContents(EntityEquipment equipment) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue