Skip to content

Commit f976138

Browse files
committed
Fix .isDiskPresent() always reporting true
We were still determining if the stack was null, but post-1.11 this will never be the case.
1 parent 1ef7c8e commit f976138

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public Object[] callMethod( @Nonnull IComputerAccess computer, @Nonnull ILuaCont
6262
{
6363
case 0:
6464
{
65-
// isPresent
65+
// isDiskPresent
6666
return new Object[] {
67-
m_diskDrive.getDiskStack() != null
67+
!m_diskDrive.getDiskStack().isEmpty()
6868
};
6969
}
7070
case 1:

src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ public IPeripheral getPeripheral( EnumFacing side )
423423
return new DiskDrivePeripheral( this );
424424
}
425425

426+
@Nonnull
426427
public ItemStack getDiskStack()
427428
{
428429
synchronized( this )

0 commit comments

Comments
 (0)