Skip to content

Commit 2f3ee32

Browse files
committed
Fixed ClassCastException for the listCells function
1 parent 4ee4f91 commit 2f3ee32

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics

1 file changed

+3
-3
lines changed

src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,11 @@ public static List<Object> listCells(IGridNode node) {
562562

563563
if (!iterator.hasNext()) return items;
564564
while (iterator.hasNext()) {
565-
DriveBlockEntity entity = (DriveBlockEntity) iterator.next().getService(IStorageProvider.class);
566-
if (entity == null)
565+
IStorageProvider entity = iterator.next().getService(IStorageProvider.class);
566+
if (entity == null || !(entity instanceof DriveBlockEntity drive))
567567
continue;
568568

569-
InternalInventory inventory = entity.getInternalInventory();
569+
InternalInventory inventory = drive.getInternalInventory();
570570

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

0 commit comments

Comments
 (0)