Skip to content

Commit

Permalink
change slot index starts from 1
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Apr 27, 2024
1 parent 62e5583 commit 5062b4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public static Map<String, Object> stackToObjectWithSlot(@NotNull ItemStack stack
return null;
}
Map<String, Object> map = itemStackToObject(stack);
map.put("slot", slot);
map.put("slot", slot + 1);
return map;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public static Pair<ItemFilter, String> parse(Map<?, ?> item) {
}
if (item.containsKey("fromSlot")) {
try {
itemFilter.fromSlot = TableHelper.getIntField(item, "fromSlot");
itemFilter.fromSlot = TableHelper.getIntField(item, "fromSlot") - 1;
} catch (LuaException luaException) {
return Pair.of(null, "NO_VALID_FROMSLOT");
}
}
if (item.containsKey("toSlot")) {
try {
itemFilter.toSlot = TableHelper.getIntField(item, "toSlot");
itemFilter.toSlot = TableHelper.getIntField(item, "toSlot") - 1;
} catch (LuaException luaException) {
return Pair.of(null, "NO_VALID_TOSLOT");
}
Expand Down

0 comments on commit 5062b4d

Please sign in to comment.