Skip to content

Commit

Permalink
Update FakeItem slot translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Apr 6, 2016
1 parent 7ebf0b2 commit 76ba784
Showing 1 changed file with 15 additions and 5 deletions.
Expand Up @@ -132,12 +132,22 @@ static void setSlot(CraftPlayer craftPlayer, int slot, ItemStack itemStack, bool
}

static int translateSlot(CraftPlayer craftPlayer, int slot, boolean player_only) {
int total = player_only ? 41 : craftPlayer.getOpenInventory().countSlots();
if (total == 41) {
total += 4;
if (slot > 35) {
slot = 44 + 36 - slot;
if (slot < 0) {
return 0;
}
int total = player_only ? 46 : craftPlayer.getOpenInventory().countSlots();
if (total == 46) {
if (slot == 45) {
return slot;
}
else if (slot > 35) {
slot = 8 - (slot - 36);
return slot;
}
total -= 1;
}
if (slot > total) {
return total;
}
return (int) (slot + (total - 9) - (9 * (2 * Math.floor(slot / 9))));
}
Expand Down

0 comments on commit 76ba784

Please sign in to comment.