Fixed PlayerInventory craft result slot

This commit is contained in:
Felix Cravic 2020-04-29 11:40:58 +02:00
parent 2292261de7
commit db1e108464
2 changed files with 13 additions and 10 deletions

View File

@ -242,7 +242,7 @@ public class PlayerInventory implements InventoryModifier, InventoryClickHandler
slot = slot + 36;
} else if (slot > 8 && slot < 36) { // Inventory 9-35
slot = slot;
} else if (slot >= CRAFT_SLOT_1 && slot <= CRAFT_RESULT) { // Crafting 36-40
} else if (slot >= CRAFT_RESULT && slot <= CRAFT_SLOT_4) { // Crafting 36-40
slot = slot - 36;
} else if (slot >= HELMET_SLOT && slot <= BOOTS_SLOT) { // Armor 41-44
slot = slot - 36;

View File

@ -4,11 +4,12 @@ public class PlayerInventoryUtils {
public static final int OFFSET = 9;
public static final int CRAFT_SLOT_1 = 36;
public static final int CRAFT_SLOT_2 = 37;
public static final int CRAFT_SLOT_3 = 38;
public static final int CRAFT_SLOT_4 = 39;
public static final int CRAFT_RESULT = 40;
public static final int CRAFT_RESULT = 36;
public static final int CRAFT_SLOT_1 = 37;
public static final int CRAFT_SLOT_2 = 38;
public static final int CRAFT_SLOT_3 = 39;
public static final int CRAFT_SLOT_4 = 40;
public static final int HELMET_SLOT = 41;
public static final int CHESTPLATE_SLOT = 42;
public static final int LEGGINGS_SLOT = 43;
@ -17,14 +18,16 @@ public class PlayerInventoryUtils {
public static int convertSlot(int slot, int offset) {
switch (slot) {
case 0:
return CRAFT_RESULT;
case 1:
return CRAFT_SLOT_1 + 1;
return CRAFT_SLOT_1;
case 2:
return CRAFT_SLOT_2 + 1;
return CRAFT_SLOT_2;
case 3:
return CRAFT_SLOT_3 + 1;
return CRAFT_SLOT_3;
case 4:
return CRAFT_SLOT_4 + 1;
return CRAFT_SLOT_4;
case 5:
return HELMET_SLOT;
case 6: