User Tools

Site Tools


tutorial:inventory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:inventory [2022/01/30 03:38] – Corrected Error in Example Code outercloudstudiotutorial: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, stack);         getItems().set(slot, stack);
-        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 var1) {+    public int[] getInvAvailableSlots(Direction side) {
         // 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