1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-03 07:03:00 +00:00

Fix peripheral.getMethods returning {}

I don't even know how this snuck past.

Closes #346
This commit is contained in:
SquidDev
2020-01-14 08:45:08 +00:00
parent 018ecfbaa0
commit 8b1773dd60
4 changed files with 10 additions and 16 deletions

View File

@@ -364,20 +364,17 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange
case 2:
{
// getMethods
String[] methods = null;
ComputerSide side = ComputerSide.valueOfInsensitive( getString( args, 0 ) );
if( side != null )
{
synchronized( m_peripherals )
{
PeripheralWrapper p = m_peripherals[side.ordinal()];
if( p != null )
{
methods = p.getMethods();
}
if( p != null ) return new Object[] { p.getMethods() };
}
}
return methods != null ? new Object[] { new HashMap<>() } : null;
return null;
}
case 3:
{