22
33import dev .simplix .protocolize .api .ComponentConverter ;
44import dev .simplix .protocolize .api .Protocolize ;
5+ import dev .simplix .protocolize .api .item .BaseItemStack ;
56import dev .simplix .protocolize .api .item .ItemStack ;
67import dev .simplix .protocolize .api .providers .ComponentConverterProvider ;
78import dev .simplix .protocolize .data .inventory .InventoryType ;
@@ -31,7 +32,7 @@ public class Inventory {
3132 private static final ComponentConverter CONVERTER = Protocolize .getService (ComponentConverterProvider .class )
3233 .platformConverter ();
3334
34- private final Map <Integer , ItemStack > items = new ConcurrentHashMap <>();
35+ private final Map <Integer , BaseItemStack > items = new ConcurrentHashMap <>();
3536 private final List <Consumer <InventoryClick >> clickConsumers = new ArrayList <>();
3637 private final List <Consumer <InventoryClose >> closeConsumers = new ArrayList <>();
3738 private InventoryType type ;
@@ -41,18 +42,18 @@ public Inventory(InventoryType type) {
4142 this .type = type ;
4243 }
4344
44- public void items (List <ItemStack > itemsIndexed ) {
45+ public void items (List <BaseItemStack > itemsIndexed ) {
4546 int slot = 0 ;
46- for (ItemStack stack : itemsIndexed ) {
47+ for (BaseItemStack stack : itemsIndexed ) {
4748 if (stack != null && stack .itemType () != null ) {
4849 items .put (slot , stack );
4950 }
5051 slot ++;
5152 }
5253 }
5354
54- public List <ItemStack > itemsIndexed (int protocolVersion ) {
55- ItemStack [] outArray = new ItemStack [type .getTypicalSize (protocolVersion )];
55+ public List <BaseItemStack > itemsIndexed (int protocolVersion ) {
56+ BaseItemStack [] outArray = new ItemStack [type .getTypicalSize (protocolVersion )];
5657 for (Integer id : items .keySet ()) {
5758 outArray [id ] = items .get (id );
5859 }
@@ -63,7 +64,7 @@ public boolean removeItem(int slot) {
6364 return items .remove (slot ) != null ;
6465 }
6566
66- public ItemStack item (int slot ) {
67+ public BaseItemStack item (int slot ) {
6768 return items .get (slot );
6869 }
6970
0 commit comments