Skip to content

Commit

Permalink
Fixed ClassCastException for the listCells function
Browse files Browse the repository at this point in the history
  • Loading branch information
SirEndii committed Sep 7, 2024
1 parent 4ee4f91 commit 2f3ee32
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,11 @@ public static List<Object> listCells(IGridNode node) {

if (!iterator.hasNext()) return items;
while (iterator.hasNext()) {
DriveBlockEntity entity = (DriveBlockEntity) iterator.next().getService(IStorageProvider.class);
if (entity == null)
IStorageProvider entity = iterator.next().getService(IStorageProvider.class);
if (entity == null || !(entity instanceof DriveBlockEntity drive))
continue;

InternalInventory inventory = entity.getInternalInventory();
InternalInventory inventory = drive.getInternalInventory();

for (int i = 0; i < inventory.size(); i++) {
ItemStack stack = inventory.getStackInSlot(i);
Expand Down

0 comments on commit 2f3ee32

Please sign in to comment.