Update TileEntityMachineRadarNT.java

Added an OpenComputers function, getPos().
It retuns the position of this radar.
This commit is contained in:
Kirby7871 2025-05-29 02:12:39 +02:00 committed by GitHub
parent 65f1866e8c
commit 3a8e0048a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -694,6 +694,12 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
return new Object[]{false, e.posX, e.posY, e.posZ, type};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getPos(Context context, Arguments args) {
return new Object[] {xCoord, yCoord, zCoord};
}
@Override
@Optional.Method(modid = "OpenComputers")
public String[] methods() {
@ -707,6 +713,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
"isIndexPlayer",
"getIndexType",
"getEntityAtIndex"
"getPos"
};
}
@ -732,6 +739,8 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
return getIndexType(context, args);
case ("getEntityAtIndex"):
return getEntityAtIndex(context, args);
case("getPos"):
return getPos(context, args);
}
throw new NoSuchMethodException();
}