tutorial:inventory
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:inventory [2022/01/30 03:38] – Corrected Error in Example Code outercloudstudio | tutorial:inventory [2023/11/06 23:28] (current) – binaris00 | ||
---|---|---|---|
Line 103: | Line 103: | ||
default void setStack(int slot, ItemStack stack) { | default void setStack(int slot, ItemStack stack) { | ||
getItems().set(slot, | getItems().set(slot, | ||
- | if (stack.getCount() > getMaxCountPerStack()) { | + | if (stack.getCount() > stack.getMaxCount()) { |
- | stack.setCount(getMaxCountPerStack()); | + | stack.setCount(stack.getMaxCount()); |
} | } | ||
} | } | ||
Line 246: | Line 246: | ||
[...] | [...] | ||
@Override | @Override | ||
- | public int[] getInvAvailableSlots(Direction | + | public int[] getInvAvailableSlots(Direction |
// Just return an array of all slots | // Just return an array of all slots | ||
int[] result = new int[getItems().size()]; | int[] result = new int[getItems().size()]; |
tutorial/inventory.1643513899.txt.gz · Last modified: 2022/01/30 03:38 by outercloudstudio